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 |
|
35 |
|
36 |
|
37 | export declare type SelectorWithProps<State, Props, Result> = (state: State, props: Props) => Result;
|
38 | export declare const arraysAreNotAllowedMsg = "action creator cannot return an array";
|
39 | declare type ArraysAreNotAllowed = typeof arraysAreNotAllowedMsg;
|
40 | export declare const typePropertyIsNotAllowedMsg = "action creator cannot return an object with a property named `type`";
|
41 | declare type TypePropertyIsNotAllowed = typeof typePropertyIsNotAllowedMsg;
|
42 | export declare const emptyObjectsAreNotAllowedMsg = "action creator cannot return an empty object";
|
43 | declare type EmptyObjectsAreNotAllowed = typeof emptyObjectsAreNotAllowedMsg;
|
44 | export declare const arraysAreNotAllowedInProps = "action creator props cannot be an array";
|
45 | declare type ArraysAreNotAllowedInProps = typeof arraysAreNotAllowedInProps;
|
46 | export declare const typePropertyIsNotAllowedInProps = "action creator props cannot have a property named `type`";
|
47 | declare type TypePropertyIsNotAllowedInProps = typeof typePropertyIsNotAllowedInProps;
|
48 | export declare const emptyObjectsAreNotAllowedInProps = "action creator props cannot be an empty object";
|
49 | declare type EmptyObjectsAreNotAllowedInProps = typeof emptyObjectsAreNotAllowedInProps;
|
50 | export declare const primitivesAreNotAllowedInProps = "action creator props cannot be a primitive value";
|
51 | declare type PrimitivesAreNotAllowedInProps = typeof primitivesAreNotAllowedInProps;
|
52 | export declare type FunctionIsNotAllowed<T, ErrorMessage extends string> = T extends Function ? ErrorMessage : T;
|
53 |
|
54 |
|
55 |
|
56 | export declare type Creator<P extends any[] = any[], R extends object = object> = FunctionWithParametersType<P, R>;
|
57 | export declare type Primitive = string | number | bigint | boolean | symbol | null | undefined;
|
58 | export declare type NotAllowedCheck<T extends object> = T extends any[] ? ArraysAreNotAllowed : T extends {
|
59 | type: any;
|
60 | } ? TypePropertyIsNotAllowed : keyof T extends never ? EmptyObjectsAreNotAllowed : unknown;
|
61 | export declare type NotAllowedInPropsCheck<T> = T extends object ? T extends any[] ? ArraysAreNotAllowedInProps : T extends {
|
62 | type: any;
|
63 | } ? TypePropertyIsNotAllowedInProps : keyof T extends never ? EmptyObjectsAreNotAllowedInProps : unknown : T extends Primitive ? PrimitivesAreNotAllowedInProps : never;
|
64 |
|
65 |
|
66 |
|
67 | export declare type ActionCreator<T extends string = string, C extends Creator = Creator> = C & TypedAction<T>;
|
68 | export interface ActionCreatorProps<T> {
|
69 | _as: 'props';
|
70 | _p: T;
|
71 | }
|
72 | export declare type FunctionWithParametersType<P extends unknown[], R = void> = (...args: P) => R;
|
73 | export declare type ParametersType<T> = T extends (...args: infer U) => unknown ? U : never;
|
74 | export interface RuntimeChecks {
|
75 | |
76 |
|
77 |
|
78 | strictStateSerializability: boolean;
|
79 | |
80 |
|
81 |
|
82 | strictActionSerializability: boolean;
|
83 | |
84 |
|
85 |
|
86 | strictStateImmutability: boolean;
|
87 | |
88 |
|
89 |
|
90 | strictActionImmutability: boolean;
|
91 | |
92 |
|
93 |
|
94 | strictActionWithinNgZone: boolean;
|
95 | |
96 |
|
97 |
|
98 | strictActionTypeUniqueness?: boolean;
|
99 | }
|
100 | export {};
|