@orpc/pinia-colada 2.0.0-beta.49 → 2.0.0-beta.51

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/meta.js CHANGED
@@ -1,55 +1,53 @@
1
- import { getRouterContract, ProcedureContract } from '@orpc/contract';
2
- import { mergeProcedureUtilsOptions } from './procedure-utils.js';
1
+ import { mergeProcedureUtilsOptions } from "./procedure-utils.js";
2
+ import { ProcedureContract, getRouterContract } from "@orpc/contract";
3
+ // src/meta.ts
3
4
  /**
4
- * Define base Pinia Colada options and interceptors on a procedure contract.
5
- * Applied multiple times, later options are spread-merged with higher priority
6
- * while interceptors are concatenated. A key explicitly set to `undefined`
7
- * resets the value from earlier applications instead of merging.
8
- *
9
- * Apply them to router utils with {@link ContractOptionsUtilsPlugin}.
10
- *
11
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
12
- */
13
- export function piniaColada(options) {
14
- return {
15
- name: '~pinia-colada',
16
- init(meta) {
17
- const current = meta['~pinia-colada'];
18
- return {
19
- ...meta,
20
- '~pinia-colada': current ? mergeProcedureUtilsOptions(current, options) : options,
21
- };
22
- },
23
- };
5
+ * Define base Pinia Colada options and interceptors on a procedure contract.
6
+ * Applied multiple times, later options are spread-merged with higher priority
7
+ * while interceptors are concatenated. A key explicitly set to `undefined`
8
+ * resets the value from earlier applications instead of merging.
9
+ *
10
+ * Apply them to router utils with {@link ContractOptionsUtilsPlugin}.
11
+ *
12
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
13
+ */
14
+ function piniaColada(options) {
15
+ return {
16
+ name: "~pinia-colada",
17
+ init(meta) {
18
+ const current = meta["~pinia-colada"];
19
+ return {
20
+ ...meta,
21
+ "~pinia-colada": current ? mergeProcedureUtilsOptions(current, options) : options
22
+ };
23
+ }
24
+ };
24
25
  }
25
- export function getPiniaColadaMeta(procedureOrLazy) {
26
- return procedureOrLazy['~orpc'].meta['~pinia-colada'];
26
+ function getPiniaColadaMeta(procedureOrLazy) {
27
+ return procedureOrLazy["~orpc"].meta["~pinia-colada"];
27
28
  }
28
29
  /**
29
- * Router utils plugin that applies base options defined via {@link piniaColada}
30
- * on the given router contract. Meta options act as the base layer: options defined
31
- * on the utils override them, and utils interceptors run after meta interceptors.
32
- *
33
- * The contract shape must match the client the utils are created from,
34
- * so pass the root router contract when utils paths start from the root.
35
- *
36
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
37
- */
38
- export class ContractOptionsUtilsPlugin {
39
- contract;
40
- name = '~contract-options';
41
- constructor(contract) {
42
- this.contract = contract;
43
- }
44
- initProcedureOptions(path, options) {
45
- const procedure = getRouterContract(this.contract, path);
46
- if (!(procedure instanceof ProcedureContract)) {
47
- return options;
48
- }
49
- const base = getPiniaColadaMeta(procedure);
50
- if (!base) {
51
- return options;
52
- }
53
- return mergeProcedureUtilsOptions(base, options);
54
- }
55
- }
30
+ * Router utils plugin that applies base options defined via {@link piniaColada}
31
+ * on the given router contract. Meta options act as the base layer: options defined
32
+ * on the utils override them, and utils interceptors run after meta interceptors.
33
+ *
34
+ * The contract shape must match the client the utils are created from,
35
+ * so pass the root router contract when utils paths start from the root.
36
+ *
37
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#contract-options-plugin | Pinia Colada Integration - Contract Options Plugin}
38
+ */
39
+ var ContractOptionsUtilsPlugin = class {
40
+ contract;
41
+ name = "~contract-options";
42
+ constructor(contract) {
43
+ this.contract = contract;
44
+ }
45
+ initProcedureOptions(path, options) {
46
+ const procedure = getRouterContract(this.contract, path);
47
+ if (!(procedure instanceof ProcedureContract)) return options;
48
+ const base = getPiniaColadaMeta(procedure);
49
+ if (!base) return options;
50
+ return mergeProcedureUtilsOptions(base, options);
51
+ }
52
+ };
53
+ export { ContractOptionsUtilsPlugin, getPiniaColadaMeta, piniaColada };
package/dist/plugin.d.ts CHANGED
@@ -1,46 +1,39 @@
1
- import type { AnyNestedClient, InferClientContext, InferClientError } from '@orpc/client';
2
- import type { OrderablePlugin } from '@orpc/shared';
3
- import type { ProcedureUtilsOptions } from './procedure-utils.ts';
4
- import type { RouterUtilsOptions } from './router-utils.ts';
1
+ import { ProcedureUtilsOptions } from "./procedure-utils.js";
2
+ import { RouterUtilsOptions } from "./router-utils.js";
3
+ import { OrderablePlugin } from "@orpc/shared";
4
+ import { AnyNestedClient, InferClientContext, InferClientError } from "@orpc/client";
5
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
- }
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
+ }
package/dist/plugin.js CHANGED
@@ -1,25 +1,19 @@
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
- }
1
+ import { sortPlugins } from "@orpc/shared";
2
+ // src/plugin.ts
3
+ var CompositeRouterUtilsPlugin = class {
4
+ plugins;
5
+ name = "~composite";
6
+ constructor(plugins = []) {
7
+ this.plugins = plugins;
8
+ this.plugins = sortPlugins(plugins);
9
+ }
10
+ init(options) {
11
+ for (const plugin of this.plugins) if (plugin.init) options = plugin.init(options);
12
+ return options;
13
+ }
14
+ initProcedureOptions(path, options) {
15
+ for (const plugin of this.plugins) if (plugin.initProcedureOptions) options = plugin.initProcedureOptions(path, options);
16
+ return options;
17
+ }
18
+ };
19
+ export { CompositeRouterUtilsPlugin };
@@ -1,34 +1,32 @@
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.ts';
5
- import { SharedUtils } from './shared-utils.ts';
6
- import type { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, MutationKeyOptions, MutationOptionsIn, MutationOptionsOut, OperationContext, QueryKeyOptions, QueryOptionsIn, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsOut, UseMutationFnContext, UseQueryFnContext } from './types.ts';
1
+ import { OperationKeyBaseOptions } from "./key.js";
2
+ import { SharedUtils } from "./shared-utils.js";
3
+ import { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, MutationKeyOptions, MutationOptionsIn, MutationOptionsOut, OperationContext, QueryKeyOptions, QueryOptionsIn, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsOut, UseMutationFnContext, UseQueryFnContext } from "./types.js";
4
+ import { Interceptor, MaybeOptionalOptions, PromiseWithError } from "@orpc/shared";
5
+ import { Client, ClientContext } from "@orpc/client";
6
+ import { EntryKeyTagged, UseInfiniteQueryData, UseInfiniteQueryFnContext, _EmptyObject } from "@pinia/colada";
7
7
  export interface ProcedureUtilsQueryInterceptorOptions<TClientContext extends ClientContext, TInput> {
8
- path: string[];
9
- context: TClientContext & OperationContext;
10
- input: TInput;
11
- fnContext: UseQueryFnContext;
8
+ path: string[];
9
+ context: TClientContext & OperationContext;
10
+ input: TInput;
11
+ fnContext: UseQueryFnContext;
12
12
  }
