From 59d67f085b4a10c59ef0e74f3bc3ad31088876d9 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 27 Oct 2018 16:46:24 -0400 Subject: [PATCH] update store types --- store.d.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/store.d.ts b/store.d.ts index db29eaaa2a..95d90c3848 100644 --- a/store.d.ts +++ b/store.d.ts @@ -2,22 +2,18 @@ interface Options { immutable: boolean; } -interface ObserveOptions { - defer: boolean; - init: boolean; -} - interface Cancellable { cancel: () => void; } -export declare class Store { +type State = Record; + +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 get(key: string): T; - public observe(key: string, callback: (value: T) => any, options?: ObserveOptions): Cancellable; - public onchange(callback: (state: State) => any): Cancellable; + public on(name: string, callback: (data: any) => void): Cancellable; public set(state: State); }