-
Notifications
You must be signed in to change notification settings - Fork 5
/
types.d.ts
30 lines (22 loc) · 1008 Bytes
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Type definitions for mst-react-router 1.1.0
// Project: https://github.com/alisd23/mst-react-router
// Definitions by: Keyj1n https://github.com/Keyj1n
import { History, Location, UnregisterCallback } from 'history';
import { IModelType, ModelPropertiesDeclarationToProperties, IType, IOptionalIType, Instance } from 'mobx-state-tree';
declare namespace MstReactRouter {
type Props = {
location: IOptionalIType<IType<Location, Location, Location>, [undefined]>;
action: string;
}
export type RouterModelType = IModelType<
ModelPropertiesDeclarationToProperties<Props>,
Pick<History, 'push' | 'replace' | 'go' | 'goBack' | 'goForward' | 'block'>
>;
export type RouterModel = Instance<RouterModelType>;
export const RouterModel: RouterModelType;
export interface SynchronizedHistory extends History {
unsubscribe?: UnregisterCallback;
}
export function syncHistoryWithStore(history: History, store: RouterModel): SynchronizedHistory;
}
export = MstReactRouter;