13
13
  export type ProcedureUtilsQueryInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
14
- export interface ProcedureUtilsStreamedInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {
15
- }
14
+ export interface ProcedureUtilsStreamedInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {}
16
15
  export type ProcedureUtilsStreamedInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsStreamedInterceptorOptions<TClientContext, TInput>, PromiseWithError<InferStreamedQueryOutput<TOutput>, TError>>;
17
- export interface ProcedureUtilsLiveInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {
18
- }
16
+ export interface ProcedureUtilsLiveInterceptorOptions<TClientContext extends ClientContext, TInput> extends ProcedureUtilsQueryInterceptorOptions<TClientContext, TInput> {}
19
17
  export type ProcedureUtilsLiveInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsLiveInterceptorOptions<TClientContext, TInput>, PromiseWithError<InferLiveQueryOutput<TOutput>, TError>>;
20
18
  export interface ProcedureUtilsInfiniteInterceptorOptions<TClientContext extends ClientContext, TInput> {
21
- path: string[];
22
- context: TClientContext & OperationContext;
23
- input: TInput;
24
- fnContext: UseInfiniteQueryFnContext<any, any, any, any>;
19
+ path: string[];
20
+ context: TClientContext & OperationContext;
21
+ input: TInput;
22
+ fnContext: UseInfiniteQueryFnContext<any, any, any, any>;
25
23
  }
