From b2718cedb924b612df3cc63417eaff26da4f6a2e Mon Sep 17 00:00:00 2001 From: mrkishi Date: Sun, 28 Oct 2018 03:44:27 -0300 Subject: [PATCH] Add missing types to store.d.ts --- store.d.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/store.d.ts b/store.d.ts index 95d90c3848..aa280da953 100644 --- a/store.d.ts +++ b/store.d.ts @@ -6,14 +6,24 @@ interface Cancellable { cancel: () => void; } +interface Tuple extends Array { + 0: T; + length: L; +} + type State = Record; export declare class Store { constructor(state: State, options?: Options); - public compute(key: string, dependencies: string[]): void; + public compute( + key: string, + dependencies: Tuple, + fn: (...dependencies: Tuple) => any, + ): void; + public fire(name: string, data?: any): void; public get(): State; public on(name: string, callback: (data: any) => void): Cancellable; - public set(state: State); + public set(state: State): void; }