1 | import { type ValueEqualityFn } from '@angular/core';
|
2 | export interface Action {
|
3 | type: string;
|
4 | }
|
5 | export declare interface TypedAction<T extends string> extends Action {
|
6 | readonly type: T;
|
7 | }
|
8 | export type ActionType<A> = A extends ActionCreator<infer T, infer C> ? ReturnType<C> & {
|
9 | type: T;
|
10 | } : never;
|
11 | export type TypeId<T> = () => T;
|
12 | export type InitialState<T> = Partial<T> | TypeId<Partial<T>> | void;
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export interface ActionReducer<T, V extends Action = Action> {
|
18 | (state: T | undefined, action: V): T;
|
19 | }
|
20 | export type ActionReducerMap<T, V extends Action = Action> = {
|
21 | [p in keyof T]: ActionReducer<T[p], V>;
|
22 | };
|
23 | export interface ActionReducerFactory<T, V extends Action = Action> {
|
24 | (reducerMap: ActionReducerMap<T, V>, initialState?: InitialState<T>): ActionReducer<T, V>;
|
25 | }
|
26 | export type MetaReducer<T = any, V extends Action = Action> = (reducer: ActionReducer<T, V>) => ActionReducer<T, V>;
|
27 | export interface StoreFeature<T, V extends Action = Action> {
|
28 | key: string;
|
29 | reducers: ActionReducerMap<T, V> | ActionReducer<T, V>;
|
30 | reducerFactory: ActionReducerFactory<T, V>;
|
31 | initialState?: InitialState<T>;
|
32 | metaReducers?: MetaReducer<T, V>[];
|
33 | }
|
34 | export type Selector<T, V> = (state: T) => V;
|
35 |
|
36 |
|
37 |
|
38 | export type SelectorWithProps<State, Props, Result> = (state: State, props: Props) => Result;
|
39 | export declare const arraysAreNotAllowedMsg = "action creator cannot return an array";
|
40 | type ArraysAreNotAllowed = typeof arraysAreNotAllowedMsg;
|
41 | export declare const typePropertyIsNotAllowedMsg = "action creator cannot return an object with a property named `type`";
|
42 | type TypePropertyIsNotAllowed = typeof typePropertyIsNotAllowedMsg;
|
43 | export declare const emptyObjectsAreNotAllowedMsg = "action creator cannot return an empty object";
|
44 | type EmptyObjectsAreNotAllowed = typeof emptyObjectsAreNotAllowedMsg;
|
45 | export declare const arraysAreNotAllowedInProps = "action creator props cannot be an array";
|
46 | type ArraysAreNotAllowedInProps = typeof arraysAreNotAllowedInProps;
|
47 | export declare const typePropertyIsNotAllowedInProps = "action creator props cannot have a property named `type`";
|
48 | type TypePropertyIsNotAllowedInProps = typeof typePropertyIsNotAllowedInProps;
|
49 | export declare const emptyObjectsAreNotAllowedInProps = "action creator props cannot be an empty object";
|
50 | type EmptyObjectsAreNotAllowedInProps = typeof emptyObjectsAreNotAllowedInProps;
|
51 | export declare const primitivesAreNotAllowedInProps = "action creator props cannot be a primitive value";
|
52 | type PrimitivesAreNotAllowedInProps = typeof primitivesAreNotAllowedInProps;
|
53 | export type FunctionIsNotAllowed<T, ErrorMessage extends string> = T extends Function ? ErrorMessage : T;
|
54 |
|
55 |
|
56 |
|
57 | export type Creator<P extends any[] = any[], R extends object = object> = FunctionWithParametersType<P, R>;
|
58 | export type Primitive = string | number | bigint | boolean | symbol | null | undefined;
|
59 | export type NotAllowedCheck<T extends object> = T extends any[] ? ArraysAreNotAllowed : T extends {
|
60 | type: any;
|
61 | } ? TypePropertyIsNotAllowed : keyof T extends never ? EmptyObjectsAreNotAllowed : unknown;
|
62 | export type NotAllowedInPropsCheck<T> = T extends object ? T extends any[] ? ArraysAreNotAllowedInProps : T extends {
|
63 | type: any;
|
64 | } ? TypePropertyIsNotAllowedInProps : keyof T extends never ? EmptyObjectsAreNotAllowedInProps : unknown : T extends Primitive ? PrimitivesAreNotAllowedInProps : never;
|
65 |
|
66 |
|
67 |
|
68 | export type ActionCreator<T extends string = string, C extends Creator = Creator> = C & TypedAction<T>;
|
69 | export interface ActionCreatorProps<T> {
|
70 | _as: 'props';
|
71 | _p: T;
|
72 | }
|
73 | export type FunctionWithParametersType<P extends unknown[], R = void> = (...args: P) => R;
|
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 interface SelectSignalOptions<T> {
|
101 | |
102 |
|
103 |
|
104 | equal?: ValueEqualityFn<T>;
|
105 | }
|
106 | export type Prettify<T> = {
|
107 | [K in keyof T]: T[K];
|
108 | } & {};
|
109 | export {};
|