26
24
  export type ProcedureUtilsInfiniteInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsInfiniteInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
27
25
  export interface ProcedureUtilsMutationInterceptorOptions<TClientContext extends ClientContext, TInput> {
28
- path: string[];
29
- context: TClientContext & OperationContext;
30
- input: TInput;
31
- fnContext: UseMutationFnContext;
26
+ path: string[];
27
+ context: TClientContext & OperationContext;
28
+ input: TInput;
29
+ fnContext: UseMutationFnContext;
32
30
  }
33
31
  export type ProcedureUtilsMutationInterceptor<TClientContext extends ClientContext, TInput, TOutput, TError> = Interceptor<ProcedureUtilsMutationInterceptorOptions<TClientContext, TInput>, PromiseWithError<TOutput, TError>>;
34
32
  /**
@@ -37,78 +35,77 @@ export type ProcedureUtilsMutationInterceptor<TClientContext extends ClientConte
37
35
  */
38
36
  export type ProcedureUtilsModifier<T extends object> = Partial<T> | ((options: T) => T);
39
37
  export interface ProcedureUtilsOptions<TClientContext extends ClientContext, TInput, TOutput, TError> extends OperationKeyBaseOptions {
40
- /**
41
- * Key options modifier for .queryKey and .queryOptions
42
- * Can be partial options or a function that receives per-call options and returns override this.options.
43
- */
44
- queryKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
45
- /**
46
- * Interceptors that intercept query inside .queryOptions, guaranteed to be executed.
47
- */
48
- queryInterceptors?: ProcedureUtilsQueryInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
49
- /**
50
- * Options modifier for .queryOptions
51
- * Can be partial options or a function that receives per-call options and returns override this.options.
52
- */
53
- queryOptions?: ProcedureUtilsModifier<QueryOptionsIn<TClientContext, TInput, TOutput, TError, TOutput | undefined>> | undefined;
54
- /**
55
- * Key options modifier for .streamedKey and .streamedOptions
56
- * Can be partial options or a function that receives per-call options and returns override this.options.
57
- */
58
- streamedKey?: ProcedureUtilsModifier<StreamedKeyOptions<TInput>> | undefined;
59
- /**
60
- * Interceptors that intercept query inside .streamedOptions, guaranteed to be executed.
61
- */
62
- streamedInterceptors?: ProcedureUtilsStreamedInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
63
- /**
64
- * Options modifier for .streamedOptions
65
- * Can be partial options or a function that receives per-call options and returns override this.options.
66
- */
67
- streamedOptions?: ProcedureUtilsModifier<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, InferStreamedQueryOutput<TOutput> | undefined>> | undefined;
68
- /**
69
- * Key options modifier for .liveKey and .liveOptions
70
- * Can be partial options or a function that receives per-call options and returns override this.options.
71
- */
72
- liveKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
73
- /**
74
- * Interceptors that intercept query inside .liveOptions, guaranteed to be executed.
75
- */
76
- liveInterceptors?: ProcedureUtilsLiveInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
77
- /**
78
- * Options modifier for .liveOptions
79
- * Can be partial options or a function that receives per-call options and returns override this.options.
80
- */
81
- liveOptions?: ProcedureUtilsModifier<LiveOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, InferLiveQueryOutput<TOutput> | undefined>> | undefined;
82
- /**
83
- * Key options modifier for .infiniteKey and .infiniteOptions
84
- * Can be partial options or a function that receives per-call options and returns override this.options.
85
- */
86
- infiniteKey?: ProcedureUtilsModifier<InfiniteKeyOptions<TInput, unknown>> | undefined;
87
- /**
88
- * Interceptors that intercept query inside .infiniteOptions, guaranteed to be executed.
89
- */
90
- infiniteInterceptors?: ProcedureUtilsInfiniteInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
91
- /**
92
- * Options modifier for .infiniteOptions
93
- * Can be partial options or a function that receives per-call options and returns override this.options.
94
- */
95
- infiniteOptions?: ProcedureUtilsModifier<InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, unknown, UseInfiniteQueryData<TOutput, unknown> | undefined>> | undefined;
96
- /**
97
- * Key options modifier for .mutationKey and .mutationOptions
98
- * Can be partial options or a function that receives per-call options and returns override this.options.
99
- */
100
- mutationKey?: ProcedureUtilsModifier<MutationKeyOptions<TInput>> | undefined;
101
- /**
102
- * Interceptors that intercept mutation inside .mutationOptions, guaranteed to be executed.
103
- */
104
- mutationInterceptors?: ProcedureUtilsMutationInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
105
- /**
106
- * Options modifier for .mutationOptions
107
- * Can be partial options or a function that receives per-call options and returns override this.options.
108
- */
109
- mutationOptions?: ProcedureUtilsModifier<MutationOptionsIn<TClientContext, TInput, TOutput, TError, Record<any, any>>> | undefined;
38
+ /**
39
+ * Key options modifier for .queryKey and .queryOptions
40
+ * Can be partial options or a function that receives per-call options and returns override this.options.
41
+ */
42
+ queryKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
43
+ /**
44
+ * Interceptors that intercept query inside .queryOptions, guaranteed to be executed.
45
+ */
46
+ queryInterceptors?: ProcedureUtilsQueryInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
47
+ /**
48
+ * Options modifier for .queryOptions
49
+ * Can be partial options or a function that receives per-call options and returns override this.options.
50
+ */
51
+ queryOptions?: ProcedureUtilsModifier<QueryOptionsIn<TClientContext, TInput, TOutput, TError, TOutput | undefined>> | undefined;
52
+ /**
53
+ * Key options modifier for .streamedKey and .streamedOptions
54
+ * Can be partial options or a function that receives per-call options and returns override this.options.
55
+ */
56
+ streamedKey?: ProcedureUtilsModifier<StreamedKeyOptions<TInput>> | undefined;
57
+ /**
58
+ * Interceptors that intercept query inside .streamedOptions, guaranteed to be executed.
59
+ */
60
+ streamedInterceptors?: ProcedureUtilsStreamedInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
61
+ /**
62
+ * Options modifier for .streamedOptions
63
+ * Can be partial options or a function that receives per-call options and returns override this.options.
64
+ */
65
+ streamedOptions?: ProcedureUtilsModifier<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, InferStreamedQueryOutput<TOutput> | undefined>> | undefined;
66
+ /**
67
+ * Key options modifier for .liveKey and .liveOptions
68
+ * Can be partial options or a function that receives per-call options and returns override this.options.
69
+ */
70
+ liveKey?: ProcedureUtilsModifier<QueryKeyOptions<TInput>> | undefined;
71
+ /**
72
+ * Interceptors that intercept query inside .liveOptions, guaranteed to be executed.
73
+ */
74
+ liveInterceptors?: ProcedureUtilsLiveInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
75
+ /**
76
+ * Options modifier for .liveOptions
77
+ * Can be partial options or a function that receives per-call options and returns override this.options.
78
+ */
79
+ liveOptions?: ProcedureUtilsModifier<LiveOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, InferLiveQueryOutput<TOutput> | undefined>> | undefined;
80
+ /**
81
+ * Key options modifier for .infiniteKey and .infiniteOptions
82
+ * Can be partial options or a function that receives per-call options and returns override this.options.
83
+ */
84
+ infiniteKey?: ProcedureUtilsModifier<InfiniteKeyOptions<TInput, unknown>> | undefined;
85
+ /**
86
+ * Interceptors that intercept query inside .infiniteOptions, guaranteed to be executed.
87
+ */
88
+ infiniteInterceptors?: ProcedureUtilsInfiniteInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
89
+ /**
90
+ * Options modifier for .infiniteOptions
91
+ * Can be partial options or a function that receives per-call options and returns override this.options.
92
+ */
93
+ infiniteOptions?: ProcedureUtilsModifier<InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, unknown, UseInfiniteQueryData<TOutput, unknown> | undefined>> | undefined;
94
+ /**
95
+ * Key options modifier for .mutationKey and .mutationOptions
96
+ * Can be partial options or a function that receives per-call options and returns override this.options.
97
+ */
98
+ mutationKey?: ProcedureUtilsModifier<MutationKeyOptions<TInput>> | undefined;
99
+ /**
100
+ * Interceptors that intercept mutation inside .mutationOptions, guaranteed to be executed.
101
+ */
102
+ mutationInterceptors?: ProcedureUtilsMutationInterceptor<TClientContext, TInput, TOutput, TError>[] | undefined;
103
+ /**
104
+ * Options modifier for .mutationOptions
105
+ * Can be partial options or a function that receives per-call options and returns override this.options.
106
+ */
107
+ mutationOptions?: ProcedureUtilsModifier<MutationOptionsIn<TClientContext, TInput, TOutput, TError, Record<any, any>>> | undefined;
110
108
  }
