diff --git a/types/dispatchr/addons/createStore.d.ts b/types/dispatchr/addons/createStore.d.ts index 0c6388d1ae..df8e12cf03 100644 --- a/types/dispatchr/addons/createStore.d.ts +++ b/types/dispatchr/addons/createStore.d.ts @@ -1,13 +1,20 @@ import { StoreClass, Store } from '../index'; +type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; +type Omit = Pick>; + interface StoreOptions { - initialize?(): void; storeName: string; handlers: { [event: string]: string }; - [prop: string]: any; + statics?: { [prop: string]: any }; + mixins?: object[]; + initialize?(): void; + dehydrate?(): any; + rehydrate?(state: any): void; } -type CreateStore = (options: This & ThisType) => StoreClass; +// see: https://github.com/yahoo/fluxible/blob/dispatchr-v1.2.0/packages/dispatchr/addons/createStore.js#L9 +type StoreThis = Omit & Store -declare const _: CreateStore; -export = _; +declare function createStore(options: T & ThisType>): StoreClass; +export = createStore;