@orpc/pinia-colada 2.0.0-beta.46 → 2.0.0-beta.48

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/dist/key.mjs ADDED
@@ -0,0 +1,29 @@
1
+ import { RPCJsonSerializer } from "@orpc/client";
2
+ import { stringifyJSON } from "@orpc/shared";
3
+ const defaultSerializer = /* @__PURE__ */ new RPCJsonSerializer();
4
+
5
+ export function generateOperationKey(path, options = {}) {
6
+ return [
7
+ ...options.prefix !== undefined ? [options.prefix] : [],
8
+ path,
9
+ {
10
+ ...options.input !== undefined ? serializeInput(options.serializer ?? defaultSerializer, options.input) : {},
11
+ ...options.type !== undefined ? { type: options.type } : {},
12
+ ...options.fnOptions !== undefined ? { fnOptions: options.fnOptions } : {}
13
+ }
14
+ ];
15
+ }
16
+ function serializeInput(serializer, input) {
17
+ const { json, meta } = serializer.serializeJson(input);
18
+ if (!meta?.length) {
19
+ return { input: json };
20
+ }
21
+ const inputMeta = {};
22
+ for (const [type, ...segments] of meta) {
23
+ (inputMeta[stringifyJSON(segments)] ??= []).push(type);
24
+ }
25
+ return {
26
+ input: json,
27
+ inputMeta
28
+ };
29
+ }
@@ -0,0 +1,7 @@
1
+ import type { Promisable } from "@orpc/shared";
2
+ import type { UseQueryFnContext } from "./types.mjs";
3
+ /**
4
+ * A Pinia Colada query function that publishes each streamed chunk to the
5
+ * cache entry as it arrives, replacing the previous value.
6
+ */
7
+ export declare function liveQuery<T>(queryFn: (context: UseQueryFnContext) => Promisable<AsyncIterable<T>>): (context: UseQueryFnContext) => Promise<T>;
@@ -0,0 +1,24 @@
1
+ import { stringifyJSON } from "@orpc/shared";
2
+
3
+ export function liveQuery(queryFn) {
4
+ return async (context) => {
5
+ const { entry, signal } = context;
6
+ const stream = await queryFn(context);
7
+ let last;
8
+ for await (const chunk of stream) {
9
+ if (signal.aborted) {
10
+ throw signal.reason;
11
+ }
12
+ last = { chunk };
13
+ entry.state.value = {
14
+ status: "success",
15
+ data: chunk,
16
+ error: null
17
+ };
18
+ }
19
+ if (!last) {
20
+ throw new TypeError(`Live query for ${stringifyJSON(entry.key)} did not yield any data. Ensure the query function returns an AsyncIterable with at least one chunk.`);
21
+ }
22
+ return last.chunk;
23
+ };
24
+ }
@@ -0,0 +1,55 @@
1
+ import type { AnyNestedClient, ClientContext, InferClientContext, InferClientError } from "@orpc/client";
2
+ import type { AnySchema, ErrorMap, InferSchemaInput, InferSchemaOutput, Meta, MetaPlugin, ORPCErrorFromErrorMap, RouterContract } from "@orpc/contract";
3
+ import type { ThrowableError } from "@orpc/shared";
4
+ import type { OperationKeyBaseOptions } from "./key.mjs";
5
+ import type { RouterUtilsPlugin } from "./plugin.mjs";
6
+ import type { ProcedureUtilsOptions } from "./procedure-utils.mjs";
7
+ export type PiniaColadaMetaOptions<
8
+ TClientContext extends ClientContext,
9
+ TInput,
10
+ TOutput,
11
+ TError
12
+ > = Omit<ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>, keyof OperationKeyBaseOptions>;
13
+ export interface PiniaColadaMetaPlugin<
14
+ TInputSchema extends AnySchema,
15
+ TOutputSchema extends AnySchema,
16
+ TErrorMap extends ErrorMap
17
+ > extends MetaPlugin<TInputSchema, TOutputSchema, TErrorMap> {
18
+ name: "~pinia-colada";
19
+ }
20
+ /**
21
+ * Define base Pinia Colada options and interceptors on a procedure contract.
22
+ * Applied multiple times, later options are spread-merged with higher priority
23
+ * while interceptors are concatenated. A key explicitly set to `undefined`
24
+ * resets the value from earlier applications instead of merging.
25
+ *
26
+ * Apply them to router utils with {@link ContractOptionsUtilsPlugin}.
27
+ *
28
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
29
+ */
30
+ export declare function piniaColada<
31
+ TInputSchema extends AnySchema,
32
+ TOutputSchema extends AnySchema,
33
+ TErrorMap extends ErrorMap
34
+ >(options: PiniaColadaMetaOptions<ClientContext, InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>, ORPCErrorFromErrorMap<TErrorMap> | ThrowableError>): PiniaColadaMetaPlugin<TInputSchema, TOutputSchema, TErrorMap>;
35
+ export declare function getPiniaColadaMeta(procedureOrLazy: {
36
+ "~orpc": {
37
+ meta: Meta;
38
+ };
39
+ }): PiniaColadaMetaOptions<ClientContext, unknown, unknown, ThrowableError> | undefined;
40
+ /**
41
+ * Router utils plugin that applies base options defined via {@link piniaColada}
42
+ * on the given router contract. Meta options act as the base layer: options defined
43
+ * on the utils override them, and utils interceptors run after meta interceptors.
44
+ *
45
+ * The contract shape must match the client the utils are created from,
46
+ * so pass the root router contract when utils paths start from the root.
47
+ *
48
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
49
+ */
50
+ export declare class ContractOptionsUtilsPlugin<T extends AnyNestedClient = AnyNestedClient> implements RouterUtilsPlugin<T> {
51
+ private readonly contract;
52
+ readonly name = "~contract-options";
53
+ constructor(contract: RouterContract);
54
+ initProcedureOptions(path: string[], options: ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>): ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>;
55
+ }
package/dist/meta.mjs ADDED
@@ -0,0 +1,37 @@
1
+ import { getRouterContract, ProcedureContract } from "@orpc/contract";
2
+ import { mergeProcedureUtilsOptions } from "./procedure-utils.mjs";
3
+
4
+ export function piniaColada(options) {
5
+ return {
6
+ name: "~pinia-colada",
7
+ init(meta) {
8
+ const current = meta["~pinia-colada"];
9
+ return {
10
+ ...meta,
11
+ "~pinia-colada": current ? mergeProcedureUtilsOptions(current, options) : options
12
+ };
13
+ }
14
+ };
15
+ }
16
+ export function getPiniaColadaMeta(procedureOrLazy) {
17
+ return procedureOrLazy["~orpc"].meta["~pinia-colada"];
18
+ }
19
+
20
+ export class ContractOptionsUtilsPlugin {
21
+ contract;
22
+ name = "~contract-options";
23
+ constructor(contract) {
24
+ this.contract = contract;
25
+ }
26
+ initProcedureOptions(path, options) {
27
+ const procedure = getRouterContract(this.contract, path);
28
+ if (!(procedure instanceof ProcedureContract)) {
29
+ return options;
30
+ }
31
+ const base = getPiniaColadaMeta(procedure);
32
+ if (!base) {
33
+ return options;
34
+ }
35
+ return mergeProcedureUtilsOptions(base, options);
36
+ }
37
+ }
@@ -0,0 +1,46 @@
1
+ import type { AnyNestedClient, InferClientContext, InferClientError } from "@orpc/client";
2
+ import type { OrderablePlugin } from "@orpc/shared";
3
+ import type { ProcedureUtilsOptions } from "./procedure-utils.mjs";
4
+ import type { RouterUtilsOptions } from "./router-utils.mjs";
5
+ export interface RouterUtilsPlugin<T extends AnyNestedClient> extends OrderablePlugin {
6
+ /**
7
+ * Initializes the router utils plugin and returns updated router utils options.
8
+ * Called once per plugin instance during composition.
9
+ *
10
+ * This method allows plugins to wrap, extend, or transform router utils options,
11
+ * such as interceptors or configuration.
12
+ *
13
+ * @param options - The current router utils options from previous plugins or base configuration
14
+ * @returns Transformed router utils options with this plugin's modifications applied
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * init(options) {
19
+ * return {
20
+ * ...options,
21
+ * mutationInterceptors: [...(options.mutationInterceptors ?? []), myInterceptor]
22
+ * }
23
+ * }
24
+ * ```
25
+ */
26
+ init?(options: RouterUtilsOptions<T>): RouterUtilsOptions<T>;
27
+ /**
28
+ * Initializes per-procedure router utils options and returns updated options.
29
+ * Called once per procedure utils instance during composition.
30
+ *
31
+ * This method allows plugins to customize merged procedure-specific defaults,
32
+ * such as query or mutation options, for the current path.
33
+ *
34
+ * @param path - The current procedure path
35
+ * @param options - The merged procedure utils options for the current procedure
36
+ * @returns Transformed procedure utils options with this plugin's modifications applied
37
+ */
38
+ initProcedureOptions?(path: string[], options: ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>): ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>;
39
+ }
40
+ export declare class CompositeRouterUtilsPlugin<T extends AnyNestedClient> implements RouterUtilsPlugin<T> {
41
+ protected readonly plugins: RouterUtilsPlugin<T>[];
42
+ readonly name = "~composite";
43
+ constructor(plugins?: RouterUtilsPlugin<T>[]);
44
+ init(options: RouterUtilsOptions<T>): RouterUtilsOptions<T>;
45
+ initProcedureOptions(path: string[], options: ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>): ProcedureUtilsOptions<InferClientContext<T>, any, any, InferClientError<T>>;
46
+ }
@@ -0,0 +1,25 @@
1
+ import { sortPlugins } from "@orpc/shared";
2
+ export class CompositeRouterUtilsPlugin {
3
+ plugins;
4
+ name = "~composite";
5
+ constructor(plugins = []) {
6
+ this.plugins = plugins;
7
+ this.plugins = sortPlugins(plugins);
8
+ }
9
+ init(options) {
10
+ for (const plugin of this.plugins) {
11
+ if (plugin.init) {
12
+ options = plugin.init(options);
13
+ }
14
+ }
15
+ return options;
16
+ }
17
+ initProcedureOptions(path, options) {
18
+ for (const plugin of this.plugins) {
19
+ if (plugin.initProcedureOptions) {
20
+ options = plugin.initProcedureOptions(path, options);
21
+ }
22
+ }
23
+ return options;
24
+ }
25
+ }
@@ -0,0 +1,245 @@
1
+ import type { Client, ClientContext } from "@orpc/client";
2
+ import type { Interceptor, MaybeOptionalOptions, PromiseWithError } from "@orpc/shared";
3
+ import type { _EmptyObject, EntryKeyTagged, UseInfiniteQueryData, UseInfiniteQueryFnContext } from "@pinia/colada";
4
+ import type { OperationKeyBaseOptions } from "./key.mjs";
5
+ import type { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, MutationKeyOptions, MutationOptionsIn, MutationOptionsOut, OperationContext, QueryKeyOptions, QueryOptionsIn, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsOut, UseMutationFnContext, UseQueryFnContext } from "./types.mjs";
6
+ import { SharedUtils } from "./shared-utils.mjs";
7
+ export interface ProcedureUtilsQueryInterceptorOptions<
8
+ TClientContext extends ClientContext,
9
+ TInput
10
+ > {
11
+ path: string[];
12
+ context: TClientContext & OperationContext;
13
+ input: TInput;
14
+ fnContext: UseQueryFnContext;
15
+ }
16
+ export type ProcedureUtilsQueryInterceptor<
17
+ TClientContext extends ClientContext,
18
+ TInput,
19
+ TOutput,
20
+ TError
21
+ > = Interceptor<ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
22
+ export interface ProcedureUtilsStreamedInterceptorOptions<
23
+ TClientContext extends ClientContext,
24
+ TInput
25
+ > extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {}
26
+ export type ProcedureUtilsStreamedInterceptor<
27
+ TClientContext extends ClientContext,
28
+ TInput,
29
+ TOutput,
30
+ TError
31
+ > = Interceptor<ProcedureUtilsStreamedInterceptorOptions<TClientContext, TInput>, PromiseWithError<InferStreamedQueryOutput<TOutput>, TError>>;
32
+ export interface ProcedureUtilsLiveInterceptorOptions<
33
+ TClientContext extends ClientContext,
34
+ TInput
35
+ > extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {}
36
+ export type ProcedureUtilsLiveInterceptor<
37
+ TClientContext extends ClientContext,
38
+ TInput,
39
+ TOutput,
40
+ TError
41
+ > = Interceptor<ProcedureUtilsLiveInterceptorOptions<TClientContext, TInput>, PromiseWithError<InferLiveQueryOutput<TOutput>, TError>>;
42
+ export interface ProcedureUtilsInfiniteInterceptorOptions<
43
+ TClientContext extends ClientContext,
44
+ TInput
45
+ > {
46
+ path: string[];
47
+ context: TClientContext & OperationContext;
48
+ input: TInput;
49
+ fnContext: UseInfiniteQueryFnContext<any, any, any, any>;
50
+ }
51
+ export type ProcedureUtilsInfiniteInterceptor<
52
+ TClientContext extends ClientContext,
53
+ TInput,
54
+ TOutput,
55
+ TError
56
+ > = Interceptor<ProcedureUtilsInfiniteInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
57
+ export interface ProcedureUtilsMutationInterceptorOptions<
58
+ TClientContext extends ClientContext,
59
+ TInput
60
+ > {
61
+ path: string[];
62
+ context: TClientContext & OperationContext;
63
+ input: TInput;
64
+ fnContext: UseMutationFnContext;
65
+ }
66
+ export type ProcedureUtilsMutationInterceptor<
67
+ TClientContext extends ClientContext,
68
+ TInput,
69
+ TOutput,
70
+ TError
71
+ > = Interceptor<ProcedureUtilsMutationInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
72
+ /**
73
+ * Can be partial options for spread-merged options,
74
+ * or a function that receives per-call options and returns overridden this.options.
75
+ */
76
+ export type ProcedureUtilsModifier<T extends object> = Partial<T> | ((options: T) => T);
77
+ export interface ProcedureUtilsOptions<
78
+ TClientContext extends ClientContext,
79
+ TInput,
80
+ TOutput,
81
+ TError
82
+ > extends OperationKeyBaseOptions {
83
+ /**
84
+ * Key options modifier for .queryKey and .queryOptions
85
+ * Can be partial options or a function that receives per-call options and returns override this.options.
86
+ */
87
+ queryKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
88
+ /**
89
+ * Interceptors that intercept query inside .queryOptions, guaranteed to be executed.
90
+ */
91
+ queryInterceptors?: ProcedureUtilsQueryInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
92
+ /**
93
+ * Options modifier for .queryOptions
94
+ * Can be partial options or a function that receives per-call options and returns override this.options.
95
+ */
96
+ queryOptions?: ProcedureUtilsModifier<QueryOptionsIn<TClientContext, TInput, TOutput, TError, TOutput | undefined>> | undefined;
97
+ /**
98
+ * Key options modifier for .streamedKey and .streamedOptions
99
+ * Can be partial options or a function that receives per-call options and returns override this.options.
100
+ */
101
+ streamedKey?: ProcedureUtilsModifier<StreamedKeyOptions<TInput>> | undefined;
102
+ /**
103
+ * Interceptors that intercept query inside .streamedOptions, guaranteed to be executed.
104
+ */
105
+ streamedInterceptors?: ProcedureUtilsStreamedInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
106
+ /**
107
+ * Options modifier for .streamedOptions
108
+ * Can be partial options or a function that receives per-call options and returns override this.options.
109
+ */
110
+ streamedOptions?: ProcedureUtilsModifier<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, InferStreamedQueryOutput<TOutput> | undefined>> | undefined;
111
+ /**
112
+ * Key options modifier for .liveKey and .liveOptions
113
+ * Can be partial options or a function that receives per-call options and returns override this.options.
114
+ */
115
+ liveKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
116
+ /**
117
+ * Interceptors that intercept query inside .liveOptions, guaranteed to be executed.
118
+ */
119
+ liveInterceptors?: ProcedureUtilsLiveInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
120
+ /**
121
+ * Options modifier for .liveOptions
122
+ * Can be partial options or a function that receives per-call options and returns override this.options.
123
+ */
124
+ liveOptions?: ProcedureUtilsModifier<QueryOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, InferLiveQueryOutput<TOutput> | undefined>> | undefined;
125
+ /**
126
+ * Key options modifier for .infiniteKey and .infiniteOptions
127
+ * Can be partial options or a function that receives per-call options and returns override this.options.
128
+ */
129
+ infiniteKey?: ProcedureUtilsModifier<InfiniteKeyOptions<TInput, unknown>> | undefined;
130
+ /**
131
+ * Interceptors that intercept query inside .infiniteOptions, guaranteed to be executed.
132
+ */
133
+ infiniteInterceptors?: ProcedureUtilsInfiniteInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
134
+ /**
135
+ * Options modifier for .infiniteOptions
136
+ * Can be partial options or a function that receives per-call options and returns override this.options.
137
+ */
138
+ infiniteOptions?: ProcedureUtilsModifier<InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, unknown, UseInfiniteQueryData<TOutput, unknown> | undefined>> | undefined;
139
+ /**
140
+ * Key options modifier for .mutationKey and .mutationOptions
141
+ * Can be partial options or a function that receives per-call options and returns override this.options.
142
+ */
143
+ mutationKey?: ProcedureUtilsModifier<MutationKeyOptions<TInput>> | undefined;
144
+ /**
145
+ * Interceptors that intercept mutation inside .mutationOptions, guaranteed to be executed.
146
+ */
147
+ mutationInterceptors?: ProcedureUtilsMutationInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
148
+ /**
149
+ * Options modifier for .mutationOptions
150
+ * Can be partial options or a function that receives per-call options and returns override this.options.
151
+ */
152
+ mutationOptions?: ProcedureUtilsModifier<MutationOptionsIn<TClientContext, TInput, TOutput, TError, Record<any, any>>> | undefined;
153
+ }
154
+ export declare function isProcedureUtilsOptions(value: unknown): value is ProcedureUtilsOptions<any, any, any, any>;
155
+ /**
156
+ * Merge two procedure utils options where `override` takes priority.
157
+ * A key explicitly set to `undefined` in `override` resets the base value.
158
+ * When both sides define a key, interceptors are concatenated (base ones run first) and
159
+ * modifiers are combined so that, for object values, per-call options beat `override`,
160
+ * which beats `base`. A function modifier receives the merged options and its result wins.
161
+ */
162
+ export declare function mergeProcedureUtilsOptions<
163
+ TClientContext extends ClientContext,
164
+ TInput,
165
+ TOutput,
166
+ TError
167
+ >(base: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>, override: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>): ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
168
+ export declare class ProcedureUtils<
169
+ TClientContext extends ClientContext,
170
+ TInput,
171
+ TOutput,
172
+ TError
173
+ > extends SharedUtils<TInput> {
174
+ protected readonly options: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
175
+ /**
176
+ * Calling corresponding procedure client
177
+ *
178
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#calling-procedure-clients | Pinia Colada Integration - Calling Procedure Clients}
179
+ */
180
+ call: Client<TClientContext, TInput, TOutput, TError>;
181
+ constructor(path: string[], client: Client<TClientContext, TInput, TOutput, TError>, options?: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>);
182
+ /**
183
+ * Generate a **full matching** key for useQuery/...
184
+ *
185
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
186
+ */
187
+ queryKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<TOutput, TError>;
188
+ /**
189
+ * Generate options used for useQuery/...
190
+ *
191
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#query-options-utility | Pinia Colada Integration - Query Options Utility}
192
+ */
193
+ queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): NoInfer<QueryOptionsOut<TOutput, TError, UInitialData>>;
194
+ /**
195
+ * Generate a **full matching** key for [Streamed Query Options](https://orpc.dev/docs/integrations/pinia-colada#streamed-query-options-utility).
196
+ *
197
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
198
+ */
199
+ streamedKey(...rest: MaybeOptionalOptions<StreamedKeyOptions<TInput>>): EntryKeyTagged<InferStreamedQueryOutput<TOutput>, TError>;
200
+ /**
201
+ * Configure queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
202
+ * The resulting data is an array of chunks, and each new chunk is appended as it arrives.
203
+ * Works with `useQuery` and any other API that accepts query options.
204
+ */
205
+ streamedOptions<UInitialData extends InferStreamedQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<StreamedOptionsOut<InferStreamedQueryOutput<TOutput>, TError, UInitialData>>;
206
+ /**
207
+ * Generate a **full matching** key for [Live Query Options](https://orpc.dev/docs/integrations/pinia-colada#live-query-options-utility).
208
+ *
209
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
210
+ */
211
+ liveKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<InferLiveQueryOutput<TOutput>, TError>;
212
+ /**
213
+ * Configure live queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
214
+ * Unlike `.streamedOptions` which accumulates chunks, live queries replace the entire result with each new chunk received.
215
+ * Works with `useQuery` and any other API that accepts query options.
216
+ */
217
+ liveOptions<UInitialData extends InferLiveQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<QueryOptionsOut<InferLiveQueryOutput<TOutput>, TError, UInitialData>>;
218
+ /**
219
+ * Generate a **full matching** key for useInfiniteQuery/...
220
+ *
221
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
222
+ */
223
+ infiniteKey<UPageParam>(optionsIn: InfiniteKeyOptions<TInput, UPageParam>): EntryKeyTagged<UseInfiniteQueryData<TOutput, UPageParam>, TError>;
224
+ /**
225
+ * Generate options used for useInfiniteQuery/...
226
+ *
227
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#infinite-query-options-utility | Pinia Colada Integration - Infinite Query Options Utility}
228
+ */
229
+ infiniteOptions<
230
+ UPageParam,
231
+ UInitialData extends UseInfiniteQueryData<TOutput, UPageParam> | undefined = undefined
232
+ >(optionsIn: InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, UPageParam, UInitialData>): NoInfer<InfiniteOptionsOut<TOutput, TError, UPageParam, UInitialData>>;
233
+ /**
234
+ * Generate a **full matching** key for useMutation/...
235
+ *
236
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
237
+ */
238
+ mutationKey(...rest: MaybeOptionalOptions<MutationKeyOptions<TInput>>): MutationOptionsOut<TInput, TOutput, TError, _EmptyObject>["key"];
239
+ /**
240
+ * Generate options used for useMutation/...
241
+ *
242
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#mutation-options | Pinia Colada Integration - Mutation Options}
243
+ */
244
+ mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): NoInfer<MutationOptionsOut<TInput, TOutput, TError, UMutationContext>>;
245
+ }