Skip to content

Commit

Permalink
initial flow types (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff authored and rt2zz committed Aug 28, 2016
1 parent 4954519 commit e9503e3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions redux-persist.js.flow
@@ -0,0 +1,42 @@
declare module 'redux-persist' {
declare type Action = Object
declare type Dispatch = (a: Action) => any
declare type Store = {
dispatch: Dispatch,
subscribe: (listener: () => void) => () => void,
}
declare type Storage = {
setItem: Function,
getItem: Function,
removeItem: Function,
getAllKeys: Function,
}
declare type Config = {
blacklist?: Array<string>,
whitelist?: Array<string>,
storage?: Storage,
transforms?: Array<Object>,
debounce?: number,
}
declare type Purge = (keys: Array<string>) => void
declare type Rehydrate = (incoming: Object, options: { serial: boolean }) => void
declare type Persistor = {
purge: Purge,
rehydrate: Rehydrate,
pause: () => void,
resume: () => void,
}
declare type OnComplete = (err?: any, result?: Object) => void
declare type PersistStore = (store: Store, config: Config, onComplete: OnComplete) => Persistor
declare type GetStoredState = (config: Config, onComplete: OnComplete) => void
declare type CreatePersistor = (store: Store, config: Config) => Persistor
declare type StoreEnhancer = (next: Function) => Function
declare type AutoRehydrate = Function
declare class ReduxPersist {
persistStore: PersistStore,
autoRehydrate: AutoRehydrate,
getStoredState: GetStoredState,
createPersistor: CreatePersistor,
}
declare var exports: ReduxPersist;
}

0 comments on commit e9503e3

Please sign in to comment.