UX improvements
* When clicking on empty space in the snapshot editor, the selection reverts to the sheet containing the scene
This commit is contained in:
parent
0f7d918547
commit
2daa270879
6 changed files with 65 additions and 43 deletions
|
@ -10,11 +10,19 @@ import type {$IntentionalAny} from '@theatre/shared/utils/types'
|
|||
|
||||
const publicAPIToPrivateAPIMap = new WeakMap()
|
||||
|
||||
export function privateAPI(pub: IProject): Project
|
||||
export function privateAPI(pub: ISheet): Sheet
|
||||
export function privateAPI(pub: ISheetObject<$IntentionalAny>): SheetObject
|
||||
export function privateAPI(pub: ISequence): Sequence
|
||||
export function privateAPI(pub: {}): unknown {
|
||||
export function privateAPI<
|
||||
P extends IProject | ISheet | ISheetObject<$IntentionalAny> | ISequence,
|
||||
>(
|
||||
pub: P,
|
||||
): P extends IProject
|
||||
? Project
|
||||
: P extends ISheet
|
||||
? Sheet
|
||||
: P extends ISheetObject<$IntentionalAny>
|
||||
? SheetObject
|
||||
: P extends ISequence
|
||||
? Sequence
|
||||
: never {
|
||||
return publicAPIToPrivateAPIMap.get(pub)
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import type Sequence from './Sequence'
|
|||
import type {IPlaybackDirection, IPlaybackRange} from './Sequence'
|
||||
|
||||
export interface ISequence {
|
||||
readonly type: 'Theatre_Sequence_PublicAPI'
|
||||
|
||||
/**
|
||||
* Starts playback of a sequence.
|
||||
* Returns a promise that either resolves to true when the playback completes,
|
||||
|
@ -24,7 +26,11 @@ export interface ISequence {
|
|||
time: number
|
||||
}
|
||||
|
||||
export default class TheatreSequence {
|
||||
export default class TheatreSequence implements ISequence {
|
||||
get type(): 'Theatre_Sequence_PublicAPI' {
|
||||
return 'Theatre_Sequence_PublicAPI'
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue