This repository has been archived by the owner on May 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade dependencies * Improve Flow coverage * Upgrade dependencies
- Loading branch information
1 parent
9f53f03
commit b02fea3
Showing
11 changed files
with
670 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// flow-typed signature: cca4916b0213065533df8335c3285a4a | ||
// flow-typed version: cab04034e7/redux_v3.x.x/flow_>=v0.55.x | ||
|
||
/* eslint-disable */ | ||
|
||
declare module 'redux' { | ||
/* | ||
S = State | ||
A = Action | ||
D = Dispatch | ||
*/ | ||
|
||
declare export type DispatchAPI<A> = (action: A) => A; | ||
declare export type Dispatch<A: {type: $Subtype<string>}> = DispatchAPI<A>; | ||
|
||
declare export type MiddlewareAPI<S, A, D = Dispatch<A>> = { | ||
dispatch: D, | ||
getState(): S, | ||
}; | ||
|
||
declare export type Store<S, A, D = Dispatch<A>> = { | ||
// rewrite MiddlewareAPI members in order to get nicer error messages (intersections produce long messages) | ||
dispatch: D, | ||
getState(): S, | ||
subscribe(listener: () => void): () => void, | ||
replaceReducer(nextReducer: Reducer<S, A>): void, | ||
}; | ||
|
||
declare export type Reducer<S, A> = (state: S | void, action: A) => S; | ||
|
||
declare export type CombinedReducer<S, A> = ( | ||
state: ($Shape<S> & {}) | void, | ||
action: A | ||
) => S; | ||
|
||
declare export type Middleware<S, A, D = Dispatch<A>> = ( | ||
api: MiddlewareAPI<S, A, D> | ||
) => (next: D) => D; | ||
|
||
declare export type StoreCreator<S, A, D = Dispatch<A>> = { | ||
(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<S, A, D>): Store<S, A, D>, | ||
( | ||
reducer: Reducer<S, A>, | ||
preloadedState: S, | ||
enhancer?: StoreEnhancer<S, A, D> | ||
): Store<S, A, D>, | ||
}; | ||
|
||
declare export type StoreEnhancer<S, A, D = Dispatch<A>> = ( | ||
next: StoreCreator<S, A, D> | ||
) => StoreCreator<S, A, D>; | ||
|
||
declare export function createStore<S, A, D>( | ||
reducer: Reducer<S, A>, | ||
enhancer?: StoreEnhancer<S, A, D> | ||
): Store<S, A, D>; | ||
declare export function createStore<S, A, D>( | ||
reducer: Reducer<S, A>, | ||
preloadedState?: S, | ||
enhancer?: StoreEnhancer<S, A, D> | ||
): Store<S, A, D>; | ||
|
||
declare export function applyMiddleware<S, A, D>( | ||
...middlewares: Array<Middleware<S, A, D>> | ||
): StoreEnhancer<S, A, D>; | ||
|
||
declare export type ActionCreator<A, B> = (...args: Array<B>) => A; | ||
declare export type ActionCreators<K, A> = {[key: K]: ActionCreator<A, any>}; | ||
|
||
declare export function bindActionCreators< | ||
A, | ||
C: ActionCreator<A, any>, | ||
D: DispatchAPI<A> | ||
>( | ||
actionCreator: C, | ||
dispatch: D | ||
): C; | ||
declare export function bindActionCreators< | ||
A, | ||
K, | ||
C: ActionCreators<K, A>, | ||
D: DispatchAPI<A> | ||
>( | ||
actionCreators: C, | ||
dispatch: D | ||
): C; | ||
|
||
declare export function combineReducers<O: Object, A>( | ||
reducers: O | ||
): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>; | ||
|
||
declare export var compose: $Compose; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @flow | ||
|
||
/* eslint-disable */ | ||
|
||
declare module 'redux-reactors' { | ||
import type {Reducer, StoreCreator} from 'redux'; | ||
|
||
declare type Reactor<TType, TPayload> = (payload: TPayload) => ({ | ||
type: TType, | ||
payload: TPayload, | ||
__REACTOR__: boolean | ||
}); | ||
declare function createReactor<TType>(type: TType, reducer: Reducer<*, *>): Reactor<TType, *>; | ||
|
||
declare function reactorEnhancer(createStore: StoreCreator<*, *, *>): StoreCreator<*, *, *>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* eslint-disable */ | ||
|
||
declare type tape$TestOpts = { | ||
skip: boolean, | ||
timeout?: number, | ||
} | { | ||
skip?: boolean, | ||
timeout: number, | ||
}; | ||
|
||
declare type tape$TestCb = (t: tape$Context) => mixed; | ||
declare type tape$TestFn = (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestOpts | tape$TestCb, c?: tape$TestCb) => void; | ||
|
||
declare interface tape$Context { | ||
fail(msg?: string): void, | ||
pass(msg?: string): void, | ||
|
||
error(err: mixed, msg?: string): void, | ||
ifError(err: mixed, msg?: string): void, | ||
ifErr(err: mixed, msg?: string): void, | ||
iferror(err: mixed, msg?: string): void, | ||
|
||
ok(value: mixed, msg?: string): void, | ||
true(value: mixed, msg?: string): void, | ||
assert(value: mixed, msg?: string): void, | ||
|
||
notOk(value: mixed, msg?: string): void, | ||
false(value: mixed, msg?: string): void, | ||
notok(value: mixed, msg?: string): void, | ||
|
||
// equal + aliases | ||
equal(actual: mixed, expected: mixed, msg?: string): void, | ||
equals(actual: mixed, expected: mixed, msg?: string): void, | ||
isEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
is(actual: mixed, expected: mixed, msg?: string): void, | ||
strictEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
strictEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// notEqual + aliases | ||
notEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
notStrictEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notStrictEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
isNot(actual: mixed, expected: mixed, msg?: string): void, | ||
not(actual: mixed, expected: mixed, msg?: string): void, | ||
doesNotEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
isInequal(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// deepEqual + aliases | ||
deepEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
deepEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
isEquivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
same(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// notDeepEqual | ||
notDeepEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notEquivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
notDeeply(actual: mixed, expected: mixed, msg?: string): void, | ||
notSame(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotDeepEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotDeeply(actual: mixed, expected: mixed, msg?: string): void, | ||
isNotEquivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
isInequivalent(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// deepLooseEqual | ||
deepLooseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
looseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
looseEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
// notDeepLooseEqual | ||
notDeepLooseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notLooseEqual(actual: mixed, expected: mixed, msg?: string): void, | ||
notLooseEquals(actual: mixed, expected: mixed, msg?: string): void, | ||
|
||
throws(fn: Function, expected?: RegExp | Function, msg?: string): void, | ||
doesNotThrow(fn: Function, expected?: RegExp | Function, msg?: string): void, | ||
|
||
timeoutAfter(ms: number): void, | ||
|
||
skip(msg?: string): void, | ||
plan(n: number): void, | ||
onFinish(fn: Function): void, | ||
end(): void, | ||
comment(msg: string): void, | ||
test: tape$TestFn, | ||
} | ||
|
||
declare module 'tape-cup' { | ||
declare type TestHarness = Tape; | ||
declare type StreamOpts = { | ||
objectMode?: boolean, | ||
}; | ||
|
||
declare type Tape = { | ||
(a: string | tape$TestOpts | tape$TestCb, b?: tape$TestCb | tape$TestOpts, c?: tape$TestCb, ...rest: Array<void>): void, | ||
test: tape$TestFn, | ||
skip: (name: string, cb?: tape$TestCb) => void, | ||
createHarness: () => TestHarness, | ||
createStream: (opts?: StreamOpts) => stream$Readable, | ||
only: (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestCb | tape$TestOpts, c?: tape$TestCb, ...rest: Array<void>) => void, | ||
}; | ||
|
||
declare module.exports: Tape; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.