1 | export interface Action {
|
2 | type: string;
|
3 | }
|
4 | export declare interface TypedAction<T extends string> extends Action {
|
5 | readonly type: T;
|
6 | }
|
7 | export declare type ActionType<A> = A extends ActionCreator<infer T, infer C> ? ReturnType<C> & {
|
8 | type: T;
|
9 | } : never;
|
10 | export declare type TypeId<T> = () => T;
|
11 | export declare type InitialState<T> = Partial<T> | TypeId<Partial<T>> | void;
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export interface ActionReducer<T, V extends Action = Action> {
|
17 | (state: T | undefined, action: V): T;
|
18 | }
|
19 | export declare type ActionReducerMap<T, V extends Action = Action> = {
|
20 | [p in keyof T]: ActionReducer<T[p], V>;
|
21 | };
|
22 | export interface ActionReducerFactory<T, V extends Action = Action> {
|
23 | (reducerMap: ActionReducerMap<T, V>, initialState?: InitialState<T>): ActionReducer<T, V>;
|
24 | }
|
25 | export declare type MetaReducer<T = any, V extends Action = Action> = (reducer: ActionReducer<T, V>) => ActionReducer<T, V>;
|
26 | export interface StoreFeature<T, V extends Action = Action> {
|
27 | key: string;
|
28 | reducers: ActionReducerMap<T, V> | ActionReducer<T, V>;
|
29 | reducerFactory: ActionReducerFactory<T, V>;
|
30 | initialState?: InitialState<T>;
|
31 | metaReducers?: MetaReducer<T, V>[];
|
32 | }
|
33 | export declare type Selector<T, V> = (state: T) => V;
|
34 | export declare type SelectorWithProps<State, Props, Result> = (state: State, props: Props) => Result;
|
35 | export declare const arraysAreNotAllowedMsg = "arrays are not allowed in action creators";
|
36 | declare type ArraysAreNotAllowed = typeof arraysAreNotAllowedMsg;
|
37 | export declare const typePropertyIsNotAllowedMsg = "type property is not allowed in action creators";
|
38 | declare type TypePropertyIsNotAllowed = typeof typePropertyIsNotAllowedMsg;
|
39 | export declare const emptyObjectsAreNotAllowedMsg = "empty objects are not allowed in action creators";
|
40 | declare type EmptyObjectsAreNotAllowed = typeof emptyObjectsAreNotAllowedMsg;
|
41 | export declare type FunctionIsNotAllowed<T, ErrorMessage extends string> = T extends Function ? ErrorMessage : T;
|
42 |
|
43 |
|
44 |
|
45 | export declare type Creator<P extends any[] = any[], R extends object = object> = FunctionWithParametersType<P, R>;
|
46 | export declare type NotAllowedCheck<T extends object> = T extends any[] ? ArraysAreNotAllowed : T extends {
|
47 | type: any;
|
48 | } ? TypePropertyIsNotAllowed : keyof T extends never ? EmptyObjectsAreNotAllowed : unknown;
|
49 |
|
50 |
|
51 |
|
52 | export declare type ActionCreator<T extends string = string, C extends Creator = Creator> = C & TypedAction<T>;
|
53 | export interface ActionCreatorProps<T> {
|
54 | _as: 'props';
|
55 | _p: T;
|
56 | }
|
57 | export declare type FunctionWithParametersType<P extends unknown[], R = void> = (...args: P) => R;
|
58 | export declare type ParametersType<T> = T extends (...args: infer U) => unknown ? U : never;
|
59 | export interface RuntimeChecks {
|
60 | |
61 |
|
62 |
|
63 | strictStateSerializability: boolean;
|
64 | |
65 |
|
66 |
|
67 | strictActionSerializability: boolean;
|
68 | |
69 |
|
70 |
|
71 | strictStateImmutability: boolean;
|
72 | |
73 |
|
74 |
|
75 | strictActionImmutability: boolean;
|
76 | |
77 |
|
78 |
|
79 | strictActionWithinNgZone: boolean;
|
80 | |
81 |
|
82 |
|
83 | strictActionTypeUniqueness?: boolean;
|
84 | }
|
85 | export {};
|