mirror of https://github.com/trezor/trezor-wallet
parent
c597f482dc
commit
15505ff263
@ -0,0 +1,15 @@
|
||||
/* @flow */
|
||||
'use strict';
|
||||
|
||||
import * as PENDING from './constants/pendingTx';
|
||||
import type { State, PendingTx } from '../reducers/PendingTxReducer'
|
||||
|
||||
export type PendingTxAction = {
|
||||
type: typeof PENDING.FROM_STORAGE,
|
||||
payload: State
|
||||
} | {
|
||||
type: typeof PENDING.TX_RESOLVED,
|
||||
tx: PendingTx,
|
||||
receipt: Object,
|
||||
block: string
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
/* @flow */
|
||||
'use strict';
|
||||
|
||||
export const FROM_STORAGE: 'pending__from_storage' = 'pending__from_storage';
|
||||
export const TX_RESOLVED: 'pending__tx_resolved' = 'pending__tx_resolved';
|
@ -0,0 +1,74 @@
|
||||
// flow-typed signature: cca4916b0213065533df8335c3285a4a
|
||||
// flow-typed version: cab04034e7/redux_v3.x.x/flow_>=v0.55.x
|
||||
|
||||
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>;
|
||||
/* NEW: Dispatch is now a combination of these different dispatch types */
|
||||
declare export type Dispatch<S, A> = PlainDispatch<A> & ThunkDispatch<S, A>;
|
||||
|
||||
// declare export type ThunkAction<S, A> = (dispatch: Dispatch<S, A>, getState: () => S) => Promise<void> | void;
|
||||
//declare export type ThunkAction<S, A> = (dispatch: PlainDispatch<A> | ThunkDispatch<S, A>, getState: () => S) => Promise<void> | void;
|
||||
declare export type ThunkAction<S, A> = (dispatch: ThunkDispatch<S, A>, getState: () => S) => Promise<void> | void;
|
||||
//declare export type ThunkDispatch<S, A> = (action: ThunkAction<S, A>) => void;
|
||||
declare export type ThunkDispatch<S, A> = (action: PlainDispatch<A> | ThunkDispatch<S, A>) => void;
|
||||
|
||||
declare export type PlainDispatch<A: {type: $Subtype<string>}> = DispatchAPI<A>;
|
||||
|
||||
// declare export type ThunkAction<S, D> = (dispatch: D, getState: () => S) => Promise<void> | void;
|
||||
// declare type ThunkDispatch<S, D> = (action: ThunkAction<S, D & ThunkDispatch<S, D>>) => void;
|
||||
|
||||
declare export type MiddlewareAPI<S, A> = {
|
||||
dispatch: ThunkDispatch<S, A>;
|
||||
// dispatch: (action: PlainDispatch<A> | ThunkDispatch<S, A>) => void;
|
||||
getState(): S;
|
||||
};
|
||||
|
||||
declare export type Middleware<S, A> =
|
||||
(api: MiddlewareAPI<S, A>) =>
|
||||
(next: PlainDispatch<A>) => PlainDispatch<A>;
|
||||
|
||||
declare export type Store<S, A, D = Dispatch<S, 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 StoreCreator<S, A, D = Dispatch<S, 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<S, 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>>): 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;
|
||||
}
|
||||
|
Loading…
Reference in new issue