@ethlete/query 5.23.0 → 5.24.0
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/CHANGELOG.md +6 -0
- package/fesm2022/ethlete-query.mjs +1039 -651
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/lib/experimental/{bearer-auth-provider-config.d.ts → auth/bearer-auth-provider-config.d.ts} +1 -3
- package/lib/experimental/{bearer-auth-provider.d.ts → auth/bearer-auth-provider.d.ts} +1 -1
- package/lib/experimental/auth/index.d.ts +2 -0
- package/lib/experimental/gql/gql-query-creator-templates.d.ts +11 -0
- package/lib/experimental/gql/gql-query-creator.d.ts +14 -0
- package/lib/experimental/gql/gql-query-execute.d.ts +11 -0
- package/lib/experimental/gql/gql-query.d.ts +12 -0
- package/lib/experimental/gql/index.d.ts +4 -0
- package/lib/experimental/http/index.d.ts +20 -0
- package/lib/experimental/http/paged-query-stack.d.ts +149 -0
- package/lib/experimental/http/query-client-config.d.ts +45 -0
- package/lib/experimental/{query-creator-templates.d.ts → http/query-creator-templates.d.ts} +11 -1
- package/lib/experimental/http/query-creator.d.ts +73 -0
- package/lib/experimental/{query-dependencies.d.ts → http/query-dependencies.d.ts} +5 -0
- package/lib/experimental/http/query-errors.d.ts +50 -0
- package/lib/experimental/{query-execute-utils.d.ts → http/query-execute-utils.d.ts} +15 -2
- package/lib/experimental/{query-execute.d.ts → http/query-execute.d.ts} +5 -3
- package/lib/experimental/http/query-features.d.ts +85 -0
- package/lib/experimental/{query-repository.d.ts → http/query-repository.d.ts} +3 -1
- package/lib/experimental/{query-snapshot.d.ts → http/query-snapshot.d.ts} +2 -2
- package/lib/experimental/http/query-stack.d.ts +101 -0
- package/lib/experimental/{query-utils.d.ts → http/query-utils.d.ts} +25 -15
- package/lib/experimental/{query.d.ts → http/query.d.ts} +24 -2
- package/lib/experimental/{secure-query-creator.d.ts → http/secure-query-creator.d.ts} +1 -1
- package/lib/experimental/{secure-query-execute.d.ts → http/secure-query-execute.d.ts} +2 -2
- package/lib/experimental/index.d.ts +4 -22
- package/lib/experimental/ws/index.d.ts +2 -0
- package/lib/experimental/ws/web-socket-client-config.d.ts +12 -0
- package/lib/experimental/ws/web-socket-client.d.ts +20 -0
- package/lib/experimental/ws/web-socket-errors.d.ts +9 -0
- package/lib/gql/gql.d.ts +3 -2
- package/package.json +8 -7
- package/lib/experimental/paged-query.d.ts +0 -77
- package/lib/experimental/query-client-config.d.ts +0 -18
- package/lib/experimental/query-creator.d.ts +0 -39
- package/lib/experimental/query-errors.d.ts +0 -49
- package/lib/experimental/query-features.d.ts +0 -48
- package/lib/experimental/query-stack.d.ts +0 -48
- /package/lib/experimental/{http-request.d.ts → http/http-request.d.ts} +0 -0
- /package/lib/experimental/{query-client.d.ts → http/query-client.d.ts} +0 -0
- /package/lib/experimental/{query-state.d.ts → http/query-state.d.ts} +0 -0
- /package/lib/experimental/{secure-query.d.ts → http/secure-query.d.ts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { QueryArgs, QuerySnapshot } from './query';
|
|
2
2
|
import { QueryDependencies } from './query-dependencies';
|
|
3
|
-
import {
|
|
3
|
+
import { InternalQueryExecute } from './query-execute';
|
|
4
4
|
import { QueryState } from './query-state';
|
|
5
5
|
export type CreateQuerySnapshotOptions<TArgs extends QueryArgs> = {
|
|
6
6
|
state: QueryState<TArgs>;
|
|
7
7
|
deps: QueryDependencies;
|
|
8
|
-
execute:
|
|
8
|
+
execute: InternalQueryExecute<TArgs>;
|
|
9
9
|
};
|
|
10
10
|
export declare const createQuerySnapshotFn: <TArgs extends QueryArgs>(options: CreateQuerySnapshotOptions<TArgs>) => () => QuerySnapshot<TArgs>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
import { AnyQuery, RequestArgs, ResponseType } from './query';
|
|
4
|
+
import { AnyQueryCreator, QueryArgsOf, RunQueryCreator } from './query-creator';
|
|
5
|
+
import { QueryFeature } from './query-features';
|
|
6
|
+
export type QueryStack<TQuery extends AnyQuery, TTransform> = {
|
|
7
|
+
/** Contains all queries in the stack. */
|
|
8
|
+
queries: Signal<TQuery[]>;
|
|
9
|
+
/** Contains the last query in the stack. Useful for getting current pagination values. */
|
|
10
|
+
lastQuery: Signal<TQuery | null>;
|
|
11
|
+
/** True if any query in the stack is loading. */
|
|
12
|
+
loading: Signal<boolean>;
|
|
13
|
+
/** Contains the first error that occurred in the stack. */
|
|
14
|
+
error: Signal<HttpErrorResponse | null>;
|
|
15
|
+
/** Contains the responses of all queries in the stack. Will be `null` for queries that are loading or errored. */
|
|
16
|
+
response: Signal<TTransform>;
|
|
17
|
+
/** Executes all queries in the stack. */
|
|
18
|
+
execute: (options?: {
|
|
19
|
+
allowCache?: boolean;
|
|
20
|
+
}) => void;
|
|
21
|
+
/** Destroys all queries in the stack and empties it. This should only be used if `append` is true. */
|
|
22
|
+
clear: () => void;
|
|
23
|
+
};
|
|
24
|
+
export type AnyQueryStack = QueryStack<AnyQuery, any>;
|
|
25
|
+
export type CreateQueryStackOptions<TCreator extends AnyQueryCreator, TDeps extends () => any, TTransform = (ResponseType<QueryArgsOf<TCreator>> | null)[]> = {
|
|
26
|
+
/**
|
|
27
|
+
* The query creator function that will be used to create the query stack.
|
|
28
|
+
*/
|
|
29
|
+
queryCreator: TCreator;
|
|
30
|
+
/**
|
|
31
|
+
* The dependencies that should trigger a new query stack creation.
|
|
32
|
+
* This function can be treated like a computed function. It reacts to signal changes.
|
|
33
|
+
* The return value of this function will be passed to the `args` function.
|
|
34
|
+
*
|
|
35
|
+
* This option can be ignored if `append` is false.
|
|
36
|
+
*/
|
|
37
|
+
dependencies?: TDeps;
|
|
38
|
+
/**
|
|
39
|
+
* The features that should be used for all queries in the stack.
|
|
40
|
+
*
|
|
41
|
+
* @throws If the `withArgs` feature is used. This feature is internally used.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Due to limitations in TypeScript, you have to manually add the needed generic types if needed.
|
|
45
|
+
* features: [E.withSuccessHandling<GetPostQueryArgs>({ handler: (post) => console.log(post.title) })]
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // If typings are not needed, you can use the feature without generics.
|
|
49
|
+
* features: [E.withPolling({ interval: 5000 })]
|
|
50
|
+
*/
|
|
51
|
+
features?: QueryFeature<any>[];
|
|
52
|
+
/**
|
|
53
|
+
* The arguments to create queries with.
|
|
54
|
+
* This function can be treated like a computed function. It reacts to signal changes.
|
|
55
|
+
* If a signal changes, a new query will be created (and appended to the existing ones if `append` is true).
|
|
56
|
+
* If this function returns `null`, the args will be ignored.
|
|
57
|
+
* If this function returns an array, multiple queries will be created.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // One query
|
|
61
|
+
* () => ({ queryParams: { postId: myId() } }),
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Multiple queries (these can of cause also be created using a loop)
|
|
65
|
+
* () => [
|
|
66
|
+
* { queryParams: { postId: myId() } },
|
|
67
|
+
* { queryParams: { postId: myOtherId() } },
|
|
68
|
+
* ],
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // One query with dependencies
|
|
72
|
+
* (deps) => ({ queryParams: { postId: myId(), limit: deps.limit } }),
|
|
73
|
+
*/
|
|
74
|
+
args: (deps: ReturnType<TDeps>) => RequestArgs<QueryArgsOf<TCreator>> | RequestArgs<QueryArgsOf<TCreator>>[] | null;
|
|
75
|
+
/**
|
|
76
|
+
* If true, new queries will be appended to the existing ones. Otherwise, existing queries will be destroyed.
|
|
77
|
+
* This should be used for things like infinite scrolling where already fetched queries should not be destroyed.
|
|
78
|
+
*/
|
|
79
|
+
append?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* If append is true, this function will be called to merge the old and new queries.
|
|
82
|
+
* Useful if you want to append the new queries in a specific order (e.g. at the beginning).
|
|
83
|
+
*/
|
|
84
|
+
appendFn?: (oldQueries: RunQueryCreator<TCreator>[], newQueries: RunQueryCreator<TCreator>[]) => {
|
|
85
|
+
/** The new queries merged with the old ones. */
|
|
86
|
+
queries: RunQueryCreator<TCreator>[];
|
|
87
|
+
/** The last query in the new queries. */
|
|
88
|
+
lastQuery: RunQueryCreator<TCreator> | null;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Transforms the responses of all queries in the stack. Useful for merging or filtering responses.
|
|
92
|
+
*/
|
|
93
|
+
transform?: (responses: ResponseType<QueryArgsOf<TCreator>>[]) => TTransform;
|
|
94
|
+
};
|
|
95
|
+
/** Transforms an array of arrays into a single array and filters out `null` values. */
|
|
96
|
+
export declare const transformArrayResponse: <T extends (unknown | null)[]>(responses: T) => NonNullable<T[0]>[];
|
|
97
|
+
/** Transforms an array of paginated responses into a single array and filters out `null` values. */
|
|
98
|
+
export declare const transformPaginatedResponse: <T extends ({
|
|
99
|
+
items: unknown[];
|
|
100
|
+
} | null)[]>(responses: T) => NonNullable<NonNullable<T[0]>["items"]>;
|
|
101
|
+
export declare const createQueryStack: <TCreator extends AnyQueryCreator, TArgs extends QueryArgsOf<TCreator>, TDeps extends () => any, TTransform = (ResponseType<TArgs> | null)[]>(options: CreateQueryStackOptions<TCreator, TDeps, TTransform>) => QueryStack<RunQueryCreator<TCreator>, TTransform>;
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
|
|
2
|
-
import { CreateEffectOptions } from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { CreateEffectOptions, Signal } from '@angular/core';
|
|
3
|
+
import { CreateGqlQueryOptions } from '../gql/gql-query';
|
|
4
|
+
import { GqlQueryMethod } from '../gql/gql-query-creator';
|
|
5
|
+
import { CreateQueryOptions, Query, QueryArgs, RequestArgs } from './query';
|
|
4
6
|
import { QueryMethod } from './query-creator';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
+
import { QueryDependencies } from './query-dependencies';
|
|
8
|
+
import { InternalQueryExecute } from './query-execute';
|
|
9
|
+
import { QueryFeature, QueryFeatureContext } from './query-features';
|
|
10
|
+
import { QueryKeyOrNone } from './query-repository';
|
|
7
11
|
import { QueryState } from './query-state';
|
|
8
12
|
/**
|
|
9
|
-
* Returning this inside
|
|
13
|
+
* Returning this inside a withArgs feature will reset the query args to null.
|
|
10
14
|
* This will also pause polling and auto refresh until new args are set.
|
|
11
15
|
*/
|
|
12
|
-
export declare const
|
|
13
|
-
export type
|
|
16
|
+
export declare const CLEAR_QUERY_ARGS: unique symbol;
|
|
17
|
+
export type ClearQueryArgs = typeof CLEAR_QUERY_ARGS;
|
|
14
18
|
export declare const QUERY_EFFECT_ERROR_MESSAGE = "Effect triggered too often. This is probably due to a circular dependency inside the query.";
|
|
15
19
|
/** A angular effect that will throw an error in dev mode if it is called too often. This indicates a circular dependency inside the effect. */
|
|
16
|
-
export declare const queryEffect: (fn: () => void, errorMessage: string, options?: CreateEffectOptions) => import("@angular/core").EffectRef;
|
|
20
|
+
export declare const queryEffect: (fn: (isFirstRun: boolean) => void, errorMessage: string, options?: CreateEffectOptions) => import("@angular/core").EffectRef;
|
|
17
21
|
export declare const shouldAutoExecuteQuery: (method: QueryMethod) => method is "GET" | "HEAD" | "OPTIONS";
|
|
22
|
+
export declare const shouldAutoExecuteGqlQuery: (method: GqlQueryMethod) => method is "QUERY";
|
|
18
23
|
export declare const extractExpiresInSeconds: (headers: HttpHeaders) => number | null;
|
|
19
24
|
export type ShouldRetryRequestOptions = {
|
|
20
25
|
retryCount: number;
|
|
@@ -33,17 +38,22 @@ export type QueryFeatureFlags = {
|
|
|
33
38
|
shouldAutoExecuteMethod: boolean;
|
|
34
39
|
shouldAutoExecute: boolean;
|
|
35
40
|
hasRouteFunction: boolean;
|
|
41
|
+
onlyManualExecution?: boolean;
|
|
42
|
+
/** Human readable method name */
|
|
43
|
+
method: string;
|
|
36
44
|
};
|
|
37
|
-
export declare const getQueryFeatureUsage: <TArgs extends QueryArgs>(options: CreateQueryOptions<TArgs>) => QueryFeatureFlags;
|
|
38
|
-
export declare const applyQueryFeatures: <TArgs extends QueryArgs>(
|
|
39
|
-
export declare const maybeExecute:
|
|
45
|
+
export declare const getQueryFeatureUsage: <TArgs extends QueryArgs>(options: CreateQueryOptions<TArgs> | CreateGqlQueryOptions<TArgs>) => QueryFeatureFlags;
|
|
46
|
+
export declare const applyQueryFeatures: <TArgs extends QueryArgs>(features: QueryFeature<TArgs>[], context: QueryFeatureContext<TArgs>) => void;
|
|
47
|
+
export declare const maybeExecute: (options: {
|
|
40
48
|
flags: QueryFeatureFlags;
|
|
41
|
-
execute:
|
|
49
|
+
execute: InternalQueryExecute<any>;
|
|
42
50
|
}) => void;
|
|
43
51
|
export type CreateQueryObjectOptions<TArgs extends QueryArgs> = {
|
|
44
52
|
state: QueryState<TArgs>;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
destroy: () => void;
|
|
53
|
+
deps: QueryDependencies;
|
|
54
|
+
execute: InternalQueryExecute<TArgs>;
|
|
48
55
|
};
|
|
49
56
|
export declare const createQueryObject: <TArgs extends QueryArgs>(options: CreateQueryObjectOptions<TArgs>) => Query<TArgs>;
|
|
57
|
+
export declare const normalizeQueryRepositoryKey: (key: Signal<QueryKeyOrNone>) => Signal<string>;
|
|
58
|
+
export declare const shouldCacheQuery: (method: QueryMethod) => method is "GET" | "HEAD" | "OPTIONS";
|
|
59
|
+
export declare const buildQueryCacheKey: (route: string, args: RequestArgs<QueryArgs> | undefined) => string;
|
|
@@ -23,22 +23,44 @@ export type CreateQueryOptions<TArgs extends QueryArgs> = {
|
|
|
23
23
|
queryConfig: QueryConfig;
|
|
24
24
|
};
|
|
25
25
|
export type QueryBase<TArgs extends QueryArgs> = {
|
|
26
|
+
/** The arguments of the last execution of the query. Will be `null` if the query has never been executed */
|
|
26
27
|
args: Signal<RequestArgs<TArgs> | null>;
|
|
28
|
+
/**
|
|
29
|
+
* The latest response of the query. Will be `null` if the query has never been executed.
|
|
30
|
+
* Responses are cached until a new response is received.
|
|
31
|
+
* If a response is present but the next execution of the query fails, the response will be set to `null` again.
|
|
32
|
+
*/
|
|
27
33
|
response: Signal<ResponseType<TArgs> | null>;
|
|
34
|
+
/** The latest Angular HTTP client native http event that occurred during the last execution of the query. Will be `null` if no event occurred. */
|
|
28
35
|
latestHttpEvent: Signal<HttpEvent<ResponseType<TArgs>> | null>;
|
|
36
|
+
/** The loading state of the query. Will be `null` if the query currently isn't loading. */
|
|
29
37
|
loading: Signal<HttpRequestLoadingState | null>;
|
|
38
|
+
/** The error that occurred during the last execution of the query. Will be `null` if no error occurred. */
|
|
30
39
|
error: Signal<HttpErrorResponse | null>;
|
|
40
|
+
/** The time the query was last executed at. Will be `null` if the query has never been executed. */
|
|
31
41
|
lastTimeExecutedAt: Signal<number | null>;
|
|
32
|
-
id
|
|
42
|
+
/** The id of the query */
|
|
43
|
+
id: Signal<string>;
|
|
33
44
|
};
|
|
45
|
+
/** A snapshot of a query state at a specific point in time */
|
|
34
46
|
export type QuerySnapshot<TArgs extends QueryArgs> = QueryBase<TArgs> & {
|
|
47
|
+
/** This signal is `true` until the latest execution of the query has completed in any way (success, error, or cancellation) */
|
|
35
48
|
isAlive: Signal<boolean>;
|
|
36
49
|
};
|
|
37
50
|
export type AnyQuerySnapshot = QuerySnapshot<any>;
|
|
38
51
|
export type AnyQuery = Query<any>;
|
|
52
|
+
export type QuerySubtle = {
|
|
53
|
+
/** Destroys the query and cleans up all resources. The query should not be used after this method is called. */
|
|
54
|
+
destroy: () => void;
|
|
55
|
+
};
|
|
39
56
|
export type Query<TArgs extends QueryArgs> = QueryBase<TArgs> & {
|
|
57
|
+
/** Executes the query */
|
|
40
58
|
execute: QueryExecute<TArgs>;
|
|
59
|
+
/** Creates an immutable snapshot of the current query state */
|
|
41
60
|
createSnapshot: () => QuerySnapshot<TArgs>;
|
|
42
|
-
|
|
61
|
+
/** Resets the query state to its initial state */
|
|
62
|
+
reset: () => void;
|
|
63
|
+
/** Advanced query features. **WARNING!** Incorrectly using these features will likely **BREAK** your application. You have been warned! */
|
|
64
|
+
subtle: QuerySubtle;
|
|
43
65
|
};
|
|
44
66
|
export declare const createQuery: <TArgs extends QueryArgs>(options: CreateQueryOptions<TArgs>) => Query<TArgs>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyBearerAuthProviderConfig } from '
|
|
1
|
+
import { AnyBearerAuthProviderConfig } from '../auth/bearer-auth-provider-config';
|
|
2
2
|
import { QueryArgs } from './query';
|
|
3
3
|
import { CreateQueryCreatorOptions, InternalCreateQueryCreatorOptions, QueryCreator } from './query-creator';
|
|
4
4
|
export type InternalSecureCreateQueryCreatorOptions = InternalCreateQueryCreatorOptions & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QueryArgs } from './query';
|
|
2
|
-
import { CreateQueryExecuteOptions,
|
|
2
|
+
import { CreateQueryExecuteOptions, InternalQueryExecute } from './query-execute';
|
|
3
3
|
import { InternalSecureCreateQueryCreatorOptions } from './secure-query-creator';
|
|
4
4
|
export type CreateSecureQueryExecuteOptions<TArgs extends QueryArgs> = Omit<CreateQueryExecuteOptions<TArgs>, 'creatorInternals'> & {
|
|
5
5
|
creatorInternals: InternalSecureCreateQueryCreatorOptions;
|
|
6
6
|
};
|
|
7
|
-
export declare const createSecureExecuteFn: <TArgs extends QueryArgs>(options: CreateSecureQueryExecuteOptions<TArgs>) =>
|
|
7
|
+
export declare const createSecureExecuteFn: <TArgs extends QueryArgs>(options: CreateSecureQueryExecuteOptions<TArgs>) => InternalQueryExecute<TArgs>;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './http
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './query';
|
|
6
|
-
export * from './query-client';
|
|
7
|
-
export * from './query-client-config';
|
|
8
|
-
export * from './query-creator';
|
|
9
|
-
export * from './query-creator-templates';
|
|
10
|
-
export * from './query-dependencies';
|
|
11
|
-
export * from './query-errors';
|
|
12
|
-
export * from './query-execute';
|
|
13
|
-
export * from './query-execute-utils';
|
|
14
|
-
export * from './query-features';
|
|
15
|
-
export * from './query-repository';
|
|
16
|
-
export * from './query-snapshot';
|
|
17
|
-
export * from './query-stack';
|
|
18
|
-
export * from './query-state';
|
|
19
|
-
export * from './query-utils';
|
|
20
|
-
export * from './secure-query';
|
|
21
|
-
export * from './secure-query-creator';
|
|
22
|
-
export * from './secure-query-execute';
|
|
1
|
+
export * from './auth';
|
|
2
|
+
export * from './gql';
|
|
3
|
+
export * from './http';
|
|
4
|
+
export * from './ws';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { SocketMessageView, WebSocketClient } from './web-socket-client';
|
|
3
|
+
export type CreateWebSocketClientConfig = {
|
|
4
|
+
name: string;
|
|
5
|
+
url: string;
|
|
6
|
+
};
|
|
7
|
+
export type WebSocketClientRef<T extends SocketMessageView = SocketMessageView> = InjectionToken<WebSocketClient<T>>;
|
|
8
|
+
export type WebSocketClientConfig = CreateWebSocketClientConfig & {
|
|
9
|
+
/** A generated token for dependency injection */
|
|
10
|
+
token: WebSocketClientRef;
|
|
11
|
+
};
|
|
12
|
+
export declare const createWebSocketClientConfig: (options: CreateWebSocketClientConfig) => WebSocketClientConfig;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { WebSocketClientConfig } from './web-socket-client-config';
|
|
3
|
+
export type SocketMessageView = {
|
|
4
|
+
room: string;
|
|
5
|
+
event: string;
|
|
6
|
+
data: unknown | null;
|
|
7
|
+
};
|
|
8
|
+
export type WebSocketClient<T extends SocketMessageView> = {
|
|
9
|
+
joinRoom: (room: string) => void;
|
|
10
|
+
joinComputedRoom: (room: () => string | null) => void;
|
|
11
|
+
leaveRoom: (room: string) => void;
|
|
12
|
+
leaveAllRooms: () => void;
|
|
13
|
+
currentEvent: Signal<T | null>;
|
|
14
|
+
isConnected: Signal<boolean>;
|
|
15
|
+
};
|
|
16
|
+
export declare const createWebSocketClient: <T extends SocketMessageView>(config: WebSocketClientConfig) => WebSocketClient<T>;
|
|
17
|
+
export declare const provideWebSocketClient: (config: WebSocketClientConfig) => {
|
|
18
|
+
provide: import("./web-socket-client-config").WebSocketClientRef<SocketMessageView>;
|
|
19
|
+
useFactory: () => WebSocketClient<SocketMessageView>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RuntimeError } from '@ethlete/core';
|
|
2
|
+
export declare const enum QueryRuntimeErrorCode {
|
|
3
|
+
ROOM_ALREADY_JOINED = 1000,
|
|
4
|
+
ROOM_NOT_JOINED = 1001,
|
|
5
|
+
MESSAGE_MALFORMED = 1002
|
|
6
|
+
}
|
|
7
|
+
export declare const roomAlreadyJoined: (room: string) => RuntimeError<QueryRuntimeErrorCode.ROOM_ALREADY_JOINED>;
|
|
8
|
+
export declare const roomNotJoined: (room: string) => RuntimeError<QueryRuntimeErrorCode.ROOM_NOT_JOINED>;
|
|
9
|
+
export declare const messageMalformed: () => RuntimeError<QueryRuntimeErrorCode.MESSAGE_MALFORMED>;
|
package/lib/gql/gql.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TransformedGqlQuery = {
|
|
2
2
|
query: string;
|
|
3
|
-
variables?: string
|
|
3
|
+
variables?: Record<string, unknown>;
|
|
4
4
|
operationName?: string;
|
|
5
5
|
};
|
|
6
|
+
export declare const transformGql: (str: string) => (variables: Record<string, unknown> | null | undefined) => TransformedGqlQuery;
|
|
6
7
|
export declare const gql: (strings: TemplateStringsArray, ...values: string[]) => string;
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/query",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0",
|
|
4
|
+
"sideEffects": false,
|
|
4
5
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "
|
|
6
|
-
"@angular/core": "
|
|
7
|
-
"@angular/forms": "
|
|
8
|
-
"@angular/router": "
|
|
6
|
+
"@angular/common": "19.1.4",
|
|
7
|
+
"@angular/core": "19.1.4",
|
|
8
|
+
"@angular/forms": "19.1.4",
|
|
9
|
+
"@angular/router": "19.1.4",
|
|
9
10
|
"@ethlete/core": "^4.0.3",
|
|
10
11
|
"@ethlete/types": "^1.6.2",
|
|
11
|
-
"rxjs": "
|
|
12
|
+
"rxjs": "7.8.1",
|
|
13
|
+
"socket.io-client": "4.8.1"
|
|
12
14
|
},
|
|
13
15
|
"module": "fesm2022/ethlete-query.mjs",
|
|
14
16
|
"typings": "index.d.ts",
|
|
@@ -21,7 +23,6 @@
|
|
|
21
23
|
"default": "./fesm2022/ethlete-query.mjs"
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
|
-
"sideEffects": false,
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"tslib": "^2.3.0"
|
|
27
28
|
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { ContentfulGqlLikePaginated, DynLikePaginated, GgLikePaginated, NormalizedPagination, Paginated } from '@ethlete/types';
|
|
2
|
-
import { Query, QueryArgs, RequestArgs, ResponseType } from './query';
|
|
3
|
-
import { QueryCreator } from './query-creator';
|
|
4
|
-
export declare const ethletePaginationAdapter: <T>(response: Paginated<T>) => NormalizedPagination<T>;
|
|
5
|
-
export declare const ggLikePaginationAdapter: <T>(response: GgLikePaginated<T>) => NormalizedPagination<T>;
|
|
6
|
-
export declare const dynLikePaginationAdapter: <T>(response: DynLikePaginated<T>) => NormalizedPagination<T>;
|
|
7
|
-
export declare const contentfulGqlLikePaginationAdapter: <T>(response: ContentfulGqlLikePaginated<T>) => NormalizedPagination<T>;
|
|
8
|
-
export type CreatePagedQueryOptions<TArgs extends QueryArgs> = {
|
|
9
|
-
/**
|
|
10
|
-
* The normalizer function that will be used to normalize the response to a format that the paged query can understand.
|
|
11
|
-
*
|
|
12
|
-
* There are some built-in normalizers that can be used:
|
|
13
|
-
* - `ethletePaginationAdapter`
|
|
14
|
-
* - `ggLikePaginationAdapter`
|
|
15
|
-
* - `dynLikePaginationAdapter`
|
|
16
|
-
* - `contentfulGqlLikePaginationAdapter`
|
|
17
|
-
*/
|
|
18
|
-
responseNormalizer: (response: ResponseType<TArgs>) => NormalizedPagination<ResponseType<TArgs>>;
|
|
19
|
-
/**
|
|
20
|
-
* The query creator function that will be used to create the paged query.
|
|
21
|
-
*/
|
|
22
|
-
queryCreator: QueryCreator<TArgs>;
|
|
23
|
-
/**
|
|
24
|
-
* The arguments to create the query.
|
|
25
|
-
* The current page will be passed as an argument.
|
|
26
|
-
* This function can be treated like a computed function. It reacts to signal changes.
|
|
27
|
-
* If a signal changes, the paged query will be reset to the initial page.
|
|
28
|
-
*
|
|
29
|
-
* @example (page) => ({ queryParams: { page, limit:20 } }),
|
|
30
|
-
*/
|
|
31
|
-
args: (page: number) => RequestArgs<TArgs>;
|
|
32
|
-
/**
|
|
33
|
-
* The page to start this paged query from.
|
|
34
|
-
* @default 1
|
|
35
|
-
*/
|
|
36
|
-
initialPage?: number;
|
|
37
|
-
};
|
|
38
|
-
export type PagedQueryResetOptions = {
|
|
39
|
-
/**
|
|
40
|
-
* The page to reset this paged query to.
|
|
41
|
-
* This will clear everything and start from this page.
|
|
42
|
-
* @default 1 // or the value passed in the `initialPage` option when creating the paged query.
|
|
43
|
-
*/
|
|
44
|
-
initialPage?: number;
|
|
45
|
-
};
|
|
46
|
-
export type PagedQueryExecuteOptions<TArgs extends QueryArgs> = {
|
|
47
|
-
/**
|
|
48
|
-
* If provided, only the queries that match the condition will be executed.
|
|
49
|
-
* This will also execute the previous and next query to the one that matched the condition.
|
|
50
|
-
* If not provided, all queries will be executed.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* myPagedQuery.execute({ where: (item) => item.id === 4 });
|
|
54
|
-
*/
|
|
55
|
-
where?: (item: ResponseType<TArgs>, index: number, array: ResponseType<TArgs>[]) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* If true, the cache will be used (if not expired) and the request will not be made.
|
|
58
|
-
* @default false
|
|
59
|
-
*/
|
|
60
|
-
allowCache?: boolean;
|
|
61
|
-
};
|
|
62
|
-
export declare const createPagedQuery: <TArgs extends QueryArgs>(options: CreatePagedQueryOptions<TArgs>) => {
|
|
63
|
-
pagination: import("@angular/core").Signal<NormalizedPagination<ResponseType<TArgs>> | null>;
|
|
64
|
-
fetchPreviousPage: () => void;
|
|
65
|
-
fetchNextPage: () => void;
|
|
66
|
-
canFetchPreviousPage: import("@angular/core").Signal<boolean>;
|
|
67
|
-
canFetchNextPage: import("@angular/core").Signal<boolean>;
|
|
68
|
-
items: import("@angular/core").Signal<ResponseType<TArgs>[]>;
|
|
69
|
-
direction: import("@angular/core").Signal<"next" | "previous">;
|
|
70
|
-
loading: import("@angular/core").Signal<boolean>;
|
|
71
|
-
error: import("@angular/core").Signal<import("@angular/common/http").HttpErrorResponse | null>;
|
|
72
|
-
lastQuery: import("@angular/core").Signal<Query<TArgs> | null>;
|
|
73
|
-
isFirstLoad: import("@angular/core").Signal<boolean>;
|
|
74
|
-
queries: Query<TArgs>[];
|
|
75
|
-
reset: (resetOptions?: PagedQueryResetOptions) => void;
|
|
76
|
-
execute: (options?: PagedQueryExecuteOptions<TArgs>) => void;
|
|
77
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
2
|
-
import { InjectionToken } from '@angular/core';
|
|
3
|
-
import { BuildQueryStringConfig } from '../request';
|
|
4
|
-
import { QueryClient } from './query-client';
|
|
5
|
-
import { ShouldRetryRequestFn } from './query-utils';
|
|
6
|
-
export type CacheAdapterFn = (headers: HttpHeaders) => number | null;
|
|
7
|
-
export type CreateQueryClientConfigOptions = {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
queryString?: BuildQueryStringConfig;
|
|
10
|
-
name: string;
|
|
11
|
-
cacheAdapter?: CacheAdapterFn;
|
|
12
|
-
retryFn?: ShouldRetryRequestFn;
|
|
13
|
-
};
|
|
14
|
-
export type QueryClientConfig = CreateQueryClientConfigOptions & {
|
|
15
|
-
token: QueryClientRef;
|
|
16
|
-
};
|
|
17
|
-
export type QueryClientRef = InjectionToken<QueryClient>;
|
|
18
|
-
export declare const createQueryClientConfig: (options: CreateQueryClientConfigOptions) => QueryClientConfig;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { PathParamsType, Query, QueryArgs } from './query';
|
|
2
|
-
import { QueryClientConfig } from './query-client-config';
|
|
3
|
-
import { QueryFeature } from './query-features';
|
|
4
|
-
export type RouteType<TArgs extends QueryArgs> = PathParamsType<TArgs> extends {
|
|
5
|
-
[key: string]: string;
|
|
6
|
-
} ? (args: TArgs['pathParams']) => RouteString : RouteString;
|
|
7
|
-
export type RouteString = `/${string}`;
|
|
8
|
-
export type CreateQueryCreatorOptions<TArgs extends QueryArgs> = {
|
|
9
|
-
route: RouteType<TArgs>;
|
|
10
|
-
reportProgress?: boolean;
|
|
11
|
-
responseType?: 'json';
|
|
12
|
-
withCredentials?: boolean;
|
|
13
|
-
transferCache?: {
|
|
14
|
-
includeHeaders?: string[];
|
|
15
|
-
} | boolean;
|
|
16
|
-
};
|
|
17
|
-
export type QueryCreator<TArgs extends QueryArgs> = {
|
|
18
|
-
(...features: QueryFeature<TArgs>[]): Query<TArgs>;
|
|
19
|
-
(queryConfig: QueryConfig, ...features: QueryFeature<TArgs>[]): Query<TArgs>;
|
|
20
|
-
};
|
|
21
|
-
export type QueryMethod = 'GET' | 'OPTIONS' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'TRACE' | 'CONNECT';
|
|
22
|
-
export type InternalCreateQueryCreatorOptions = {
|
|
23
|
-
method: QueryMethod;
|
|
24
|
-
client: QueryClientConfig;
|
|
25
|
-
};
|
|
26
|
-
export type QueryConfig = {
|
|
27
|
-
/** A custom id to use for this query. Only affects queries that can be cached. */
|
|
28
|
-
key?: string;
|
|
29
|
-
/**
|
|
30
|
-
* If true, the query will not be executed automatically.
|
|
31
|
-
* Does not affect mutations such as POST, PUT etc. since those are never executed automatically.
|
|
32
|
-
*/
|
|
33
|
-
onlyManualExecution?: boolean;
|
|
34
|
-
};
|
|
35
|
-
export declare const splitQueryConfig: <TArgs extends QueryArgs>(args: (QueryFeature<TArgs> | QueryConfig)[]) => {
|
|
36
|
-
features: QueryFeature<TArgs>[];
|
|
37
|
-
queryConfig: QueryConfig;
|
|
38
|
-
};
|
|
39
|
-
export declare const createQueryCreator: <TArgs extends QueryArgs>(options: CreateQueryCreatorOptions<TArgs>, internals: InternalCreateQueryCreatorOptions) => QueryCreator<TArgs>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { RuntimeError } from '@ethlete/core';
|
|
2
|
-
import { QueryMethod } from './query-creator';
|
|
3
|
-
import { QueryFeatureType } from './query-features';
|
|
4
|
-
export declare const enum RuntimeErrorCode {
|
|
5
|
-
QUERY_FEATURE_USED_MULTIPLE_TIMES = 0,
|
|
6
|
-
WITH_ARGS_QUERY_FEATURE_MISSING_BUT_ROUTE_IS_FUNCTION = 100,
|
|
7
|
-
WITH_POLLING_USED_ON_UNSUPPORTED_HTTP_METHOD = 101,
|
|
8
|
-
WITH_AUTO_REFRESH_USED_ON_UNSUPPORTED_HTTP_METHOD = 102,
|
|
9
|
-
WITH_AUTO_REFRESH_USED_IN_MANUAL_QUERY = 103,
|
|
10
|
-
COOKIE_LOGIN_TRIED_BUT_COOKIE_DISABLED = 200,
|
|
11
|
-
ENABLE_COOKIE_CALLED_WITHOUT_COOKIE_CONFIG = 201,
|
|
12
|
-
DISABLE_COOKIE_CALLED_WITHOUT_COOKIE_CONFIG = 202,
|
|
13
|
-
LOGIN_CALLED_WITHOUT_CONFIG = 203,
|
|
14
|
-
LOGIN_WITH_TOKEN_CALLED_WITHOUT_CONFIG = 204,
|
|
15
|
-
REFRESH_TOKEN_CALLED_WITHOUT_CONFIG = 205,
|
|
16
|
-
SELECT_ROLE_CALLED_WITHOUT_CONFIG = 206,
|
|
17
|
-
DEFAULT_RESPONSE_TRANSFORMER_RESPONSE_NOT_OBJECT = 207,
|
|
18
|
-
DEFAULT_RESPONSE_TRANSFORMER_RESPONSE_NOT_CONTAINING_ACCESS_TOKEN = 208,
|
|
19
|
-
DEFAULT_RESPONSE_TRANSFORMER_RESPONSE_NOT_CONTAINING_REFRESH_TOKEN = 209,
|
|
20
|
-
UNABLE_TO_DECRYPT_BEARER_TOKEN = 210,
|
|
21
|
-
BEARER_EXPIRES_IN_PROPERTY_NOT_NUMBER = 211,
|
|
22
|
-
UNCACHEABLE_REQUEST_HAS_CACHE_KEY_PARAM = 300,
|
|
23
|
-
UNCACHEABLE_REQUEST_HAS_ALLOW_CACHE_PARAM = 301,
|
|
24
|
-
PAGED_QUERY_PAGE_BIGGER_THAN_TOTAL_PAGES = 400,
|
|
25
|
-
PAGED_QUERY_NEXT_PAGE_CALLED_WITHOUT_PREVIOUS_PAGE = 401,
|
|
26
|
-
PAGED_QUERY_PREVIOUS_PAGE_CALLED_BUT_ALREADY_AT_FIRST_PAGE = 402
|
|
27
|
-
}
|
|
28
|
-
export declare const queryFeatureUsedMultipleTimes: (type: QueryFeatureType) => RuntimeError<RuntimeErrorCode.QUERY_FEATURE_USED_MULTIPLE_TIMES>;
|
|
29
|
-
export declare const withArgsQueryFeatureMissingButRouteIsFunction: () => RuntimeError<RuntimeErrorCode.WITH_ARGS_QUERY_FEATURE_MISSING_BUT_ROUTE_IS_FUNCTION>;
|
|
30
|
-
export declare const withPollingUsedOnUnsupportedHttpMethod: (method: QueryMethod) => RuntimeError<RuntimeErrorCode.WITH_POLLING_USED_ON_UNSUPPORTED_HTTP_METHOD>;
|
|
31
|
-
export declare const withAutoRefreshUsedOnUnsupportedHttpMethod: (method: QueryMethod) => RuntimeError<RuntimeErrorCode.WITH_AUTO_REFRESH_USED_ON_UNSUPPORTED_HTTP_METHOD>;
|
|
32
|
-
export declare const withAutoRefreshUsedInManualQuery: () => RuntimeError<RuntimeErrorCode.WITH_AUTO_REFRESH_USED_IN_MANUAL_QUERY>;
|
|
33
|
-
export declare const cookieLoginTriedButCookieDisabled: () => RuntimeError<RuntimeErrorCode.COOKIE_LOGIN_TRIED_BUT_COOKIE_DISABLED>;
|
|
34
|
-
export declare const enableCookieCalledWithoutCookieConfig: () => RuntimeError<RuntimeErrorCode.ENABLE_COOKIE_CALLED_WITHOUT_COOKIE_CONFIG>;
|
|
35
|
-
export declare const disableCookieCalledWithoutCookieConfig: () => RuntimeError<RuntimeErrorCode.DISABLE_COOKIE_CALLED_WITHOUT_COOKIE_CONFIG>;
|
|
36
|
-
export declare const loginCalledWithoutConfig: () => RuntimeError<RuntimeErrorCode.LOGIN_CALLED_WITHOUT_CONFIG>;
|
|
37
|
-
export declare const loginWithTokenCalledWithoutConfig: () => RuntimeError<RuntimeErrorCode.LOGIN_WITH_TOKEN_CALLED_WITHOUT_CONFIG>;
|
|
38
|
-
export declare const refreshTokenCalledWithoutConfig: () => RuntimeError<RuntimeErrorCode.REFRESH_TOKEN_CALLED_WITHOUT_CONFIG>;
|
|
39
|
-
export declare const selectRoleCalledWithoutConfig: () => RuntimeError<RuntimeErrorCode.SELECT_ROLE_CALLED_WITHOUT_CONFIG>;
|
|
40
|
-
export declare const defaultResponseTransformerResponseNotObject: (currentType: string) => RuntimeError<RuntimeErrorCode.DEFAULT_RESPONSE_TRANSFORMER_RESPONSE_NOT_OBJECT>;
|
|
41
|
-
export declare const defaultResponseTransformerResponseNotContainingAccessToken: () => RuntimeError<RuntimeErrorCode.DEFAULT_RESPONSE_TRANSFORMER_RESPONSE_NOT_CONTAINING_ACCESS_TOKEN>;
|
|
42
|
-
export declare const defaultResponseTransformerResponseNotContainingRefreshToken: () => RuntimeError<RuntimeErrorCode.DEFAULT_RESPONSE_TRANSFORMER_RESPONSE_NOT_CONTAINING_REFRESH_TOKEN>;
|
|
43
|
-
export declare const unableToDecryptBearerToken: (token: string) => RuntimeError<RuntimeErrorCode.UNABLE_TO_DECRYPT_BEARER_TOKEN>;
|
|
44
|
-
export declare const bearerExpiresInPropertyNotNumber: (expiresIn: unknown) => RuntimeError<RuntimeErrorCode.BEARER_EXPIRES_IN_PROPERTY_NOT_NUMBER>;
|
|
45
|
-
export declare const uncacheableRequestHasCacheKeyParam: (key: string) => RuntimeError<RuntimeErrorCode.UNCACHEABLE_REQUEST_HAS_CACHE_KEY_PARAM>;
|
|
46
|
-
export declare const uncacheableRequestHasAllowCacheParam: () => RuntimeError<RuntimeErrorCode.UNCACHEABLE_REQUEST_HAS_ALLOW_CACHE_PARAM>;
|
|
47
|
-
export declare const pagedQueryPageBiggerThanTotalPages: (page: number, totalPages: number) => RuntimeError<RuntimeErrorCode.PAGED_QUERY_PAGE_BIGGER_THAN_TOTAL_PAGES>;
|
|
48
|
-
export declare const pagedQueryNextPageCalledWithoutPreviousPage: () => RuntimeError<RuntimeErrorCode.PAGED_QUERY_NEXT_PAGE_CALLED_WITHOUT_PREVIOUS_PAGE>;
|
|
49
|
-
export declare const pagedQueryPreviousPageCalledButAlreadyAtFirstPage: () => RuntimeError<RuntimeErrorCode.PAGED_QUERY_PREVIOUS_PAGE_CALLED_BUT_ALREADY_AT_FIRST_PAGE>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { HttpErrorResponse, HttpEvent } from '@angular/common/http';
|
|
2
|
-
import { Signal } from '@angular/core';
|
|
3
|
-
import { QueryArgs, RequestArgs, ResponseType } from './query';
|
|
4
|
-
import { CreateQueryCreatorOptions, InternalCreateQueryCreatorOptions, QueryConfig } from './query-creator';
|
|
5
|
-
import { QueryDependencies } from './query-dependencies';
|
|
6
|
-
import { QueryExecute } from './query-execute';
|
|
7
|
-
import { QueryState } from './query-state';
|
|
8
|
-
import { QueryArgsReset, QueryFeatureFlags } from './query-utils';
|
|
9
|
-
export declare const enum QueryFeatureType {
|
|
10
|
-
WithArgs = "withArgs",
|
|
11
|
-
WithLogging = "withLogging",
|
|
12
|
-
WithErrorHandling = "withErrorHandling",
|
|
13
|
-
WithSuccessHandling = "withSuccessHandling",
|
|
14
|
-
WithPolling = "withPolling",
|
|
15
|
-
WithAutoRefresh = "withAutoRefresh"
|
|
16
|
-
}
|
|
17
|
-
export type QueryFeatureContext<TArgs extends QueryArgs> = {
|
|
18
|
-
state: QueryState<TArgs>;
|
|
19
|
-
queryConfig: QueryConfig;
|
|
20
|
-
creatorConfig: CreateQueryCreatorOptions<TArgs>;
|
|
21
|
-
creatorInternals: InternalCreateQueryCreatorOptions;
|
|
22
|
-
execute: QueryExecute<TArgs>;
|
|
23
|
-
deps: QueryDependencies;
|
|
24
|
-
flags: QueryFeatureFlags;
|
|
25
|
-
};
|
|
26
|
-
export type QueryFeatureFn<TArgs extends QueryArgs> = (context: QueryFeatureContext<TArgs>) => void;
|
|
27
|
-
export type QueryFeature<TArgs extends QueryArgs> = {
|
|
28
|
-
type: QueryFeatureType;
|
|
29
|
-
fn: (context: QueryFeatureContext<TArgs>) => void;
|
|
30
|
-
};
|
|
31
|
-
export declare const withArgs: <TArgs extends QueryArgs>(args: () => NoInfer<RequestArgs<TArgs>> | QueryArgsReset | null) => QueryFeature<TArgs>;
|
|
32
|
-
export declare const withPolling: <TArgs extends QueryArgs>(options: {
|
|
33
|
-
interval: number;
|
|
34
|
-
executeInitially?: boolean;
|
|
35
|
-
}) => QueryFeature<TArgs>;
|
|
36
|
-
export declare const withLogging: <TArgs extends QueryArgs>(options: {
|
|
37
|
-
logFn: (v: HttpEvent<ResponseType<TArgs>> | null) => void;
|
|
38
|
-
}) => QueryFeature<TArgs>;
|
|
39
|
-
export declare const withErrorHandling: <TArgs extends QueryArgs>(options: {
|
|
40
|
-
handler: (e: HttpErrorResponse) => void;
|
|
41
|
-
}) => QueryFeature<TArgs>;
|
|
42
|
-
export declare const withSuccessHandling: <TArgs extends QueryArgs>(options: {
|
|
43
|
-
handler: (data: NonNullable<ResponseType<TArgs>>) => void;
|
|
44
|
-
}) => QueryFeature<TArgs>;
|
|
45
|
-
export declare const withAutoRefresh: <TArgs extends QueryArgs>(options: {
|
|
46
|
-
signalChanges: Signal<unknown>[];
|
|
47
|
-
ignoreOnlyManualExecution?: boolean;
|
|
48
|
-
}) => QueryFeature<TArgs>;
|