0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00
svelte/store.d.ts
2018-10-27 16:46:24 -04:00

20 lines
431 B
TypeScript

interface Options {
immutable: boolean;
}
interface Cancellable {
cancel: () => void;
}
type State = Record<string, any>;
export declare class Store {
constructor(state: State, options?: Options);
public compute(key: string, dependencies: string[]): void;
public fire(name: string, data?: any): void;
public get(): State;
public on(name: string, callback: (data: any) => void): Cancellable;
public set(state: State);
}