UNPKG

@player-ui/player

Version:

20 lines 987 B
export interface Store { useLocalState<T>(initialState: T): readonly [T, (value: T) => void]; useSharedState<T>(key: string | symbol): (initialState: T) => readonly [T, (value: T) => void]; } interface SharedStore { getLocalStateFunction<T>(key: string | symbol, countKey: symbol): (initialState: T) => readonly [T, (value: T) => void]; useSharedState<T>(key: string | symbol): (initialState: T) => readonly [T, (value: T) => void]; } /** A store that holds on to state for a transform */ export declare class LocalStateStore implements SharedStore { private state; private updateCallback?; constructor(onUpdate?: () => void); removeKey(key: symbol | string): void; reset(): void; useSharedState<T>(key: string | symbol): (initialState: T) => readonly [T, (newState: T) => void]; getLocalStateFunction<T>(key: symbol, countKey: symbol): (initialState: T) => readonly [T, (newState: T) => void]; } export {}; //# sourceMappingURL=store.d.ts.map