111
- export declare function isProcedureUtilsOptions(value: unknown): value is ProcedureUtilsOptions<any, any, any, any>;
112
109
  /**
113
110
  * Merge two procedure utils options where `override` takes priority.
114
111
  * A key explicitly set to `undefined` in `override` resets the base value.
@@ -118,73 +115,73 @@ export declare function isProcedureUtilsOptions(value: unknown): value is Proced
118
115
  */
119
116
  export declare function mergeProcedureUtilsOptions<TClientContext extends ClientContext, TInput, TOutput, TError>(base: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>, override: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>): ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
120
117
  export declare class ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> extends SharedUtils<TInput> {
121
- protected readonly options: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
122
- /**
123
- * Calling corresponding procedure client
124
- *
125
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#calling-procedure-clients | Pinia Colada Integration - Calling Procedure Clients}
126
- */
127
- call: Client<TClientContext, TInput, TOutput, TError>;
128
- constructor(path: string[], client: Client<TClientContext, TInput, TOutput, TError>, options?: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>);
129
- /**
130
- * Generate a **full matching** key for useQuery/...
131
- *
132
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
133
- */
134
- queryKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<TOutput, TError>;
135
- /**
136
- * Generate options used for useQuery/...
137
- *
138
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#query-options-utility | Pinia Colada Integration - Query Options Utility}
139
- */
140
- queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): NoInfer<QueryOptionsOut<TOutput, TError, UInitialData>>;
141
- /**
142
- * Generate a **full matching** key for [Streamed Query Options](https://orpc.dev/docs/integrations/pinia-colada#streamed-query-options-utility).
143
- *
144
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
145
- */
146
- streamedKey(...rest: MaybeOptionalOptions<StreamedKeyOptions<TInput>>): EntryKeyTagged<InferStreamedQueryOutput<TOutput>, TError>;
147
- /**
148
- * Configure queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
149
- * The resulting data is an array of chunks, and each new chunk is appended as it arrives.
150
- * It never returns to pending once it has data.
151
- * Works with `useQuery` and any other API that accepts query options.
152
- */
153
- streamedOptions<UInitialData extends InferStreamedQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<StreamedOptionsOut<InferStreamedQueryOutput<TOutput>, TError, UInitialData>>;
154
- /**
155
- * Generate a **full matching** key for [Live Query Options](https://orpc.dev/docs/integrations/pinia-colada#live-query-options-utility).
156
- *
157
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
158
- */
159
- liveKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<InferLiveQueryOutput<TOutput>, TError>;
160
- /**
161
- * Configure live queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
162
- * Unlike `.streamedOptions` which accumulates chunks, live queries replace the entire result with each new chunk received.
163
- * Works with `useQuery` and any other API that accepts query options.
164
- */
165
- liveOptions<UInitialData extends InferLiveQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<LiveOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<QueryOptionsOut<InferLiveQueryOutput<TOutput>, TError, UInitialData>>;
166
- /**
167
- * Generate a **full matching** key for useInfiniteQuery/...
168
- *
169
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
170
- */
171
- infiniteKey<UPageParam>(optionsIn: InfiniteKeyOptions<TInput, UPageParam>): EntryKeyTagged<UseInfiniteQueryData<TOutput, UPageParam>, TError>;
172
- /**
173
- * Generate options used for useInfiniteQuery/...
174
- *
175
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#infinite-query-options-utility | Pinia Colada Integration - Infinite Query Options Utility}
176
- */
177
- infiniteOptions<UPageParam, UInitialData extends UseInfiniteQueryData<TOutput, UPageParam> | undefined = undefined>(optionsIn: InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, UPageParam, UInitialData>): NoInfer<InfiniteOptionsOut<TOutput, TError, UPageParam, UInitialData>>;
178
- /**
179
- * Generate a **full matching** key for useMutation/...
180
- *
181
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
182
- */
183
- mutationKey(...rest: MaybeOptionalOptions<MutationKeyOptions<TInput>>): MutationOptionsOut<TInput, TOutput, TError, _EmptyObject>['key'];
184
- /**
185
- * Generate options used for useMutation/...
186
- *
187
- * @see {@link https://orpc.dev/docs/integrations/pinia-colada#mutation-options | Pinia Colada Integration - Mutation Options}
188
- */
189
- mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): NoInfer<MutationOptionsOut<TInput, TOutput, TError, UMutationContext>>;
190
- }
118
+ protected readonly options: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>;
119
+ /**
120
+ * Calling corresponding procedure client
121
+ *
122
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#calling-procedure-clients | Pinia Colada Integration - Calling Procedure Clients}
123
+ */
124
+ call: Client<TClientContext, TInput, TOutput, TError>;
125
+ constructor(path: string[], client: Client<TClientContext, TInput, TOutput, TError>, options?: ProcedureUtilsOptions<TClientContext, TInput, TOutput, TError>);
126
+ /**
127
+ * Generate a **full matching** key for useQuery/...
128
+ *
129
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
130
+ */
131
+ queryKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<TOutput, TError>;
132
+ /**
133
+ * Generate options used for useQuery/...
134
+ *
135
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#query-options-utility | Pinia Colada Integration - Query Options Utility}
136
+ */
137
+ queryOptions<UInitialData extends TOutput | undefined = TOutput | undefined>(...rest: MaybeOptionalOptions<QueryOptionsIn<TClientContext, TInput, TOutput, TError, UInitialData>>): NoInfer<QueryOptionsOut<TOutput, TError, UInitialData>>;
138
+ /**
139
+ * Generate a **full matching** key for [Streamed Query Options](https://orpc.dev/docs/integrations/pinia-colada#streamed-query-options-utility).
140
+ *
141
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
142
+ */
143
+ streamedKey(...rest: MaybeOptionalOptions<StreamedKeyOptions<TInput>>): EntryKeyTagged<InferStreamedQueryOutput<TOutput>, TError>;
144
+ /**
145
+ * Configure queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
146
+ * The resulting data is an array of chunks, and each new chunk is appended as it arrives.
147
+ * It never returns to pending once it has data.
148
+ * Works with `useQuery` and any other API that accepts query options.
149
+ */
150
+ streamedOptions<UInitialData extends InferStreamedQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<StreamedOptionsIn<TClientContext, TInput, InferStreamedQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<StreamedOptionsOut<InferStreamedQueryOutput<TOutput>, TError, UInitialData>>;
151
+ /**
152
+ * Generate a **full matching** key for [Live Query Options](https://orpc.dev/docs/integrations/pinia-colada#live-query-options-utility).
153
+ *
154
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
155
+ */
156
+ liveKey(...rest: MaybeOptionalOptions<QueryKeyOptions<TInput>>): EntryKeyTagged<InferLiveQueryOutput<TOutput>, TError>;
157
+ /**
158
+ * Configure live queries for [AsyncIteratorObject](https://orpc.dev/docs/async-iterator-object).
159
+ * Unlike `.streamedOptions` which accumulates chunks, live queries replace the entire result with each new chunk received.
160
+ * Works with `useQuery` and any other API that accepts query options.
161
+ */
162
+ liveOptions<UInitialData extends InferLiveQueryOutput<TOutput> | undefined = undefined>(...rest: MaybeOptionalOptions<LiveOptionsIn<TClientContext, TInput, InferLiveQueryOutput<TOutput>, TError, UInitialData>>): NoInfer<QueryOptionsOut<InferLiveQueryOutput<TOutput>, TError, UInitialData>>;
163
+ /**
164
+ * Generate a **full matching** key for useInfiniteQuery/...
165
+ *
166
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
167
+ */
168
+ infiniteKey<UPageParam>(optionsIn: InfiniteKeyOptions<TInput, UPageParam>): EntryKeyTagged<UseInfiniteQueryData<TOutput, UPageParam>, TError>;
169
+ /**
170
+ * Generate options used for useInfiniteQuery/...
171
+ *
172
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#infinite-query-options-utility | Pinia Colada Integration - Infinite Query Options Utility}
173
+ */
174
+ infiniteOptions<UPageParam, UInitialData extends UseInfiniteQueryData<TOutput, UPageParam> | undefined = undefined>(optionsIn: InfiniteOptionsIn<TClientContext, TInput, TOutput, TError, UPageParam, UInitialData>): NoInfer<InfiniteOptionsOut<TOutput, TError, UPageParam, UInitialData>>;
175
+ /**
176
+ * Generate a **full matching** key for useMutation/...
177
+ *
178
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#querymutation-key | Pinia Colada Integration - Query/Mutation Key}
179
+ */
180
+ mutationKey(...rest: MaybeOptionalOptions<MutationKeyOptions<TInput>>): MutationOptionsOut<TInput, TOutput, TError, _EmptyObject>["key"];
181
+ /**
182
+ * Generate options used for useMutation/...
183
+ *
184
+ * @see {@link https://orpc.dev/docs/integrations/pinia-colada#mutation-options | Pinia Colada Integration - Mutation Options}
185
+ */
186
+ mutationOptions<UMutationContext extends Record<any, any> = _EmptyObject>(...rest: MaybeOptionalOptions<MutationOptionsIn<TClientContext, TInput, TOutput, TError, UMutationContext>>): NoInfer<MutationOptionsOut<TInput, TOutput, TError, UMutationContext>>;
187
+ }