forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fluxxor.d.ts
70 lines (58 loc) · 2.05 KB
/
fluxxor.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Type definitions for Fluxxor 1.5.2
// Project: https://github.com/BinaryMuse/fluxxor
// Definitions by: Yuichi Murata <https://github.com/mrk21>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path='../react/react.d.ts' />
///<reference path='../eventemitter3/eventemitter3.d.ts' />
declare namespace Fluxxor {
class Dispatcher {
constructor(stores: any);
addStore(name: string, store: Store): void;
dispatch(action: Function): void;
doDispatchLoop(action: Function): void;
waitForStores(store: Store, stores: string[], fn: Function): void;
}
class Flux extends EventEmitter3.EventEmitter {
constructor(stores: any, actions: any);
addActions(actions: any): void;
addAction(...args: Array<string|Function>): void;
addAction(names: string[], action: Function): void;
store(name: string): any;
addStore(name: string, store: Store): void;
addStores(stores: any): void;
stores: any;
actions: any;
}
interface Store extends EventEmitter3.EventEmitter {
bindActions(...args: Array<string|Function>): void;
bindActions(args: Array<string|Function>): void;
waitFor(stores: string[], fn: Function): void;
}
interface StoreSpec {
initialize?(instance?: any, options?: {}): void;
actions?: any;
}
interface StoreClass {
new (options?: {}): any;
}
interface Context {
flux: Flux;
}
interface FluxMixin {
getFlux(): Flux;
}
interface FluxChildMixin {
getFlux(): Flux;
}
interface StoreWatchMixin<StoreState> {
getStateFromFlux(): StoreState;
}
function FluxMixin(React: typeof __React): FluxMixin;
function FluxChildMixin(React: typeof __React): FluxChildMixin;
function StoreWatchMixin<StoreState>(...storeNames: string[]): StoreWatchMixin<StoreState>;
function createStore(spec: StoreSpec): StoreClass;
var version: string;
}
declare module 'fluxxor' {
export = Fluxxor;
}