@orpc/pinia-colada 2.0.0-beta.48 → 2.0.0-beta.49
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 -4
- package/dist/contract-utils.d.ts +37 -0
- package/dist/contract-utils.js +42 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +14 -0
- package/dist/key.d.ts +45 -0
- package/dist/key.js +47 -0
- package/dist/live-query.d.ts +8 -0
- package/dist/live-query.js +38 -0
- package/dist/meta.d.ts +42 -0
- package/dist/meta.js +55 -0
- package/dist/plugin.d.ts +46 -0
- package/dist/plugin.js +25 -0
- package/dist/procedure-utils.d.ts +190 -0
- package/dist/procedure-utils.js +399 -0
- package/dist/router-utils.d.ts +67 -0
- package/dist/router-utils.js +69 -0
- package/dist/shared-utils.d.ts +13 -0
- package/dist/shared-utils.js +21 -0
- package/dist/ssr.d.ts +22 -0
- package/dist/ssr.js +24 -0
- package/dist/stream-query.d.ts +42 -0
- package/dist/stream-query.js +59 -0
- package/dist/types.d.ts +80 -0
- package/dist/types.js +7 -0
- package/package.json +31 -33
- package/dist/contract-utils.d.mts +0 -35
- package/dist/contract-utils.mjs +0 -23
- package/dist/index.d.mts +0 -19
- package/dist/index.mjs +0 -11
- package/dist/key.d.mts +0 -57
- package/dist/key.mjs +0 -29
- package/dist/live-query.d.mts +0 -7
- package/dist/live-query.mjs +0 -24
- package/dist/meta.d.mts +0 -55
- package/dist/meta.mjs +0 -37
- package/dist/plugin.d.mts +0 -46
- package/dist/plugin.mjs +0 -25
- package/dist/procedure-utils.d.mts +0 -245
- package/dist/procedure-utils.mjs +0 -394
- package/dist/router-utils.d.mts +0 -57
- package/dist/router-utils.mjs +0 -51
- package/dist/shared-utils.d.mts +0 -13
- package/dist/shared-utils.mjs +0 -17
- package/dist/stream-query.d.mts +0 -30
- package/dist/stream-query.mjs +0 -45
- package/dist/types.d.mts +0 -125
- package/dist/types.mjs +0 -2
package/dist/types.d.mts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { ClientContext } from "@orpc/client";
|
|
2
|
-
import type { DefineInfiniteQueryOptions, DefineInfiniteQueryOptionsTagged, DefineMutationOptionsTagged, DefineQueryOptions, DefineQueryOptionsTagged, EntryKey, UseInfiniteQueryData, UseMutationOptions, UseMutationOptionsGlobal, UseQueryOptions } from "@pinia/colada";
|
|
3
|
-
import type { SerializableStreamedQueryOptions } from "./stream-query.mjs";
|
|
4
|
-
export type InferStreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
|
|
5
|
-
export type InferLiveQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U : never;
|
|
6
|
-
export type UseQueryFnContext = Parameters<UseQueryOptions<any>["query"]>[0];
|
|
7
|
-
/**
|
|
8
|
-
* The context passed to the mutation function, including the merged
|
|
9
|
-
* `UseMutationGlobalContext` values provided by a global `onMutate` hook.
|
|
10
|
-
*/
|
|
11
|
-
export type UseMutationFnContext = Parameters<NonNullable<UseMutationOptionsGlobal["onSuccess"]>>[2];
|
|
12
|
-
/**
|
|
13
|
-
* The symbol under which Pinia Colada utils attach operation details
|
|
14
|
-
* (key and operation type) to the client context.
|
|
15
|
-
*
|
|
16
|
-
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#client-context | Pinia Colada Integration - Client Context}
|
|
17
|
-
*/
|
|
18
|
-
export declare const OPERATION_CONTEXT_SYMBOL: unique symbol;
|
|
19
|
-
export type OperationType = "query" | "streamed" | "live" | "infinite" | "mutation";
|
|
20
|
-
/**
|
|
21
|
-
* A client context automatically populated by Pinia Colada utils,
|
|
22
|
-
* exposing the operation key and type of the calling operation.
|
|
23
|
-
*
|
|
24
|
-
* @see {@link https://orpc.dev/docs/integrations/pinia-colada#client-context | Pinia Colada Integration - Client Context}
|
|
25
|
-
*/
|
|
26
|
-
export interface OperationContext {
|
|
27
|
-
[OPERATION_CONTEXT_SYMBOL]?: {
|
|
28
|
-
key: EntryKey;
|
|
29
|
-
type: OperationType;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export type QueryKeyOptions<TInput> = (undefined extends TInput ? {
|
|
33
|
-
input?: TInput;
|
|
34
|
-
} : {
|
|
35
|
-
input: TInput;
|
|
36
|
-
}) | {
|
|
37
|
-
key: EntryKey;
|
|
38
|
-
};
|
|
39
|
-
export type QueryOptionsIn<
|
|
40
|
-
TClientContext extends ClientContext,
|
|
41
|
-
TInput,
|
|
42
|
-
TOutput,
|
|
43
|
-
TError,
|
|
44
|
-
TInitialData extends TOutput | undefined
|
|
45
|
-
> = (undefined extends TInput ? {
|
|
46
|
-
input?: TInput;
|
|
47
|
-
} : {
|
|
48
|
-
input: TInput;
|
|
49
|
-
}) & (object extends TClientContext ? {
|
|
50
|
-
context?: TClientContext | undefined;
|
|
51
|
-
} : {
|
|
52
|
-
context: TClientContext;
|
|
53
|
-
}) & Omit<DefineQueryOptions<TOutput, TError, TInitialData>, "key" | "query"> & Partial<Pick<DefineQueryOptions<TOutput, TError, TInitialData>, "key" | "query">>;
|
|
54
|
-
export type QueryOptionsOut<
|
|
55
|
-
TOutput,
|
|
56
|
-
TError,
|
|
57
|
-
TInitialData extends TOutput | undefined
|
|
58
|
-
> = DefineQueryOptionsTagged<TOutput, TError, TInitialData>;
|
|
59
|
-
export type StreamedKeyOptions<TInput> = (undefined extends TInput ? {
|
|
60
|
-
input?: TInput;
|
|
61
|
-
} : {
|
|
62
|
-
input: TInput;
|
|
63
|
-
}) & {
|
|
64
|
-
fnOptions?: SerializableStreamedQueryOptions | undefined;
|
|
65
|
-
} | {
|
|
66
|
-
key: EntryKey;
|
|
67
|
-
};
|
|
68
|
-
export type StreamedOptionsIn<
|
|
69
|
-
TClientContext extends ClientContext,
|
|
70
|
-
TInput,
|
|
71
|
-
TOutput,
|
|
72
|
-
TError,
|
|
73
|
-
TInitialData extends TOutput | undefined
|
|
74
|
-
> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TInitialData> & {
|
|
75
|
-
fnOptions?: SerializableStreamedQueryOptions | undefined;
|
|
76
|
-
};
|
|
77
|
-
export type StreamedOptionsOut<
|
|
78
|
-
TOutput,
|
|
79
|
-
TError,
|
|
80
|
-
TInitialData extends TOutput | undefined
|
|
81
|
-
> = QueryOptionsOut<TOutput, TError, TInitialData>;
|
|
82
|
-
export type InfiniteKeyOptions<
|
|
83
|
-
TInput,
|
|
84
|
-
TPageParam
|
|
85
|
-
> = Pick<InfiniteOptionsIn<any, TInput, any, any, TPageParam, any>, "input" | "initialPageParam"> | {
|
|
86
|
-
key: EntryKey;
|
|
87
|
-
};
|
|
88
|
-
export type InfiniteOptionsIn<
|
|
89
|
-
TClientContext extends ClientContext,
|
|
90
|
-
TInput,
|
|
91
|
-
TOutput,
|
|
92
|
-
TError,
|
|
93
|
-
TPageParam,
|
|
94
|
-
TInitialData extends UseInfiniteQueryData<TOutput, TPageParam> | undefined
|
|
95
|
-
> = {
|
|
96
|
-
input: (pageParam: TPageParam) => TInput;
|
|
97
|
-
} & (object extends TClientContext ? {
|
|
98
|
-
context?: TClientContext | undefined;
|
|
99
|
-
} : {
|
|
100
|
-
context: TClientContext;
|
|
101
|
-
}) & Omit<DefineInfiniteQueryOptions<TOutput, TError, TPageParam, TInitialData>, "key" | "query"> & Partial<Pick<DefineInfiniteQueryOptions<TOutput, TError, TPageParam, TInitialData>, "key" | "query">>;
|
|
102
|
-
export type InfiniteOptionsOut<
|
|
103
|
-
TOutput,
|
|
104
|
-
TError,
|
|
105
|
-
TPageParam,
|
|
106
|
-
TInitialData extends UseInfiniteQueryData<TOutput, TPageParam> | undefined
|
|
107
|
-
> = DefineInfiniteQueryOptionsTagged<TOutput, TError, TPageParam, TInitialData>;
|
|
108
|
-
export type MutationKeyOptions<TInput> = Pick<MutationOptionsIn<any, TInput, any, any, any>, "key">;
|
|
109
|
-
export type MutationOptionsIn<
|
|
110
|
-
TClientContext extends ClientContext,
|
|
111
|
-
TInput,
|
|
112
|
-
TOutput,
|
|
113
|
-
TError,
|
|
114
|
-
TMutationContext extends Record<any, any>
|
|
115
|
-
> = (object extends TClientContext ? {
|
|
116
|
-
context?: TClientContext | undefined;
|
|
117
|
-
} : {
|
|
118
|
-
context: TClientContext;
|
|
119
|
-
}) & Omit<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, "mutation"> & Partial<Pick<UseMutationOptions<TOutput, TInput, TError, TMutationContext>, "mutation">>;
|
|
120
|
-
export type MutationOptionsOut<
|
|
121
|
-
TInput,
|
|
122
|
-
TOutput,
|
|
123
|
-
TError,
|
|
124
|
-
TMutationContext extends Record<any, any>
|
|
125
|
-
> = DefineMutationOptionsTagged<TOutput, TInput, TError, TMutationContext>;
|
package/dist/types.mjs
DELETED