@vladimirdev635/gql-client-react 0.0.109 → 0.0.110
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/index.d.ts +4 -3
- package/index.js +2 -1
- package/package.json +4 -4
- package/types.d.ts +6 -3
- package/use-lazy-operation/hook.d.ts +2 -2
- package/use-lazy-operation/index.d.ts +1 -1
- package/use-lazy-operation/types.d.ts +1 -1
- package/useOperation.d.ts +2 -1
- package/useSubscription.d.ts +2 -1
- package/useSubscription.jsx +1 -1
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { type OperationLoadingState, type OperationSuccessState, type OperationFailureState, type OperationState, useOperation, } from './useOperation.jsx';
|
|
2
|
-
export { type LazyOperationInitialState, type LazyOperationState, type
|
|
3
|
-
export { useSubscription } from './useSubscription.jsx';
|
|
1
|
+
export { type OperationLoadingState, type OperationSuccessState, type OperationFailureState, type OperationState, type UseOperationHookReturnType, useOperation, } from './useOperation.jsx';
|
|
2
|
+
export { type LazyOperationInitialState, type LazyOperationState, type LazyOperationExecuteReturnType, type UseLazyOperationHookReturnType, useLazyOperation, } from './use-lazy-operation/index.js';
|
|
3
|
+
export { type UseSubscriptionHookReturnType, useSubscription, } from './useSubscription.jsx';
|
|
4
|
+
export * as types from './types.js';
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useOperation, } from './useOperation.jsx';
|
|
2
2
|
export { useLazyOperation, } from './use-lazy-operation/index.js';
|
|
3
|
-
export { useSubscription } from './useSubscription.jsx';
|
|
3
|
+
export { useSubscription, } from './useSubscription.jsx';
|
|
4
|
+
export * as types from './types.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vladimirdev635/gql-client-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"oxlint": "^1.79.0",
|
|
40
40
|
"typescript": "<7.0.0",
|
|
41
41
|
"typescript-language-server": "^5.3.0",
|
|
42
|
-
"vitest": "^3.2.4"
|
|
42
|
+
"vitest": "^3.2.4",
|
|
43
|
+
"zod": ">=3.25.76"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
46
|
"object-hash": ">=3.0.0",
|
|
46
|
-
"react": "*"
|
|
47
|
-
"zod": ">=4.0.5"
|
|
47
|
+
"react": "*"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
50
|
"@rollup/rollup-linux-x64-gnu": "4.9.5"
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface SchemaForInput<T> {
|
|
2
|
+
parse(value: T): any;
|
|
3
|
+
}
|
|
4
|
+
export interface SchemaForOutput<T> {
|
|
5
|
+
parse(value: any): T;
|
|
6
|
+
}
|
|
4
7
|
interface BaseOperation<V, R> {
|
|
5
8
|
name: string;
|
|
6
9
|
document: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IExecutor, OperationResult, OperationVariables, RequestContext, SyncOperation } from '../types.js';
|
|
2
|
-
import {
|
|
3
|
-
export declare function useLazyOperation<
|
|
2
|
+
import type { UseLazyOperationHookReturnType } from './types.js';
|
|
3
|
+
export declare function useLazyOperation<TExecutor extends IExecutor<TRequestContext>, TRequestContext extends RequestContext, TOperation extends SyncOperation<unknown, unknown>>(executor: TExecutor, operation: TOperation): UseLazyOperationHookReturnType<TRequestContext, OperationVariables<TOperation>, OperationResult<TOperation>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { useLazyOperation } from './hook.js';
|
|
2
|
-
export type { LazyOperationInitialState, LazyOperationState, LazyOperationExecuteReturnType,
|
|
2
|
+
export type { LazyOperationInitialState, LazyOperationState, LazyOperationExecuteReturnType, UseLazyOperationHookReturnType, } from './types.js';
|
|
@@ -5,7 +5,7 @@ export interface LazyOperationInitialState {
|
|
|
5
5
|
}
|
|
6
6
|
export type LazyOperationState<TResult> = OperationState<TResult> | LazyOperationInitialState;
|
|
7
7
|
export type LazyOperationExecuteReturnType<TResult> = Promise<OperationSuccessState<TResult> | OperationFailureState>;
|
|
8
|
-
export type
|
|
8
|
+
export type UseLazyOperationHookReturnType<TRequestContext extends RequestContext, TVariables, TResult> = [
|
|
9
9
|
(variables: TVariables, requestContext: TRequestContext) => LazyOperationExecuteReturnType<TResult>,
|
|
10
10
|
{
|
|
11
11
|
state: LazyOperationState<TResult>;
|
package/useOperation.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export interface OperationFailureState {
|
|
|
10
10
|
error: Error;
|
|
11
11
|
}
|
|
12
12
|
export type OperationState<TResult> = OperationLoadingState | OperationSuccessState<TResult> | OperationFailureState;
|
|
13
|
-
export
|
|
13
|
+
export type UseOperationHookReturnType<TResult> = OperationState<TResult>;
|
|
14
|
+
export declare function useOperation<TExecutor extends IExecutor<TRequestContext>, TRequestContext extends RequestContext, TOperation extends SyncOperation<unknown, unknown>>(executor: TExecutor, operation: TOperation, variables: OperationVariables<TOperation>, requestContext: TRequestContext): UseOperationHookReturnType<OperationResult<TOperation>>;
|
package/useSubscription.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { IExecutor, OperationResult, OperationVariables, RequestContext, SubOpAsyncIterable, SubscriptionOperation } from './types.js';
|
|
2
2
|
import { type OperationState } from './useOperation.jsx';
|
|
3
|
-
export
|
|
3
|
+
export type UseSubscriptionHookReturnType<TResult> = OperationState<SubOpAsyncIterable<TResult>>;
|
|
4
|
+
export declare function useSubscription<TExecutor extends IExecutor<TRequestContext>, TRequestContext extends RequestContext, TOperation extends SubscriptionOperation<unknown, unknown>>(executor: TExecutor, operation: TOperation, variables: OperationVariables<TOperation>, requestContext: TRequestContext): UseSubscriptionHookReturnType<OperationResult<TOperation>>;
|
package/useSubscription.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
2
1
|
import hash from 'object-hash';
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { loadingState } from './loading-state.js';
|
|
4
4
|
export function useSubscription(executor, operation, variables, requestContext) {
|
|
5
5
|
const [state, setState] = useState(loadingState);
|