1 | import { Selector, SelectorWithProps } from './models';
|
2 | export declare type AnyFn = (...args: any[]) => any;
|
3 | export declare type MemoizedProjection = {
|
4 | memoized: AnyFn;
|
5 | reset: () => void;
|
6 | setResult: (result?: any) => void;
|
7 | clearResult: () => void;
|
8 | };
|
9 | export declare type MemoizeFn = (t: AnyFn) => MemoizedProjection;
|
10 | export declare type ComparatorFn = (a: any, b: any) => boolean;
|
11 | export declare type DefaultProjectorFn<T> = (...args: any[]) => T;
|
12 | export interface MemoizedSelector<State, Result, ProjectorFn = DefaultProjectorFn<Result>> extends Selector<State, Result> {
|
13 | release(): void;
|
14 | projector: ProjectorFn;
|
15 | setResult: (result?: Result) => void;
|
16 | clearResult: () => void;
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 | export interface MemoizedSelectorWithProps<State, Props, Result, ProjectorFn = DefaultProjectorFn<Result>> extends SelectorWithProps<State, Props, Result> {
|
22 | release(): void;
|
23 | projector: ProjectorFn;
|
24 | setResult: (result?: Result) => void;
|
25 | clearResult: () => void;
|
26 | }
|
27 | export declare function isEqualCheck(a: any, b: any): boolean;
|
28 | export declare function resultMemoize(projectionFn: AnyFn, isResultEqual: ComparatorFn): MemoizedProjection;
|
29 | export declare function defaultMemoize(projectionFn: AnyFn, isArgumentsEqual?: typeof isEqualCheck, isResultEqual?: typeof isEqualCheck): MemoizedProjection;
|
30 | export declare function createSelector<State, S1, Result>(s1: Selector<State, S1>, projector: (s1: S1) => Result): MemoizedSelector<State, Result>;
|
31 |
|
32 |
|
33 |
|
34 | export declare function createSelector<State, Props, S1, Result>(s1: SelectorWithProps<State, Props, S1>, projector: (s1: S1, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
35 | export declare function createSelector<State, S1, Result>(selectors: [Selector<State, S1>], projector: (s1: S1) => Result): MemoizedSelector<State, Result>;
|
36 |
|
37 |
|
38 |
|
39 | export declare function createSelector<State, Props, S1, Result>(selectors: [SelectorWithProps<State, Props, S1>], projector: (s1: S1, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
40 | export declare function createSelector<State, S1, S2, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, projector: (s1: S1, s2: S2) => Result): MemoizedSelector<State, Result>;
|
41 |
|
42 |
|
43 |
|
44 | export declare function createSelector<State, Props, S1, S2, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, projector: (s1: S1, s2: S2, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
45 | export declare function createSelector<State, S1, S2, Result>(selectors: [Selector<State, S1>, Selector<State, S2>], projector: (s1: S1, s2: S2) => Result): MemoizedSelector<State, Result>;
|
46 |
|
47 |
|
48 |
|
49 | export declare function createSelector<State, Props, S1, S2, Result>(selectors: [
|
50 | SelectorWithProps<State, Props, S1>,
|
51 | SelectorWithProps<State, Props, S2>
|
52 | ], projector: (s1: S1, s2: S2, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
53 | export declare function createSelector<State, S1, S2, S3, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, s3: Selector<State, S3>, projector: (s1: S1, s2: S2, s3: S3) => Result): MemoizedSelector<State, Result>;
|
54 |
|
55 |
|
56 |
|
57 | export declare function createSelector<State, Props, S1, S2, S3, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, s3: SelectorWithProps<State, Props, S3>, projector: (s1: S1, s2: S2, s3: S3, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
58 | export declare function createSelector<State, S1, S2, S3, Result>(selectors: [Selector<State, S1>, Selector<State, S2>, Selector<State, S3>], projector: (s1: S1, s2: S2, s3: S3) => Result): MemoizedSelector<State, Result>;
|
59 |
|
60 |
|
61 |
|
62 | export declare function createSelector<State, Props, S1, S2, S3, Result>(selectors: [
|
63 | SelectorWithProps<State, Props, S1>,
|
64 | SelectorWithProps<State, Props, S2>,
|
65 | SelectorWithProps<State, Props, S3>
|
66 | ], projector: (s1: S1, s2: S2, s3: S3, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
67 | export declare function createSelector<State, S1, S2, S3, S4, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, s3: Selector<State, S3>, s4: Selector<State, S4>, projector: (s1: S1, s2: S2, s3: S3, s4: S4) => Result): MemoizedSelector<State, Result>;
|
68 |
|
69 |
|
70 |
|
71 | export declare function createSelector<State, Props, S1, S2, S3, S4, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, s3: SelectorWithProps<State, Props, S3>, s4: SelectorWithProps<State, Props, S4>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
72 | export declare function createSelector<State, S1, S2, S3, S4, Result>(selectors: [
|
73 | Selector<State, S1>,
|
74 | Selector<State, S2>,
|
75 | Selector<State, S3>,
|
76 | Selector<State, S4>
|
77 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4) => Result): MemoizedSelector<State, Result>;
|
78 |
|
79 |
|
80 |
|
81 | export declare function createSelector<State, Props, S1, S2, S3, S4, Result>(selectors: [
|
82 | SelectorWithProps<State, Props, S1>,
|
83 | SelectorWithProps<State, Props, S2>,
|
84 | SelectorWithProps<State, Props, S3>,
|
85 | SelectorWithProps<State, Props, S4>
|
86 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
87 | export declare function createSelector<State, S1, S2, S3, S4, S5, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, s3: Selector<State, S3>, s4: Selector<State, S4>, s5: Selector<State, S5>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5) => Result): MemoizedSelector<State, Result>;
|
88 |
|
89 |
|
90 |
|
91 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, s3: SelectorWithProps<State, Props, S3>, s4: SelectorWithProps<State, Props, S4>, s5: SelectorWithProps<State, Props, S5>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
92 | export declare function createSelector<State, S1, S2, S3, S4, S5, Result>(selectors: [
|
93 | Selector<State, S1>,
|
94 | Selector<State, S2>,
|
95 | Selector<State, S3>,
|
96 | Selector<State, S4>,
|
97 | Selector<State, S5>
|
98 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5) => Result): MemoizedSelector<State, Result>;
|
99 |
|
100 |
|
101 |
|
102 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, Result>(selectors: [
|
103 | SelectorWithProps<State, Props, S1>,
|
104 | SelectorWithProps<State, Props, S2>,
|
105 | SelectorWithProps<State, Props, S3>,
|
106 | SelectorWithProps<State, Props, S4>,
|
107 | SelectorWithProps<State, Props, S5>
|
108 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
109 | export declare function createSelector<State, S1, S2, S3, S4, S5, S6, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, s3: Selector<State, S3>, s4: Selector<State, S4>, s5: Selector<State, S5>, s6: Selector<State, S6>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6) => Result): MemoizedSelector<State, Result>;
|
110 |
|
111 |
|
112 |
|
113 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, s3: SelectorWithProps<State, Props, S3>, s4: SelectorWithProps<State, Props, S4>, s5: SelectorWithProps<State, Props, S5>, s6: SelectorWithProps<State, Props, S6>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
114 | export declare function createSelector<State, S1, S2, S3, S4, S5, S6, Result>(selectors: [
|
115 | Selector<State, S1>,
|
116 | Selector<State, S2>,
|
117 | Selector<State, S3>,
|
118 | Selector<State, S4>,
|
119 | Selector<State, S5>,
|
120 | Selector<State, S6>
|
121 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6) => Result): MemoizedSelector<State, Result>;
|
122 |
|
123 |
|
124 |
|
125 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, Result>(selectors: [
|
126 | SelectorWithProps<State, Props, S1>,
|
127 | SelectorWithProps<State, Props, S2>,
|
128 | SelectorWithProps<State, Props, S3>,
|
129 | SelectorWithProps<State, Props, S4>,
|
130 | SelectorWithProps<State, Props, S5>,
|
131 | SelectorWithProps<State, Props, S6>
|
132 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
133 | export declare function createSelector<State, S1, S2, S3, S4, S5, S6, S7, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, s3: Selector<State, S3>, s4: Selector<State, S4>, s5: Selector<State, S5>, s6: Selector<State, S6>, s7: Selector<State, S7>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7) => Result): MemoizedSelector<State, Result>;
|
134 |
|
135 |
|
136 |
|
137 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, S7, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, s3: SelectorWithProps<State, Props, S3>, s4: SelectorWithProps<State, Props, S4>, s5: SelectorWithProps<State, Props, S5>, s6: SelectorWithProps<State, Props, S6>, s7: SelectorWithProps<State, Props, S7>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
138 | export declare function createSelector<State, S1, S2, S3, S4, S5, S6, S7, Result>(selectors: [
|
139 | Selector<State, S1>,
|
140 | Selector<State, S2>,
|
141 | Selector<State, S3>,
|
142 | Selector<State, S4>,
|
143 | Selector<State, S5>,
|
144 | Selector<State, S6>,
|
145 | Selector<State, S7>
|
146 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7) => Result): MemoizedSelector<State, Result>;
|
147 |
|
148 |
|
149 |
|
150 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, S7, Result>(selectors: [
|
151 | SelectorWithProps<State, Props, S1>,
|
152 | SelectorWithProps<State, Props, S2>,
|
153 | SelectorWithProps<State, Props, S3>,
|
154 | SelectorWithProps<State, Props, S4>,
|
155 | SelectorWithProps<State, Props, S5>,
|
156 | SelectorWithProps<State, Props, S6>,
|
157 | SelectorWithProps<State, Props, S7>
|
158 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
159 | export declare function createSelector<State, S1, S2, S3, S4, S5, S6, S7, S8, Result>(s1: Selector<State, S1>, s2: Selector<State, S2>, s3: Selector<State, S3>, s4: Selector<State, S4>, s5: Selector<State, S5>, s6: Selector<State, S6>, s7: Selector<State, S7>, s8: Selector<State, S8>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, s8: S8) => Result): MemoizedSelector<State, Result>;
|
160 |
|
161 |
|
162 |
|
163 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, S7, S8, Result>(s1: SelectorWithProps<State, Props, S1>, s2: SelectorWithProps<State, Props, S2>, s3: SelectorWithProps<State, Props, S3>, s4: SelectorWithProps<State, Props, S4>, s5: SelectorWithProps<State, Props, S5>, s6: SelectorWithProps<State, Props, S6>, s7: SelectorWithProps<State, Props, S7>, s8: SelectorWithProps<State, Props, S8>, projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, s8: S8, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
164 | export declare function createSelector<State, S1, S2, S3, S4, S5, S6, S7, S8, Result>(selectors: [
|
165 | Selector<State, S1>,
|
166 | Selector<State, S2>,
|
167 | Selector<State, S3>,
|
168 | Selector<State, S4>,
|
169 | Selector<State, S5>,
|
170 | Selector<State, S6>,
|
171 | Selector<State, S7>,
|
172 | Selector<State, S8>
|
173 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, s8: S8) => Result): MemoizedSelector<State, Result>;
|
174 |
|
175 |
|
176 |
|
177 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, S7, S8, Result>(selectors: [
|
178 | SelectorWithProps<State, Props, S1>,
|
179 | SelectorWithProps<State, Props, S2>,
|
180 | SelectorWithProps<State, Props, S3>,
|
181 | SelectorWithProps<State, Props, S4>,
|
182 | SelectorWithProps<State, Props, S5>,
|
183 | SelectorWithProps<State, Props, S6>,
|
184 | SelectorWithProps<State, Props, S7>,
|
185 | SelectorWithProps<State, Props, S8>
|
186 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, s8: S8, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
187 | export declare function defaultStateFn(state: any, selectors: Selector<any, any>[] | SelectorWithProps<any, any, any>[], props: any, memoizedProjector: MemoizedProjection): any;
|
188 | export declare type SelectorFactoryConfig<T = any, V = any> = {
|
189 | stateFn: (state: T, selectors: Selector<any, any>[], props: any, memoizedProjector: MemoizedProjection) => V;
|
190 | };
|
191 | export declare function createSelectorFactory<T = any, V = any>(memoize: MemoizeFn): (...input: any[]) => MemoizedSelector<T, V>;
|
192 | export declare function createSelectorFactory<T = any, V = any>(memoize: MemoizeFn, options: SelectorFactoryConfig<T, V>): (...input: any[]) => MemoizedSelector<T, V>;
|
193 |
|
194 |
|
195 |
|
196 | export declare function createSelectorFactory<T = any, Props = any, V = any>(memoize: MemoizeFn): (...input: any[]) => MemoizedSelectorWithProps<T, Props, V>;
|
197 |
|
198 |
|
199 |
|
200 | export declare function createSelectorFactory<T = any, Props = any, V = any>(memoize: MemoizeFn, options: SelectorFactoryConfig<T, V>): (...input: any[]) => MemoizedSelectorWithProps<T, Props, V>;
|
201 | export declare function createFeatureSelector<T>(featureName: string): MemoizedSelector<object, T>;
|
202 | export declare function createFeatureSelector<T, V>(featureName: keyof T): MemoizedSelector<T, V>;
|