@zenstackhq/swr 2.3.3 → 2.4.1
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 +4 -4
- package/runtime/index.d.mts +3 -3
- package/runtime/index.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/swr",
|
|
3
3
|
"displayName": "ZenStack plugin for generating SWR hooks",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "ZenStack plugin for generating SWR hooks",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"repository": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"ts-morph": "^16.0.0",
|
|
39
39
|
"ts-pattern": "^4.3.0",
|
|
40
40
|
"upper-case-first": "^2.0.2",
|
|
41
|
-
"@zenstackhq/runtime": "2.
|
|
42
|
-
"@zenstackhq/sdk": "2.
|
|
41
|
+
"@zenstackhq/runtime": "2.4.1",
|
|
42
|
+
"@zenstackhq/sdk": "2.4.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"swr": "2.2.5 - 2"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/tmp": "^0.2.3",
|
|
53
53
|
"nock": "^13.3.6",
|
|
54
54
|
"react": "18.2.0",
|
|
55
|
-
"@zenstackhq/testtools": "2.
|
|
55
|
+
"@zenstackhq/testtools": "2.4.1"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"clean": "rimraf dist",
|
package/runtime/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as swr_mutation from 'swr/mutation';
|
|
2
|
+
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { ModelMeta } from '@zenstackhq/runtime/cross';
|
|
4
5
|
import { SWRConfiguration, Fetcher, SWRResponse } from 'swr';
|
|
5
6
|
import { ScopedMutator } from 'swr/_internal';
|
|
6
7
|
import { SWRInfiniteConfiguration, SWRInfiniteFetcher, SWRInfiniteResponse } from 'swr/infinite';
|
|
7
|
-
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
8
8
|
|
|
9
9
|
type Enumerable<T> = T | Array<T>;
|
|
10
10
|
type _TupleToUnion<T> = T extends (infer E)[] ? E : never;
|
|
@@ -166,7 +166,7 @@ type GetNextArgs<Args, Result> = (pageIndex: number, previousPageData: Result |
|
|
|
166
166
|
* @returns SWR infinite query response
|
|
167
167
|
*/
|
|
168
168
|
declare function useInfiniteModelQuery<Args, Result, Error = unknown>(model: string, operation: string, getNextArgs: GetNextArgs<Args, any>, options?: InfiniteQueryOptions<Result, Error>): SWRInfiniteResponse<Result, Error>;
|
|
169
|
-
declare function useModelMutation<Args, Result, CheckReadBack extends boolean = boolean>(model: string, method: 'POST' | 'PUT' | 'DELETE', operation: string, modelMeta: ModelMeta, options?: MutationOptions<CheckReadBack extends true ? Result | undefined : Result, unknown, Args>, checkReadBack?: CheckReadBack):
|
|
169
|
+
declare function useModelMutation<Args, Result, CheckReadBack extends boolean = boolean>(model: string, method: 'POST' | 'PUT' | 'DELETE', operation: string, modelMeta: ModelMeta, options?: MutationOptions<CheckReadBack extends true ? Result | undefined : Result, unknown, Args>, checkReadBack?: CheckReadBack): swr_mutation.SWRMutationResponse<CheckReadBack extends true ? Result | undefined : Result, unknown, string, Args>;
|
|
170
170
|
/**
|
|
171
171
|
* Makes a mutation request.
|
|
172
172
|
*
|
package/runtime/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as swr_mutation from 'swr/mutation';
|
|
2
|
+
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
2
3
|
import * as react from 'react';
|
|
3
4
|
import { ModelMeta } from '@zenstackhq/runtime/cross';
|
|
4
5
|
import { SWRConfiguration, Fetcher, SWRResponse } from 'swr';
|
|
5
6
|
import { ScopedMutator } from 'swr/_internal';
|
|
6
7
|
import { SWRInfiniteConfiguration, SWRInfiniteFetcher, SWRInfiniteResponse } from 'swr/infinite';
|
|
7
|
-
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
8
8
|
|
|
9
9
|
type Enumerable<T> = T | Array<T>;
|
|
10
10
|
type _TupleToUnion<T> = T extends (infer E)[] ? E : never;
|
|
@@ -166,7 +166,7 @@ type GetNextArgs<Args, Result> = (pageIndex: number, previousPageData: Result |
|
|
|
166
166
|
* @returns SWR infinite query response
|
|
167
167
|
*/
|
|
168
168
|
declare function useInfiniteModelQuery<Args, Result, Error = unknown>(model: string, operation: string, getNextArgs: GetNextArgs<Args, any>, options?: InfiniteQueryOptions<Result, Error>): SWRInfiniteResponse<Result, Error>;
|
|
169
|
-
declare function useModelMutation<Args, Result, CheckReadBack extends boolean = boolean>(model: string, method: 'POST' | 'PUT' | 'DELETE', operation: string, modelMeta: ModelMeta, options?: MutationOptions<CheckReadBack extends true ? Result | undefined : Result, unknown, Args>, checkReadBack?: CheckReadBack):
|
|
169
|
+
declare function useModelMutation<Args, Result, CheckReadBack extends boolean = boolean>(model: string, method: 'POST' | 'PUT' | 'DELETE', operation: string, modelMeta: ModelMeta, options?: MutationOptions<CheckReadBack extends true ? Result | undefined : Result, unknown, Args>, checkReadBack?: CheckReadBack): swr_mutation.SWRMutationResponse<CheckReadBack extends true ? Result | undefined : Result, unknown, string, Args>;
|
|
170
170
|
/**
|
|
171
171
|
* Makes a mutation request.
|
|
172
172
|
*
|