@orpc/vue-colada 0.0.0-next.fea68c1 → 0.0.0-next.ff68fdb
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/README.md +4 -2
- package/dist/index.d.mts +55 -0
- package/dist/index.d.ts +55 -0
- package/dist/{index.js → index.mjs} +12 -28
- package/package.json +7 -12
- package/dist/src/general-utils.d.ts +0 -7
- package/dist/src/index.d.ts +0 -8
- package/dist/src/key.d.ts +0 -6
- package/dist/src/procedure-utils.d.ts +0 -10
- package/dist/src/router-utils.d.ts +0 -12
- package/dist/src/types.d.ts +0 -25
- package/dist/src/utils.d.ts +0 -7
package/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<div align="center">
|
2
|
-
<image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 />
|
2
|
+
<image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
|
3
3
|
</div>
|
4
4
|
|
5
5
|
<h1></h1>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
- **Contract-First Development 📜**: (Optional) Define your API contract upfront and implement it with confidence.
|
33
33
|
- **Exceptional Developer Experience ✨**: Enjoy a streamlined workflow with robust typing and clear, in-code documentation.
|
34
34
|
- **Multi-Runtime Support 🌍**: Run your code seamlessly on Cloudflare, Deno, Bun, Node.js, and more.
|
35
|
-
- **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue), Pinia Colada, and more.
|
35
|
+
- **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
36
36
|
- **Server Actions ⚡️**: Fully compatible with React Server Actions on Next.js, TanStack Start, and more.
|
37
37
|
- **Standard Schema Support 🗂️**: Effortlessly work with Zod, Valibot, ArkType, and others right out of the box.
|
38
38
|
- **Fast & Lightweight 💨**: Built on native APIs across all runtimes – optimized for speed and efficiency.
|
@@ -55,6 +55,8 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
55
55
|
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
56
56
|
- [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
|
57
57
|
- [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
|
58
|
+
- [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
|
59
|
+
- [@orpc/svelte-query](https://www.npmjs.com/package/@orpc/svelte-query): Integration with [Svelte Query](https://tanstack.com/query/latest/docs/framework/svelte/overview).
|
58
60
|
- [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
|
59
61
|
- [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
|
60
62
|
- [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
|
package/dist/index.d.mts
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
import { ClientContext, Client, NestedClient } from '@orpc/client';
|
2
|
+
import { EntryKey, UseQueryOptions, UseMutationOptions, _EmptyObject } from '@pinia/colada';
|
3
|
+
import { AnyFunction, SetOptional, MaybeOptionalOptions } from '@orpc/shared';
|
4
|
+
import { MaybeRef } from 'vue';
|
5
|
+
|
6
|
+
interface BuildKeyOptions<TInput> {
|
7
|
+
input?: TInput;
|
8
|
+
}
|
9
|
+
declare function buildKey<TInput>(path: string[], options?: BuildKeyOptions<TInput>): EntryKey;
|
10
|
+
|
11
|
+
interface GeneralUtils<TInput> {
|
12
|
+
key(options?: BuildKeyOptions<TInput>): EntryKey;
|
13
|
+
}
|
14
|
+
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
15
|
+
|
16
|
+
type MaybeRefDeep<T> = MaybeRef<T extends AnyFunction ? T : T extends object ? {
|
17
|
+
[K in keyof T]: MaybeRefDeep<T[K]>;
|
18
|
+
} : T>;
|
19
|
+
type UseQueryFnContext = Parameters<UseQueryOptions<any>['query']>[0];
|
20
|
+
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TInitialData extends TOutput | undefined> = (undefined extends TInput ? {
|
21
|
+
input?: MaybeRefDeep<TInput>;
|
22
|
+
} : {
|
23
|
+
input: MaybeRefDeep<TInput>;
|
24
|
+
}) & (Record<never, never> extends TClientContext ? {
|
25
|
+
context?: MaybeRefDeep<TClientContext>;
|
26
|
+
} : {
|
27
|
+
context: MaybeRefDeep<TClientContext>;
|
28
|
+
}) & SetOptional<QueryOptions<TOutput, TError, TInitialData>, 'key' | 'query'>;
|
29
|
+
type QueryOptions<TOutput, TError extends Error, TInitialData extends TOutput | undefined> = UseQueryOptions<TOutput, TError, TInitialData>;
|
30
|
+
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TMutationContext extends Record<any, any>> = (Record<never, never> extends TClientContext ? {
|
31
|
+
context?: MaybeRefDeep<TClientContext>;
|
32
|
+
} : {
|
33
|
+
context: MaybeRefDeep<TClientContext>;
|
34
|
+
}) & SetOptional<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, 'mutation'>;
|
35
|
+
type MutationOptions<TInput, TOutput, TError extends Error, TMutationContext extends Record<any, any>> = UseMutationOptions<TOutput, TInput, TError, TMutationContext>;
|
36
|
+
|
37
|
+
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
38
|
+
call: Client<TClientContext, TInput, TOutput, TError>;
|
39
|
+
queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): QueryOptions<TOutput, TError, UInitialData>;
|
40
|
+
mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
41
|
+
}
|
42
|
+
interface CreateProcedureUtilsOptions {
|
43
|
+
path: string[];
|
44
|
+
}
|
45
|
+
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, options: CreateProcedureUtilsOptions): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
46
|
+
|
47
|
+
type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
48
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
49
|
+
} & GeneralUtils<unknown>;
|
50
|
+
interface CreateRouterUtilsOptions {
|
51
|
+
path?: string[];
|
52
|
+
}
|
53
|
+
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
54
|
+
|
55
|
+
export { type BuildKeyOptions, type CreateProcedureUtilsOptions, type CreateRouterUtilsOptions, type GeneralUtils, type MaybeRefDeep, type MutationOptions, type MutationOptionsIn, type ProcedureUtils, type QueryOptions, type QueryOptionsIn, type RouterUtils, type UseQueryFnContext, buildKey, createGeneralUtils, createRouterUtils as createORPCVueColadaUtils, createProcedureUtils, createRouterUtils };
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
import { ClientContext, Client, NestedClient } from '@orpc/client';
|
2
|
+
import { EntryKey, UseQueryOptions, UseMutationOptions, _EmptyObject } from '@pinia/colada';
|
3
|
+
import { AnyFunction, SetOptional, MaybeOptionalOptions } from '@orpc/shared';
|
4
|
+
import { MaybeRef } from 'vue';
|
5
|
+
|
6
|
+
interface BuildKeyOptions<TInput> {
|
7
|
+
input?: TInput;
|
8
|
+
}
|
9
|
+
declare function buildKey<TInput>(path: string[], options?: BuildKeyOptions<TInput>): EntryKey;
|
10
|
+
|
11
|
+
interface GeneralUtils<TInput> {
|
12
|
+
key(options?: BuildKeyOptions<TInput>): EntryKey;
|
13
|
+
}
|
14
|
+
declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
15
|
+
|
16
|
+
type MaybeRefDeep<T> = MaybeRef<T extends AnyFunction ? T : T extends object ? {
|
17
|
+
[K in keyof T]: MaybeRefDeep<T[K]>;
|
18
|
+
} : T>;
|
19
|
+
type UseQueryFnContext = Parameters<UseQueryOptions<any>['query']>[0];
|
20
|
+
type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TInitialData extends TOutput | undefined> = (undefined extends TInput ? {
|
21
|
+
input?: MaybeRefDeep<TInput>;
|
22
|
+
} : {
|
23
|
+
input: MaybeRefDeep<TInput>;
|
24
|
+
}) & (Record<never, never> extends TClientContext ? {
|
25
|
+
context?: MaybeRefDeep<TClientContext>;
|
26
|
+
} : {
|
27
|
+
context: MaybeRefDeep<TClientContext>;
|
28
|
+
}) & SetOptional<QueryOptions<TOutput, TError, TInitialData>, 'key' | 'query'>;
|
29
|
+
type QueryOptions<TOutput, TError extends Error, TInitialData extends TOutput | undefined> = UseQueryOptions<TOutput, TError, TInitialData>;
|
30
|
+
type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error, TMutationContext extends Record<any, any>> = (Record<never, never> extends TClientContext ? {
|
31
|
+
context?: MaybeRefDeep<TClientContext>;
|
32
|
+
} : {
|
33
|
+
context: MaybeRefDeep<TClientContext>;
|
34
|
+
}) & SetOptional<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, 'mutation'>;
|
35
|
+
type MutationOptions<TInput, TOutput, TError extends Error, TMutationContext extends Record<any, any>> = UseMutationOptions<TOutput, TInput, TError, TMutationContext>;
|
36
|
+
|
37
|
+
interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
38
|
+
call: Client<TClientContext, TInput, TOutput, TError>;
|
39
|
+
queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): QueryOptions<TOutput, TError, UInitialData>;
|
40
|
+
mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): MutationOptions<TInput, TOutput, TError, UMutationContext>;
|
41
|
+
}
|
42
|
+
interface CreateProcedureUtilsOptions {
|
43
|
+
path: string[];
|
44
|
+
}
|
45
|
+
declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, options: CreateProcedureUtilsOptions): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
46
|
+
|
47
|
+
type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
48
|
+
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
49
|
+
} & GeneralUtils<unknown>;
|
50
|
+
interface CreateRouterUtilsOptions {
|
51
|
+
path?: string[];
|
52
|
+
}
|
53
|
+
declare function createRouterUtils<T extends NestedClient<any>>(client: T, options?: CreateRouterUtilsOptions): RouterUtils<T>;
|
54
|
+
|
55
|
+
export { type BuildKeyOptions, type CreateProcedureUtilsOptions, type CreateRouterUtilsOptions, type GeneralUtils, type MaybeRefDeep, type MutationOptions, type MutationOptionsIn, type ProcedureUtils, type QueryOptions, type QueryOptionsIn, type RouterUtils, type UseQueryFnContext, buildKey, createGeneralUtils, createRouterUtils as createORPCVueColadaUtils, createProcedureUtils, createRouterUtils };
|
@@ -1,6 +1,7 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import { RPCJsonSerializer } from '@orpc/client/standard';
|
2
|
+
import { stringifyJSON, isObject } from '@orpc/shared';
|
3
|
+
import { isRef, computed } from 'vue';
|
4
|
+
|
4
5
|
function buildKey(path, options) {
|
5
6
|
if (options?.input === void 0) {
|
6
7
|
return path;
|
@@ -12,7 +13,6 @@ function buildKey(path, options) {
|
|
12
13
|
];
|
13
14
|
}
|
14
15
|
|
15
|
-
// src/general-utils.ts
|
16
16
|
function createGeneralUtils(path) {
|
17
17
|
return {
|
18
18
|
key(options) {
|
@@ -21,12 +21,6 @@ function createGeneralUtils(path) {
|
|
21
21
|
};
|
22
22
|
}
|
23
23
|
|
24
|
-
// src/procedure-utils.ts
|
25
|
-
import { computed } from "vue";
|
26
|
-
|
27
|
-
// src/utils.ts
|
28
|
-
import { isObject } from "@orpc/shared";
|
29
|
-
import { isRef } from "vue";
|
30
24
|
function unrefDeep(value) {
|
31
25
|
if (isRef(value)) {
|
32
26
|
return unrefDeep(value.value);
|
@@ -43,20 +37,19 @@ function unrefDeep(value) {
|
|
43
37
|
return value;
|
44
38
|
}
|
45
39
|
|
46
|
-
|
47
|
-
function createProcedureUtils(client, path) {
|
40
|
+
function createProcedureUtils(client, options) {
|
48
41
|
return {
|
49
42
|
call: client,
|
50
43
|
queryOptions(...[{ input, context, ...rest } = {}]) {
|
51
44
|
return {
|
52
|
-
key: computed(() => buildKey(path, { input: unrefDeep(input) })),
|
45
|
+
key: computed(() => buildKey(options.path, { input: unrefDeep(input) })),
|
53
46
|
query: ({ signal }) => client(unrefDeep(input), { signal, context: unrefDeep(context) }),
|
54
47
|
...rest
|
55
48
|
};
|
56
49
|
},
|
57
50
|
mutationOptions(...[{ context, ...rest } = {}]) {
|
58
51
|
return {
|
59
|
-
key: (input) => buildKey(path, { input }),
|
52
|
+
key: (input) => buildKey(options.path, { input }),
|
60
53
|
mutation: (input) => client(input, { context: unrefDeep(context) }),
|
61
54
|
...rest
|
62
55
|
};
|
@@ -64,10 +57,10 @@ function createProcedureUtils(client, path) {
|
|
64
57
|
};
|
65
58
|
}
|
66
59
|
|
67
|
-
|
68
|
-
|
60
|
+
function createRouterUtils(client, options = {}) {
|
61
|
+
const path = options.path ?? [];
|
69
62
|
const generalUtils = createGeneralUtils(path);
|
70
|
-
const procedureUtils = createProcedureUtils(client, path);
|
63
|
+
const procedureUtils = createProcedureUtils(client, { path });
|
71
64
|
const recursive = new Proxy({
|
72
65
|
...generalUtils,
|
73
66
|
...procedureUtils
|
@@ -77,7 +70,7 @@ function createRouterUtils(client, path = []) {
|
|
77
70
|
if (typeof prop !== "string") {
|
78
71
|
return value;
|
79
72
|
}
|
80
|
-
const nextUtils = createRouterUtils(client[prop], [...path, prop]);
|
73
|
+
const nextUtils = createRouterUtils(client[prop], { ...options, path: [...path, prop] });
|
81
74
|
if (typeof value !== "function") {
|
82
75
|
return nextUtils;
|
83
76
|
}
|
@@ -91,13 +84,4 @@ function createRouterUtils(client, path = []) {
|
|
91
84
|
return recursive;
|
92
85
|
}
|
93
86
|
|
94
|
-
|
95
|
-
var createORPCVueColadaUtils = createRouterUtils;
|
96
|
-
export {
|
97
|
-
buildKey,
|
98
|
-
createGeneralUtils,
|
99
|
-
createORPCVueColadaUtils,
|
100
|
-
createProcedureUtils,
|
101
|
-
createRouterUtils
|
102
|
-
};
|
103
|
-
//# sourceMappingURL=index.js.map
|
87
|
+
export { buildKey, createGeneralUtils, createRouterUtils as createORPCVueColadaUtils, createProcedureUtils, createRouterUtils };
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/vue-colada",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next.
|
4
|
+
"version": "0.0.0-next.ff68fdb",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -19,17 +19,12 @@
|
|
19
19
|
],
|
20
20
|
"exports": {
|
21
21
|
".": {
|
22
|
-
"types": "./dist/
|
23
|
-
"import": "./dist/index.
|
24
|
-
"default": "./dist/index.
|
25
|
-
},
|
26
|
-
"./🔒/*": {
|
27
|
-
"types": "./dist/src/*.d.ts"
|
22
|
+
"types": "./dist/index.d.mts",
|
23
|
+
"import": "./dist/index.mjs",
|
24
|
+
"default": "./dist/index.mjs"
|
28
25
|
}
|
29
26
|
},
|
30
27
|
"files": [
|
31
|
-
"!**/*.map",
|
32
|
-
"!**/*.tsbuildinfo",
|
33
28
|
"dist"
|
34
29
|
],
|
35
30
|
"peerDependencies": {
|
@@ -37,14 +32,14 @@
|
|
37
32
|
"vue": ">=3.3.0"
|
38
33
|
},
|
39
34
|
"dependencies": {
|
40
|
-
"@orpc/client": "0.0.0-next.
|
41
|
-
"@orpc/shared": "0.0.0-next.
|
35
|
+
"@orpc/client": "0.0.0-next.ff68fdb",
|
36
|
+
"@orpc/shared": "0.0.0-next.ff68fdb"
|
42
37
|
},
|
43
38
|
"devDependencies": {
|
44
39
|
"pinia": "^2.3.0"
|
45
40
|
},
|
46
41
|
"scripts": {
|
47
|
-
"build": "
|
42
|
+
"build": "unbuild",
|
48
43
|
"build:watch": "pnpm run build --watch",
|
49
44
|
"type:check": "tsc -b"
|
50
45
|
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { EntryKey } from '@pinia/colada';
|
2
|
-
import type { BuildKeyOptions } from './key';
|
3
|
-
export interface GeneralUtils<TInput> {
|
4
|
-
key(options?: BuildKeyOptions<TInput>): EntryKey;
|
5
|
-
}
|
6
|
-
export declare function createGeneralUtils<TInput>(path: string[]): GeneralUtils<TInput>;
|
7
|
-
//# sourceMappingURL=general-utils.d.ts.map
|
package/dist/src/index.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { createRouterUtils } from './router-utils';
|
2
|
-
export * from './general-utils';
|
3
|
-
export * from './key';
|
4
|
-
export * from './procedure-utils';
|
5
|
-
export * from './router-utils';
|
6
|
-
export * from './types';
|
7
|
-
export declare const createORPCVueColadaUtils: typeof createRouterUtils;
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/key.d.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { Client, ClientContext } from '@orpc/client';
|
2
|
-
import type { MaybeOptionalOptions } from '@orpc/shared';
|
3
|
-
import type { MutationOptions, MutationOptionsIn, QueryOptions, QueryOptionsIn } from './types';
|
4
|
-
export interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> {
|
5
|
-
call: Client<TClientContext, TInput, TOutput, TError>;
|
6
|
-
queryOptions(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError>>): QueryOptions<TOutput, TError>;
|
7
|
-
mutationOptions(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError>>): MutationOptions<TInput, TOutput, TError>;
|
8
|
-
}
|
9
|
-
export declare function createProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError extends Error>(client: Client<TClientContext, TInput, TOutput, TError>, path: string[]): ProcedureUtils<TClientContext, TInput, TOutput, TError>;
|
10
|
-
//# sourceMappingURL=procedure-utils.d.ts.map
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { Client, NestedClient } from '@orpc/client';
|
2
|
-
import { type GeneralUtils } from './general-utils';
|
3
|
-
import { type ProcedureUtils } from './procedure-utils';
|
4
|
-
export type RouterUtils<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtils<UClientContext, UInput, UOutput, UError> & GeneralUtils<UInput> : {
|
5
|
-
[K in keyof T]: T[K] extends NestedClient<any> ? RouterUtils<T[K]> : never;
|
6
|
-
} & GeneralUtils<unknown>;
|
7
|
-
/**
|
8
|
-
* @param client - Any kind of oRPC clients: `createRouterClient`, `createORPCClient`, ...
|
9
|
-
* @param path - The base path for query key, when it it will be prefix to all keys
|
10
|
-
*/
|
11
|
-
export declare function createRouterUtils<T extends NestedClient<any>>(client: T, path?: string[]): RouterUtils<T>;
|
12
|
-
//# sourceMappingURL=router-utils.d.ts.map
|
package/dist/src/types.d.ts
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
import type { ClientContext } from '@orpc/client';
|
2
|
-
import type { AnyFunction, SetOptional } from '@orpc/shared';
|
3
|
-
import type { UseMutationOptions, UseQueryOptions } from '@pinia/colada';
|
4
|
-
import type { MaybeRef } from 'vue';
|
5
|
-
export type MaybeRefDeep<T> = MaybeRef<T extends AnyFunction ? T : T extends object ? {
|
6
|
-
[K in keyof T]: MaybeRefDeep<T[K]>;
|
7
|
-
} : T>;
|
8
|
-
export type UseQueryFnContext = Parameters<UseQueryOptions<any>['query']>[0];
|
9
|
-
export type QueryOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> = (undefined extends TInput ? {
|
10
|
-
input?: MaybeRefDeep<TInput>;
|
11
|
-
} : {
|
12
|
-
input: MaybeRefDeep<TInput>;
|
13
|
-
}) & (Record<never, never> extends TClientContext ? {
|
14
|
-
context?: MaybeRefDeep<TClientContext>;
|
15
|
-
} : {
|
16
|
-
context: MaybeRefDeep<TClientContext>;
|
17
|
-
}) & SetOptional<UseQueryOptions<TOutput, TError>, 'key' | 'query'>;
|
18
|
-
export type QueryOptions<TOutput, TError extends Error> = UseQueryOptions<TOutput, TError>;
|
19
|
-
export type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError extends Error> = (Record<never, never> extends TClientContext ? {
|
20
|
-
context?: MaybeRefDeep<TClientContext>;
|
21
|
-
} : {
|
22
|
-
context: MaybeRefDeep<TClientContext>;
|
23
|
-
}) & SetOptional<UseMutationOptions<TOutput, TInput, TError>, 'mutation'>;
|
24
|
-
export type MutationOptions<TInput, TOutput, TError extends Error> = UseMutationOptions<TOutput, TInput, TError>;
|
25
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/utils.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { Ref } from 'vue';
|
2
|
-
import { type AnyFunction } from '@orpc/shared';
|
3
|
-
export type UnrefDeep<T> = T extends Ref<infer U> ? UnrefDeep<U> : T extends AnyFunction ? T : T extends object ? {
|
4
|
-
[K in keyof T]: UnrefDeep<T[K]>;
|
5
|
-
} : T;
|
6
|
-
export declare function unrefDeep<T>(value: T): UnrefDeep<T>;
|
7
|
-
//# sourceMappingURL=utils.d.ts.map
|