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 | 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>;
|
32 | 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>;
|
33 | 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>;
|
34 | 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>;
|
35 | 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>;
|
36 | 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>;
|
37 | 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>;
|
38 | export declare function createSelector<State, Slices extends unknown[], Result>(...args: [...slices: Selector<State, unknown>[], projector: unknown] & [
|
39 | ...slices: {
|
40 | [i in keyof Slices]: Selector<State, Slices[i]>;
|
41 | },
|
42 | projector: (...s: Slices) => Result
|
43 | ]): MemoizedSelector<State, Result>;
|
44 |
|
45 |
|
46 |
|
47 | export declare function createSelector<State, Props, S1, Result>(s1: SelectorWithProps<State, Props, S1>, projector: (s1: S1, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
48 |
|
49 |
|
50 |
|
51 | 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>;
|
52 |
|
53 |
|
54 |
|
55 | 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>;
|
56 |
|
57 |
|
58 |
|
59 | 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>;
|
60 |
|
61 |
|
62 |
|
63 | 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>;
|
64 |
|
65 |
|
66 |
|
67 | 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>;
|
68 |
|
69 |
|
70 |
|
71 | 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>;
|
72 |
|
73 |
|
74 |
|
75 | 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>;
|
76 | export declare function createSelector<State, Slices extends unknown[], Result>(selectors: Selector<State, unknown>[] & [
|
77 | ...{
|
78 | [i in keyof Slices]: Selector<State, Slices[i]>;
|
79 | }
|
80 | ], projector: (...s: Slices) => Result): MemoizedSelector<State, Result>;
|
81 |
|
82 |
|
83 |
|
84 | export declare function createSelector<State, Props, S1, Result>(selectors: [SelectorWithProps<State, Props, S1>], projector: (s1: S1, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
85 |
|
86 |
|
87 |
|
88 | export declare function createSelector<State, Props, S1, S2, Result>(selectors: [
|
89 | SelectorWithProps<State, Props, S1>,
|
90 | SelectorWithProps<State, Props, S2>
|
91 | ], projector: (s1: S1, s2: S2, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
92 |
|
93 |
|
94 |
|
95 | export declare function createSelector<State, Props, S1, S2, S3, Result>(selectors: [
|
96 | SelectorWithProps<State, Props, S1>,
|
97 | SelectorWithProps<State, Props, S2>,
|
98 | SelectorWithProps<State, Props, S3>
|
99 | ], projector: (s1: S1, s2: S2, s3: S3, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
100 |
|
101 |
|
102 |
|
103 | export declare function createSelector<State, Props, S1, S2, S3, S4, Result>(selectors: [
|
104 | SelectorWithProps<State, Props, S1>,
|
105 | SelectorWithProps<State, Props, S2>,
|
106 | SelectorWithProps<State, Props, S3>,
|
107 | SelectorWithProps<State, Props, S4>
|
108 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
109 |
|
110 |
|
111 |
|
112 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, Result>(selectors: [
|
113 | SelectorWithProps<State, Props, S1>,
|
114 | SelectorWithProps<State, Props, S2>,
|
115 | SelectorWithProps<State, Props, S3>,
|
116 | SelectorWithProps<State, Props, S4>,
|
117 | SelectorWithProps<State, Props, S5>
|
118 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
119 |
|
120 |
|
121 |
|
122 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, Result>(selectors: [
|
123 | SelectorWithProps<State, Props, S1>,
|
124 | SelectorWithProps<State, Props, S2>,
|
125 | SelectorWithProps<State, Props, S3>,
|
126 | SelectorWithProps<State, Props, S4>,
|
127 | SelectorWithProps<State, Props, S5>,
|
128 | SelectorWithProps<State, Props, S6>
|
129 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
130 |
|
131 |
|
132 |
|
133 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, S7, Result>(selectors: [
|
134 | SelectorWithProps<State, Props, S1>,
|
135 | SelectorWithProps<State, Props, S2>,
|
136 | SelectorWithProps<State, Props, S3>,
|
137 | SelectorWithProps<State, Props, S4>,
|
138 | SelectorWithProps<State, Props, S5>,
|
139 | SelectorWithProps<State, Props, S6>,
|
140 | SelectorWithProps<State, Props, S7>
|
141 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
142 |
|
143 |
|
144 |
|
145 | export declare function createSelector<State, Props, S1, S2, S3, S4, S5, S6, S7, S8, Result>(selectors: [
|
146 | SelectorWithProps<State, Props, S1>,
|
147 | SelectorWithProps<State, Props, S2>,
|
148 | SelectorWithProps<State, Props, S3>,
|
149 | SelectorWithProps<State, Props, S4>,
|
150 | SelectorWithProps<State, Props, S5>,
|
151 | SelectorWithProps<State, Props, S6>,
|
152 | SelectorWithProps<State, Props, S7>,
|
153 | SelectorWithProps<State, Props, S8>
|
154 | ], projector: (s1: S1, s2: S2, s3: S3, s4: S4, s5: S5, s6: S6, s7: S7, s8: S8, props: Props) => Result): MemoizedSelectorWithProps<State, Props, Result>;
|
155 | export declare function defaultStateFn(state: any, selectors: Selector<any, any>[] | SelectorWithProps<any, any, any>[], props: any, memoizedProjector: MemoizedProjection): any;
|
156 | export declare type SelectorFactoryConfig<T = any, V = any> = {
|
157 | stateFn: (state: T, selectors: Selector<any, any>[], props: any, memoizedProjector: MemoizedProjection) => V;
|
158 | };
|
159 | export declare function createSelectorFactory<T = any, V = any>(memoize: MemoizeFn): (...input: any[]) => MemoizedSelector<T, V>;
|
160 | export declare function createSelectorFactory<T = any, V = any>(memoize: MemoizeFn, options: SelectorFactoryConfig<T, V>): (...input: any[]) => MemoizedSelector<T, V>;
|
161 |
|
162 |
|
163 |
|
164 | export declare function createSelectorFactory<T = any, Props = any, V = any>(memoize: MemoizeFn): (...input: any[]) => MemoizedSelectorWithProps<T, Props, V>;
|
165 |
|
166 |
|
167 |
|
168 | export declare function createSelectorFactory<T = any, Props = any, V = any>(memoize: MemoizeFn, options: SelectorFactoryConfig<T, V>): (...input: any[]) => MemoizedSelectorWithProps<T, Props, V>;
|
169 | export declare function createFeatureSelector<T>(featureName: string): MemoizedSelector<object, T>;
|
170 |
|
171 |
|
172 |
|
173 | export declare function createFeatureSelector<T, V>(featureName: keyof T): MemoizedSelector<T, V>;
|