1 | import { Store, StoreEnhancer } from 'redux';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export function component(ctor: Function): any;
|
11 | export function component(options: SchemaOptions): any;
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export function computed(target: any, propertyKey: string | symbol): void;
|
19 |
|
20 | export class ConnectOptions {
|
21 | |
22 |
|
23 |
|
24 |
|
25 | app?: string;
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 | id?: any;
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | live?: boolean;
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export function connect(options?: ConnectOptions): PropertyDecorator;
|
57 | export function connect(target: any, propertyKey: string | symbol): void;
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | export function noDispatch(target: any, propertyKey: string | symbol): void;
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | export function sequence(target: any, propertyKey: string | symbol): void;
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | export function withId(target: object, propertyKey: string | symbol): void;
|
78 | export function withId(id?: any): PropertyDecorator;
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export class ReduxApp<T extends object> {
|
86 |
|
87 | |
88 |
|
89 |
|
90 | static options: GlobalOptions;
|
91 |
|
92 | static createApp<T extends object>(appCreator: T, enhancer?: StoreEnhancer<T>): ReduxApp<T>;
|
93 | static createApp<T extends object>(appCreator: T, options: AppOptions, enhancer?: StoreEnhancer<T>): ReduxApp<T>;
|
94 | static createApp<T extends object>(appCreator: T, options: AppOptions, preloadedState: any, enhancer?: StoreEnhancer<T>): ReduxApp<T>;
|
95 |
|
96 | readonly name: string;
|
97 | |
98 |
|
99 |
|
100 | readonly root: T;
|
101 | |
102 |
|
103 |
|
104 | readonly store: Store<T>;
|
105 |
|
106 | constructor(appCreator: T, enhancer?: StoreEnhancer<T>);
|
107 | constructor(appCreator: T, options: AppOptions, enhancer?: StoreEnhancer<T>);
|
108 | constructor(appCreator: T, options: AppOptions, preloadedState: any, enhancer?: StoreEnhancer<T>);
|
109 |
|
110 | dispose(): void;
|
111 | }
|
112 |
|
113 | //
|
114 | // Utilities
|
115 | //
|
116 |
|
117 | export function isInstanceOf(obj: any, type: Function): boolean;
|
118 |
|
119 | //
|
120 | // Options
|
121 | //
|
122 |
|
123 | export class SchemaOptions {
|
124 | /**
|
125 | * Add the class name of the object that holds the action to the action name.
|
126 | * Format: <class name>.<action name>
|
127 | * Default value: true.
|
128 | */
|
129 | actionNamespace?: boolean;
|
130 | /**
|
131 | * Use redux style action names. For instance, if a component defines a
|
132 | * method called 'incrementCounter' the matching action name will be
|
133 | * 'INCREMENT_COUNTER'.
|
134 | * Default value: true.
|
135 | */
|
136 | uppercaseActions?: boolean;
|
137 | }
|
138 |
|
139 | export class AppOptions {
|
140 | /**
|
141 | * Name of the newly created app.
|
142 | */
|
143 | name?: string;
|
144 | /**
|
145 | * By default each component is assigned (with some optimizations) with it's
|
146 | * relevant sub state on each store change. Set this to false to disable
|
147 | * this updating process. The store's state will still be updated as usual
|
148 | * and can always be retrieved using store.getState().
|
149 | * Default value: true.
|
150 | */
|
151 | updateState?: boolean;
|
152 | }
|
153 |
|
154 | export class GlobalOptions {
|
155 | |
156 |
|
157 |
|
158 | logLevel: LogLevel;
|
159 | |
160 |
|
161 |
|
162 |
|
163 |
|
164 | emitClassNames: boolean;
|
165 | |
166 |
|
167 |
|
168 |
|
169 | schema: SchemaOptions;
|
170 | }
|
171 |
|
172 | export enum LogLevel {
|
173 | |
174 |
|
175 |
|
176 | None = 0,
|
177 | Verbose = 1,
|
178 | Debug = 2,
|
179 | Warn = 5,
|
180 | |
181 |
|
182 |
|
183 | Silent = 10
|
184 | } |
\ | No newline at end of file |