@intrig/react 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intrig/react",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "main": "./index.esm.js",
6
6
  "module": "./index.esm.js",
@@ -39,9 +39,5 @@
39
39
  "import": "./index.esm.js",
40
40
  "default": "./index.esm.js"
41
41
  }
42
- },
43
- "files": [
44
- ".",
45
- "!**/*.tsbuildinfo"
46
- ]
42
+ }
47
43
  }
package/src/extra.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ import { BinaryFunctionHook, BinaryHookOptions, BinaryProduceHook, ConstantHook, NetworkState, UnaryFunctionHook, UnaryHookOptions, UnaryProduceHook, UnitHook, UnitHookOptions } from '@intrig/react/network-state';
2
+ /**
3
+ * Converts a given hook into a promise-based function.
4
+ *
5
+ * @param {IntrigHook<P, B, T>} hook - The hook function to be converted.
6
+ * @param {string} [key='default'] - An optional key to uniquely identify the hook instance.
7
+ *
8
+ * @return {[(...params: Parameters<ReturnType<IntrigHook<P, B, T>>[1]>) => Promise<T>, () => void]}
9
+ * Returns a tuple containing a function that invokes the hook as a promise and a function to clear the state.
10
+ */
11
+ export declare function useAsPromise<E>(hook: UnitHook<E>, options: UnitHookOptions): [() => Promise<never>, () => void];
12
+ export declare function useAsPromise<T, E>(hook: ConstantHook<T, E>, options: UnitHookOptions): [() => Promise<T>, () => void];
13
+ export declare function useAsPromise<P, E>(hook: UnaryProduceHook<P, E>, options?: UnaryHookOptions<P>): [(params: P) => Promise<never>, () => void];
14
+ export declare function useAsPromise<P, T, E>(hook: UnaryFunctionHook<P, T, E>, options?: UnaryHookOptions<P>): [(params: P) => Promise<T>, () => void];
15
+ export declare function useAsPromise<P, B, E>(hook: BinaryProduceHook<P, B, E>, options?: BinaryHookOptions<P, B>): [(body: B, params: P) => Promise<never>, () => void];
16
+ export declare function useAsPromise<P, B, T, E>(hook: BinaryFunctionHook<P, B, T, E>, options?: BinaryHookOptions<P, B>): [(body: B, params: P) => Promise<T>, () => void];
17
+ /**
18
+ * A custom hook that manages and returns the network state of a promise-based function,
19
+ * providing a way to execute the function and clear its state.
20
+ *
21
+ * @param fn The promise-based function whose network state is to be managed. It should be a function that returns a promise.
22
+ * @param key An optional identifier for the network state. Defaults to 'default'.
23
+ * @return A tuple containing the current network state, a function to execute the promise, and a function to clear the state.
24
+ */
25
+ export declare function useAsNetworkState<T, F extends (...args: any) => Promise<T>>(fn: F, key?: string): [NetworkState<T>, (...params: Parameters<F>) => void, () => void];
26
+ /**
27
+ * A custom hook that resolves the value from the provided hook's state and updates it whenever the state changes.
28
+ *
29
+ * @param {IntrigHook<P, B, T>} hook - The hook that provides the state to observe and resolve data from.
30
+ * @param options
31
+ * @return {T | undefined} The resolved value from the hook's state or undefined if the state is not successful.
32
+ */
33
+ export declare function useResolvedValue<E>(hook: UnitHook<E>, options: UnitHookOptions): undefined;
34
+ export declare function useResolvedValue<T, E>(hook: ConstantHook<T, E>, options: UnitHookOptions): T | undefined;
35
+ export declare function useResolvedValue<P, E>(hook: UnaryProduceHook<P, E>, options: UnaryHookOptions<P>): undefined;
36
+ export declare function useResolvedValue<P, T, E>(hook: UnaryFunctionHook<P, T, E>, options: UnaryHookOptions<P>): T | undefined;
37
+ export declare function useResolvedValue<P, B, E>(hook: BinaryProduceHook<P, B, E>, options: BinaryHookOptions<P, B>): undefined;
38
+ export declare function useResolvedValue<P, B, T, E>(hook: BinaryFunctionHook<P, B, T, E>, options: BinaryHookOptions<P, B>): T | undefined;
39
+ /**
40
+ * A custom hook that resolves and caches the value from a successful state provided by the given hook.
41
+ * The state is updated only when it is in a successful state.
42
+ *
43
+ * @param {IntrigHook<P, B, T>} hook - The hook that provides the state to observe and cache data from.
44
+ * @param options
45
+ * @return {T | undefined} The cached value from the hook's state or undefined if the state is not successful.
46
+ */
47
+ export declare function useResolvedCachedValue<E>(hook: UnitHook<E>, options: UnitHookOptions): undefined;
48
+ export declare function useResolvedCachedValue<T, E>(hook: ConstantHook<T, E>, options: UnitHookOptions): T | undefined;
49
+ export declare function useResolvedCachedValue<P, E>(hook: UnaryProduceHook<P, E>, options: UnaryHookOptions<P>): undefined;
50
+ export declare function useResolvedCachedValue<P, T, E>(hook: UnaryFunctionHook<P, T, E>, options: UnaryHookOptions<P>): T | undefined;
51
+ export declare function useResolvedCachedValue<P, B, E>(hook: BinaryProduceHook<P, B, E>, options: BinaryHookOptions<P, B>): undefined;
52
+ export declare function useResolvedCachedValue<P, B, T, E>(hook: BinaryFunctionHook<P, B, T, E>, options: BinaryHookOptions<P, B>): T | undefined;
53
+ //# sourceMappingURL=extra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extra.d.ts","sourceRoot":"","sources":["../../../lib/src/extra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EAQZ,YAAY,EAGZ,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAWrC;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACjB,OAAO,EAAE,eAAe,GACvB,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;AACtC,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EACxB,OAAO,EAAE,eAAe,GACvB,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;AAClC,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAAE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ra';
4
+ export * from './media-type-utils';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { NetworkAction, NetworkState } from '@intrig/react/network-state';
2
+ import { AxiosRequestConfig } from 'axios';
3
+ import { ZodSchema } from 'zod';
4
+ import { DefaultConfigs } from '@intrig/react/intrig-provider';
5
+ type GlobalState = Record<string, NetworkState>;
6
+ interface RequestType<T = any> extends AxiosRequestConfig {
7
+ originalData?: T;
8
+ key: string;
9
+ source: string;
10
+ }
11
+ /**
12
+ * Defines the ContextType interface for managing global state, dispatching actions,
13
+ * and holding a collection of Axios instances.
14
+ *
15
+ * @interface ContextType
16
+ * @property {GlobalState} state - The global state of the application.
17
+ * @property {React.Dispatch<NetworkAction<unknown>>} dispatch - The dispatch function to send network actions.
18
+ * @property {Record<string, AxiosInstance>} axios - A record of Axios instances for making HTTP requests.
19
+ */
20
+ export interface ContextType {
21
+ state: GlobalState;
22
+ filteredState: GlobalState;
23
+ dispatch: React.Dispatch<NetworkAction<unknown, unknown>>;
24
+ configs: DefaultConfigs;
25
+ execute: <T>(request: RequestType, dispatch: (state: NetworkState<T>) => void, schema: ZodSchema<T> | undefined, errorSchema: ZodSchema<T> | undefined) => Promise<void>;
26
+ }
27
+ /**
28
+ * Context object created using `createContext` function. Provides a way to share state, dispatch functions,
29
+ * and axios instance across components without having to pass props down manually at every level.
30
+ *
31
+ * @type {ContextType}
32
+ */
33
+ declare const Context: import("react").Context<ContextType>;
34
+ export declare function useIntrigContext(): ContextType;
35
+ export { Context };
36
+ export type { GlobalState, RequestType };
37
+ //# sourceMappingURL=intrig-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intrig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2
+ import { IntrigHook, NetworkState } from './network-state';
3
+ import { CreateAxiosDefaults } from 'axios';
4
+ import { ZodSchema } from 'zod';
5
+ import { RequestType } from './intrig-context';
6
+ export interface DefaultConfigs extends CreateAxiosDefaults {
7
+ debounceDelay?: number;
8
+ }
9
+ export interface IntrigProviderProps {
10
+ configs?: Record<string, DefaultConfigs>;
11
+ children: React.ReactNode;
12
+ }
13
+ /**
14
+ * IntrigProvider is a context provider component that sets up global state management
15
+ * and provides Axios instances for API requests.
16
+ *
17
+ * @param {Object} props - The properties object.
18
+ * @param {React.ReactNode} props.children - The child components to be wrapped by the provider.
19
+ * @param {Object} [props.configs={}] - Configuration object for Axios instances.
20
+ * @param {Object} [props.configs.defaults={}] - Default configuration for Axios.
21
+ * @param {Object} [props.configs.petstore={}] - Configuration specific to the petstore API.
22
+ * @return {JSX.Element} A context provider component that wraps the provided children.
23
+ */
24
+ export declare function IntrigProvider({ children, configs, }: IntrigProviderProps): import("react/jsx-runtime").JSX.Element;
25
+ export interface StubType<P, B, T> {
26
+ <P, B, T>(hook: IntrigHook<P, B, T>, fn: (params: P, body: B, dispatch: (state: NetworkState<T>) => void) => Promise<void>): void;
27
+ }
28
+ export type WithStubSupport<T> = T & {
29
+ stubs?: (stub: StubType<any, any, any>) => void;
30
+ };
31
+ export interface IntrigProviderStubProps {
32
+ configs?: DefaultConfigs;
33
+ stubs?: (stub: StubType<any, any, any>) => void;
34
+ children: React.ReactNode;
35
+ }
36
+ export declare function IntrigProviderStub({ children, configs, stubs, }: IntrigProviderStubProps): import("react/jsx-runtime").JSX.Element;
37
+ export interface StatusTrapProps {
38
+ type: 'pending' | 'error' | 'pending + error';
39
+ propagate?: boolean;
40
+ }
41
+ /**
42
+ * StatusTrap component is used to track and manage network request states.
43
+ *
44
+ * @param {Object} props - The properties object.
45
+ * @param {React.ReactNode} props.children - The child elements to be rendered.
46
+ * @param {string} props.type - The type of network state to handle ("error", "pending", "pending + error").
47
+ * @param {boolean} [props.propagate=true] - Whether to propagate the event to the parent context.
48
+ * @return {React.ReactElement} The context provider component with filtered state and custom dispatch.
49
+ */
50
+ export declare function StatusTrap({ children, type, propagate, }: PropsWithChildren<StatusTrapProps>): import("react/jsx-runtime").JSX.Element;
51
+ export interface NetworkStateProps<T, E = unknown> {
52
+ key: string;
53
+ operation: string;
54
+ source: string;
55
+ schema?: ZodSchema<T>;
56
+ errorSchema?: ZodSchema<E>;
57
+ debounceDelay?: number;
58
+ }
59
+ /**
60
+ * useNetworkState is a custom hook that manages the network state within the specified context.
61
+ * It handles making network requests, dispatching appropriate states based on the request lifecycle,
62
+ * and allows aborting ongoing requests.
63
+ *
64
+ * @param {Object} params - The parameters required to configure and use the network state.
65
+ * @param {string} params.key - A unique identifier for the network request.
66
+ * @param {string} params.operation - The operation type related to the request.
67
+ * @param {string} params.source - The source or endpoint for the network request.
68
+ * @param {Object} params.schema - The schema used for validating the response data.
69
+ * @param {number} [params.debounceDelay] - The debounce delay for executing the network request.
70
+ *
71
+ * @return {[NetworkState<T>, (request: AxiosRequestConfig) => void, () => void]}
72
+ * Returns a state object representing the current network state,
73
+ * a function to execute the network request, and a function to clear the request.
74
+ */
75
+ export declare function useNetworkState<T, E = unknown>({ key, operation, source, schema, errorSchema, debounceDelay: requestDebounceDelay, }: NetworkStateProps<T>): [
76
+ NetworkState<T, E>,
77
+ (request: RequestType) => void,
78
+ clear: () => void,
79
+ (state: NetworkState<T, E>) => void
80
+ ];
81
+ /**
82
+ * Handles central error extraction from the provided context.
83
+ * It filters the state to retain error states and maps them to a structured error object with additional context information.
84
+ * @return {Object[]} An array of objects representing the error states with context information such as source, operation, and key.
85
+ */
86
+ export declare function useCentralError(): {
87
+ source: string;
88
+ operation: string;
89
+ key: string;
90
+ state: "error";
91
+ error: unknown;
92
+ statusCode?: number;
93
+ request?: any;
94
+ }[];
95
+ /**
96
+ * Uses central pending state handling by aggregating pending states from context.
97
+ * It calculates the overall progress of pending states if any, or returns an initial state otherwise.
98
+ *
99
+ * @return {NetworkState} The aggregated network state based on the pending states and their progress.
100
+ */
101
+ export declare function useCentralPendingState(): NetworkState<unknown, unknown>;
102
+ //# sourceMappingURL=intrig-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intrig-provider.d.ts","sourceRoot":"","sources":["../../../lib/src/intrig-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,UAAU,EAIV,YAAY,EAIb,MAAM,iBAAiB,CAAC;AACzB,OAAc,EAGZ,mBAAmB,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAKhC,OAAO,EAAW,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAmBrE,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,OAAY,GACb,EAAE,mBAAmB,2CA6GrB;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAC/B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACN,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACzB,EAAE,EAAE,CACF,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,KACvC,OAAO,CAAC,IAAI,CAAC,GACjB,IAAI,CAAC;CACT;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IACnC,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,CAAC,CAAC;IAClB,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI;IAC9B,KAAK,EAAE,MAAM,IAAI;IACjB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI;CACpC,CAoFA;AAeD;;;;GAIG;AACH,wBAAgB,eAAe;;;;;;;;IAgB9B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,mCAwBrC"}
@@ -0,0 +1,14 @@
1
+ import { LogLevelDesc } from 'loglevel';
2
+ declare global {
3
+ interface window {
4
+ setLogLevel?: (level: LogLevelDesc) => void;
5
+ }
6
+ }
7
+ export declare const logger: {
8
+ info: (msg: unknown, meta?: unknown) => void;
9
+ warn: (msg: unknown, meta?: unknown) => void;
10
+ error: (msg: unknown, meta?: unknown) => void;
11
+ debug: (msg: unknown, meta?: unknown) => void;
12
+ };
13
+ export default logger;
14
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../lib/src/logger.ts"],"names":[],"mappings":"AAEA,OAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;KAC7C;CACF;AAoCD,eAAO,MAAM,MAAM;gBACL,OAAO,SAAS,OAAO,KAAG,IAAI;gBAE9B,OAAO,SAAS,OAAO,KAAG,IAAI;iBAE7B,OAAO,SAAS,OAAO,KAAG,IAAI;iBAE9B,OAAO,SAAS,OAAO,KAAG,IAAI;CAE5C,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ZodSchema } from 'zod';
2
+ export declare function encode<T>(request: T, mediaType: string, schema: ZodSchema): any;
3
+ export declare function transform<T>(request: Request, mediaType: string, schema: ZodSchema): Promise<T>;
4
+ export declare function transformResponse<T>(data: any, mediaType: string, schema: ZodSchema): Promise<T>;
5
+ //# sourceMappingURL=media-type-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-type-utils.d.ts","sourceRoot":"","sources":["../../../lib/src/media-type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAiBhC,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,OAKzE;AAuED,wBAAgB,SAAS,CAAC,CAAC,EACzB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,CAAC,CAAC,CAKZ;AAsFD,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,IAAI,EAAE,GAAG,EACT,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,CAAC,CAAC,CAKZ"}
@@ -0,0 +1,383 @@
1
+ import { ZodError } from 'zod';
2
+ /**
3
+ * State of an asynchronous call. Network state follows the state diagram given below.
4
+ *
5
+ *
6
+ * <pre>
7
+ * ┌──────┐
8
+ * ┌─────────────► Init ◄────────────┐
9
+ * │ └▲────┬┘ │
10
+ * │ │ │ │
11
+ * │ Reset Execute │
12
+ * Reset │ │ Reset
13
+ * │ ┌──┴────┴──┐ │
14
+ * │ ┌────► Pending ◄────┐ │
15
+ * │ │ └──┬────┬──┘ │ │
16
+ * │ Execute │ │ Execute │
17
+ * │ │ │ │ │ │
18
+ * │ │ OnSuccess OnError │ │
19
+ * │ ┌────┴──┐ │ │ ┌──┴───┐ │
20
+ * └─┤Success◄────┘ └────►Error ├─┘
21
+ * └───────┘ └──────┘
22
+ *
23
+ * </pre>
24
+ */
25
+ export interface NetworkState<T = unknown, E = unknown> {
26
+ state: 'init' | 'pending' | 'success' | 'error';
27
+ }
28
+ /**
29
+ * Network call is not yet started
30
+ */
31
+ export interface InitState<T, E = unknown> extends NetworkState<T, E> {
32
+ state: 'init';
33
+ }
34
+ /**
35
+ * Checks whether the state is init state
36
+ * @param state
37
+ */
38
+ export declare function isInit<T, E = unknown>(state: NetworkState<T, E>): state is InitState<T, E>;
39
+ /**
40
+ * Initializes a new state.
41
+ *
42
+ * @template T The type of the state.
43
+ * @return {InitState<T>} An object representing the initial state.
44
+ */
45
+ export declare function init<T, E = unknown>(): InitState<T, E>;
46
+ /**
47
+ * Network call is not yet completed
48
+ */
49
+ export interface PendingState<T, E = unknown> extends NetworkState<T, E> {
50
+ state: 'pending';
51
+ progress?: Progress;
52
+ data?: T;
53
+ }
54
+ /**
55
+ * Interface representing progress information for an upload or download operation.
56
+ *
57
+ * @typedef {object} Progress
58
+ *
59
+ * @property {'upload' | 'download'} type - The type of the operation.
60
+ *
61
+ * @property {number} loaded - The amount of data that has been loaded so far.
62
+ *
63
+ * @property {number} [total] - The total amount of data to be loaded (if known).
64
+ */
65
+ export interface Progress {
66
+ type?: 'upload' | 'download';
67
+ loaded: number;
68
+ total?: number;
69
+ }
70
+ /**
71
+ * Checks whether the state is pending state
72
+ * @param state
73
+ */
74
+ export declare function isPending<T, E = unknown>(state: NetworkState<T, E>): state is PendingState<T, E>;
75
+ /**
76
+ * Generates a PendingState object with a state of "pending".
77
+ *
78
+ * @return {PendingState<T>} An object representing the pending state.
79
+ */
80
+ export declare function pending<T, E = unknown>(progress?: Progress | undefined, data?: T | undefined): PendingState<T, E>;
81
+ /**
82
+ * Network call is completed with success state
83
+ */
84
+ export interface SuccessState<T, E = unknown> extends NetworkState<T, E> {
85
+ state: 'success';
86
+ data: T;
87
+ }
88
+ /**
89
+ * Checks whether the state is success response
90
+ * @param state
91
+ */
92
+ export declare function isSuccess<T, E = unknown>(state: NetworkState<T, E>): state is SuccessState<T, E>;
93
+ /**
94
+ * Creates a success state object with the provided data.
95
+ *
96
+ * @param {T} data - The data to be included in the success state.
97
+ * @return {SuccessState<T>} An object representing a success state containing the provided data.
98
+ */
99
+ export declare function success<T, E = unknown>(data: T): SuccessState<T, E>;
100
+ /**
101
+ * Network call is completed with error response
102
+ */
103
+ export interface ErrorState<T, E = unknown> extends NetworkState<T, E> {
104
+ state: 'error';
105
+ error: E;
106
+ statusCode?: number;
107
+ request?: any;
108
+ }
109
+ /**
110
+ * Checks whether the state is error state
111
+ * @param state
112
+ */
113
+ export declare function isError<T, E = unknown>(state: NetworkState<T, E>): state is ErrorState<T, E>;
114
+ /**
115
+ * Constructs an ErrorState object representing an error.
116
+ *
117
+ * @param {any} error - The error object or message.
118
+ * @param {string} [statusCode] - An optional status code associated with the error.
119
+ * @return {ErrorState<T>} An object representing the error state.
120
+ */
121
+ export declare function error<T, E = unknown>(error: E, statusCode?: number, request?: any): ErrorState<T>;
122
+ /**
123
+ * Represents an error state with additional contextual information.
124
+ *
125
+ * @typedef {Object} ErrorWithContext
126
+ * @template T
127
+ * @extends ErrorState<T>
128
+ *
129
+ * @property {string} source - The origin of the error.
130
+ * @property {string} operation - The operation being performed when the error occurred.
131
+ * @property {string} key - A unique key identifying the specific error instance.
132
+ */
133
+ export interface ErrorWithContext<T = unknown, E = unknown> extends ErrorState<T, E> {
134
+ source: string;
135
+ operation: string;
136
+ key: string;
137
+ }
138
+ /**
139
+ * Represents an action in the network context.
140
+ *
141
+ * @template T - The type of data associated with the network action
142
+ *
143
+ * @property {NetworkState<any>} state - The current state of the network action
144
+ * @property {string} key - The unique identifier for the network action
145
+ */
146
+ export interface NetworkAction<T, E> {
147
+ key: string;
148
+ source: string;
149
+ operation: string;
150
+ state: NetworkState<T, E>;
151
+ handled?: boolean;
152
+ }
153
+ type HookWithKey = {
154
+ key: string;
155
+ };
156
+ export type UnitHookOptions = {
157
+ key?: string;
158
+ fetchOnMount?: false;
159
+ clearOnUnmount?: boolean;
160
+ } | {
161
+ key?: string;
162
+ fetchOnMount: true;
163
+ params?: Record<string, any>;
164
+ clearOnUnmount?: boolean;
165
+ };
166
+ export type UnitHook<E = unknown> = ((options: UnitHookOptions) => [
167
+ NetworkState<never, E>,
168
+ (params?: Record<string, any>) => DispatchState<any>,
169
+ () => void
170
+ ]) & HookWithKey;
171
+ export type ConstantHook<T, E = unknown> = ((options: UnitHookOptions) => [
172
+ NetworkState<T, E>,
173
+ (params?: Record<string, any>) => DispatchState<any>,
174
+ () => void
175
+ ]) & HookWithKey;
176
+ export type UnaryHookOptions<P> = {
177
+ key?: string;
178
+ fetchOnMount?: false;
179
+ clearOnUnmount?: boolean;
180
+ } | {
181
+ key?: string;
182
+ fetchOnMount: true;
183
+ params: P;
184
+ clearOnUnmount?: boolean;
185
+ };
186
+ export type UnaryProduceHook<P, E = unknown> = ((options?: UnaryHookOptions<P>) => [NetworkState<never, E>, (params: P) => DispatchState<any>, () => void]) & HookWithKey;
187
+ export type UnaryFunctionHook<P, T, E = unknown> = ((options?: UnaryHookOptions<P>) => [NetworkState<T, E>, (params: P) => DispatchState<any>, () => void]) & HookWithKey;
188
+ export type BinaryHookOptions<P, B> = {
189
+ key?: string;
190
+ fetchOnMount?: false;
191
+ clearOnUnmount?: boolean;
192
+ } | {
193
+ key?: string;
194
+ fetchOnMount: true;
195
+ params: P;
196
+ body: B;
197
+ clearOnUnmount?: boolean;
198
+ };
199
+ export type BinaryProduceHook<P, B, E = unknown> = ((options?: BinaryHookOptions<P, B>) => [
200
+ NetworkState<never, E>,
201
+ (body: B, params: P) => DispatchState<any>,
202
+ () => void
203
+ ]) & HookWithKey;
204
+ export type BinaryFunctionHook<P, B, T, E = unknown> = ((options?: BinaryHookOptions<P, B>) => [
205
+ NetworkState<T, E>,
206
+ (body: B, params: P) => DispatchState<any>,
207
+ () => void
208
+ ]) & HookWithKey;
209
+ export type IntrigHookOptions<P = undefined, B = undefined> = UnitHookOptions | UnaryHookOptions<P> | BinaryHookOptions<P, B>;
210
+ export type IntrigHook<P = undefined, B = undefined, T = any, E = unknown> = UnitHook<E> | ConstantHook<T, E> | UnaryProduceHook<P, E> | UnaryFunctionHook<P, T, E> | BinaryProduceHook<P, B, E> | BinaryFunctionHook<P, B, T, E>;
211
+ export interface AsyncRequestOptions {
212
+ hydrate?: boolean;
213
+ key?: string;
214
+ }
215
+ /**
216
+ * Represents the dispatch state of a process.
217
+ *
218
+ * @template T The type of the state information.
219
+ * @interface
220
+ *
221
+ * @property {string} state The current state of the dispatch process.
222
+ */
223
+ export interface DispatchState<T> {
224
+ state: string;
225
+ }
226
+ /**
227
+ * Represents a successful dispatch state.
228
+ *
229
+ * @template T - Type of the data associated with the dispatch.
230
+ *
231
+ * @extends DispatchState<T>
232
+ *
233
+ * @property {string} state - The state of the dispatch, always 'success'.
234
+ */
235
+ export interface SuccessfulDispatch<T> extends DispatchState<T> {
236
+ state: 'success';
237
+ }
238
+ /**
239
+ * Indicates a successful dispatch state.
240
+ *
241
+ * @return {DispatchState<T>} An object representing a successful state.
242
+ */
243
+ export declare function successfulDispatch<T>(): DispatchState<T>;
244
+ /**
245
+ * Determines if the provided dispatch state represents a successful dispatch.
246
+ *
247
+ * @param {DispatchState<T>} value - The dispatch state to check.
248
+ * @return {value is SuccessfulDispatch<T>} - True if the dispatch state indicates success, false otherwise.
249
+ */
250
+ export declare function isSuccessfulDispatch<T>(value: DispatchState<T>): value is SuccessfulDispatch<T>;
251
+ /**
252
+ * ValidationError interface represents a specific type of dispatch state
253
+ * where a validation error has occurred.
254
+ *
255
+ * @typeparam T - The type of the data associated with this dispatch state.
256
+ */
257
+ export interface ValidationError<T> extends DispatchState<T> {
258
+ state: 'validation-error';
259
+ error: any;
260
+ }
261
+ /**
262
+ * Generates a ValidationError object.
263
+ *
264
+ * @param error The error details that caused the validation to fail.
265
+ * @return The ValidationError object containing the error state and details.
266
+ */
267
+ export declare function validationError<T>(error: any): ValidationError<T>;
268
+ /**
269
+ * Determines if a provided DispatchState object is a ValidationError.
270
+ *
271
+ * @param {DispatchState<T>} value - The DispatchState object to evaluate.
272
+ * @return {boolean} - Returns true if the provided DispatchState object is a ValidationError, otherwise returns false.
273
+ */
274
+ export declare function isValidationError<T>(value: DispatchState<T>): value is ValidationError<T>;
275
+ /**
276
+ * Represents an error structure with a specified type and associated data.
277
+ *
278
+ * @template T - The type of the data associated with the error.
279
+ * @template E - The type of the error detail.
280
+ *
281
+ * @property {string} type - A string representing the type of the error.
282
+ */
283
+ export interface IntrigError<T, E> {
284
+ type: string;
285
+ }
286
+ /**
287
+ * Represents an error encountered during a network operation.
288
+ * Extends from the `IntrigError` interface, adding network-specific properties.
289
+ *
290
+ * @template T - The type of the intrinsic data associated with the error.
291
+ * @template E - The type of the error details, defaulting to `unknown`.
292
+ *
293
+ * @property {string} type - A constant property representing the error type, always set to 'network'.
294
+ * @property {string} statusCode - A string representation of the HTTP status code associated with the error, indicating the nature of the network failure.
295
+ * @property {E} error - The detailed error information specific to the failure, type extends from the generic E, allowing flexibility in the error details.
296
+ * @property {any} request - The request object that was attempted when the network error occurred, providing context for what operation failed.
297
+ */
298
+ export interface NetworkError<T, E = unknown> extends IntrigError<T, E> {
299
+ type: 'network';
300
+ statusCode: string;
301
+ error: E;
302
+ request: any;
303
+ }
304
+ /**
305
+ * Constructs a network error object.
306
+ *
307
+ * @param error The error object corresponding to the network request.
308
+ * @param statusCode A string representing the HTTP status code returned.
309
+ * @param request The request object associated with the network operation.
310
+ * @return A NetworkError object containing the error type, status code, error details, and the original request.
311
+ */
312
+ export declare function networkError<T, E>(error: E, statusCode: string, request: any): NetworkError<T, E>;
313
+ /**
314
+ * Determines if the provided IntrigError is of type 'network'.
315
+ *
316
+ * @param {IntrigError<T, E>} value - The error value to check the type of.
317
+ * @return {boolean} - Returns true if the error is of type 'network', otherwise false.
318
+ */
319
+ export declare function isNetworkError<T, E>(value: IntrigError<T, E>): value is NetworkError<T, E>;
320
+ /**
321
+ * Interface representing a request validation error.
322
+ *
323
+ * This error occurs when a validation process on a request fails. It extends the IntrigError interface
324
+ * by adding specific properties related to request validation.
325
+ *
326
+ * @template T - The type of the data associated with the error.
327
+ * @template E - The optional type of additional error information. Defaults to unknown.
328
+ *
329
+ * @extends IntrigError<T, E>
330
+ *
331
+ * @property {string} type - A string literal indicating the error type as 'request-validation'.
332
+ * @property {ZodError} error - An instance of ZodError containing detailed validation error information.
333
+ */
334
+ export interface RequestValidationError<T, E = unknown> extends IntrigError<T, E> {
335
+ type: 'request-validation';
336
+ error: ZodError;
337
+ }
338
+ /**
339
+ * Constructs a RequestValidationError object encapsulating the ZodError.
340
+ *
341
+ * @param {ZodError} error - The error object resulting from Zod schema validation.
342
+ * @return {RequestValidationError<T, E>} A RequestValidationError object containing the validation error information.
343
+ */
344
+ export declare function requestValidationError<T, E>(error: ZodError): RequestValidationError<T, E>;
345
+ /**
346
+ * Determines if a given error is of type RequestValidationError.
347
+ *
348
+ * @param value The error object to check, which implements the IntrigError interface.
349
+ * @return A boolean indicating whether the error is a RequestValidationError.
350
+ */
351
+ export declare function isRequestValidationError<T, E>(value: IntrigError<T, E>): value is RequestValidationError<T, E>;
352
+ /**
353
+ * ResponseValidationError interface is designed to extend the capabilities of the IntrigError interface,
354
+ * specifically for handling errors related to response validation.
355
+ *
356
+ * @template T - Represents the type of the data or payload associated with the error.
357
+ * @template E - Represents the type of any additional error information. Defaults to unknown.
358
+ *
359
+ * @extends IntrigError
360
+ *
361
+ * @property type - A string literal that identifies the type of error as 'response-validation'.
362
+ * @property error - An instance of ZodError representing the validation error encountered.
363
+ */
364
+ export interface ResponseValidationError<T, E = unknown> extends IntrigError<T, E> {
365
+ type: 'response-validation';
366
+ error: ZodError;
367
+ }
368
+ /**
369
+ * Constructs a ResponseValidationError object with a specified error.
370
+ *
371
+ * @param {ZodError} error - The validation error encountered during response validation.
372
+ * @return {ResponseValidationError<T, E>} An error object containing the type of error and the validation error details.
373
+ */
374
+ export declare function responseValidationError<T, E>(error: ZodError): ResponseValidationError<T, E>;
375
+ /**
376
+ * Determines if the given error is a response validation error.
377
+ *
378
+ * @param {IntrigError<T, E>} value - The error object to assess.
379
+ * @return {boolean} True if the error is a response validation error, otherwise false.
380
+ */
381
+ export declare function isResponseValidationError<T, E>(value: IntrigError<T, E>): value is ResponseValidationError<T, E>;
382
+ export {};
383
+ //# sourceMappingURL=network-state.d.ts.map