@orpc/zod 0.0.0-next.ee46dab → 0.0.0-next.ee5598c

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.
@@ -0,0 +1,314 @@
1
+ import { Context } from '@orpc/server';
2
+ import { StandardHandlerPlugin, StandardHandlerOptions } from '@orpc/server/standard';
3
+ import { AnySchema } from '@orpc/contract';
4
+ import { JSONSchema, SchemaConvertOptions, ConditionalSchemaConverter } from '@orpc/openapi';
5
+ import { Interceptor } from '@orpc/shared';
6
+ import * as zod_v4_core from 'zod/v4/core';
7
+ import { $ZodType, $input, $output } from 'zod/v4/core';
8
+
9
+ /**
10
+ * @deprecated Use [Smart Coercion Plugin](https://orpc.unnoq.com/docs/openapi/plugins/smart-coercion) instead.
11
+ */
12
+ declare class experimental_ZodSmartCoercionPlugin<TContext extends Context> implements StandardHandlerPlugin<TContext> {
13
+ #private;
14
+ init(options: StandardHandlerOptions<TContext>): void;
15
+ }
16
+
17
+ interface experimental_ZodToJsonSchemaOptions {
18
+ /**
19
+ * Max depth of lazy type.
20
+ *
21
+ * Used anyJsonSchema (`{}`) when exceed max depth
22
+ *
23
+ * @default 2
24
+ */
25
+ maxLazyDepth?: number;
26
+ /**
27
+ * Max depth of nested types.
28
+ *
29
+ * Used anyJsonSchema (`{}`) when exceed max depth
30
+ *
31
+ * @default 10
32
+ */
33
+ maxStructureDepth?: number;
34
+ /**
35
+ * The schema to be used to represent the any | unknown type.
36
+ *
37
+ * @default { }
38
+ */
39
+ anyJsonSchema?: Exclude<JSONSchema, boolean>;
40
+ /**
41
+ * The schema to be used when the Zod schema is unsupported.
42
+ *
43
+ * @default { not: {} }
44
+ */
45
+ unsupportedJsonSchema?: Exclude<JSONSchema, boolean>;
46
+ /**
47
+ * The schema to be used to represent the undefined type.
48
+ *
49
+ * @default { not: {} }
50
+ */
51
+ undefinedJsonSchema?: Exclude<JSONSchema, boolean>;
52
+ interceptors?: Interceptor<{
53
+ schema: $ZodType;
54
+ options: SchemaConvertOptions;
55
+ lazyDepth: number;
56
+ isHandledCustomJSONSchema: boolean;
57
+ }, [
58
+ required: boolean,
59
+ jsonSchema: Exclude<JSONSchema, boolean>
60
+ ]>[];
61
+ }
62
+ declare class experimental_ZodToJsonSchemaConverter implements ConditionalSchemaConverter {
63
+ #private;
64
+ private readonly maxLazyDepth;
65
+ private readonly maxStructureDepth;
66
+ private readonly anyJsonSchema;
67
+ private readonly unsupportedJsonSchema;
68
+ private readonly undefinedJsonSchema;
69
+ private readonly interceptors;
70
+ constructor(options?: experimental_ZodToJsonSchemaOptions);
71
+ condition(schema: AnySchema | undefined): boolean;
72
+ convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
73
+ }
74
+
75
+ /**
76
+ * Zod registry for customizing generated JSON schema, can use both for .input and .output
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { JSON_SCHEMA_REGISTRY } from '@orpc/zod/zod4'
81
+ *
82
+ * const user = z.object({
83
+ * name: z.string(),
84
+ * age: z.number(),
85
+ * })
86
+ *
87
+ * JSON_SCHEMA_REGISTRY.add(user, {
88
+ * examples: [{ name: 'John', age: 20 }],
89
+ * })
90
+ * ```
91
+ */
92
+ declare const experimental_JSON_SCHEMA_REGISTRY: zod_v4_core.$ZodRegistry<{
93
+ $anchor?: string;
94
+ $comment?: string;
95
+ $defs?: Record<string, JSONSchema>;
96
+ $dynamicAnchor?: string;
97
+ $dynamicRef?: string;
98
+ $id?: string;
99
+ $ref?: string;
100
+ $schema?: string;
101
+ $vocabulary?: Record<string, string>;
102
+ additionalItems?: JSONSchema;
103
+ additionalProperties?: JSONSchema;
104
+ allOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
105
+ anyOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
106
+ const?: typeof $input | typeof $output | undefined;
107
+ contains?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
108
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
109
+ contentMediaType?: string;
110
+ contentSchema?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
111
+ default?: typeof $input | typeof $output | undefined;
112
+ definitions?: Record<string, JSONSchema>;
113
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
114
+ dependentRequired?: Record<string, string[] | readonly string[]>;
115
+ dependentSchemas?: Record<string, JSONSchema>;
116
+ deprecated?: boolean;
117
+ description?: string;
118
+ else?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
119
+ enum?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
120
+ examples?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
121
+ exclusiveMaximum?: number;
122
+ exclusiveMinimum?: number;
123
+ format?: string;
124
+ if?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
125
+ items?: JSONSchema;
126
+ maxContains?: number;
127
+ maximum?: number;
128
+ maxItems?: number;
129
+ maxLength?: number;
130
+ maxProperties?: number;
131
+ minContains?: number;
132
+ minimum?: number;
133
+ minItems?: number;
134
+ minLength?: number;
135
+ minProperties?: number;
136
+ multipleOf?: number;
137
+ not?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
138
+ oneOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
139
+ pattern?: string;
140
+ patternProperties?: Record<string, JSONSchema>;
141
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
142
+ properties?: Record<string, JSONSchema>;
143
+ propertyNames?: JSONSchema;
144
+ readOnly?: boolean;
145
+ required?: string[] | readonly string[];
146
+ then?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
147
+ title?: string;
148
+ type?: JSONSchema.TypeValue | undefined;
149
+ unevaluatedItems?: JSONSchema;
150
+ unevaluatedProperties?: JSONSchema;
151
+ uniqueItems?: boolean;
152
+ writeOnly?: boolean;
153
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
154
+ /**
155
+ * Zod registry for customizing generated JSON schema, only useful for .input
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * import { JSON_SCHEMA_INPUT_REGISTRY } from '@orpc/zod/zod4'
160
+ *
161
+ * const user = z.object({
162
+ * name: z.string(),
163
+ * age: z.string().transform(v => Number(v)),
164
+ * })
165
+ *
166
+ * JSON_SCHEMA_REGISTRY.add(user, {
167
+ * examples: [{ name: 'John', age: "20" }],
168
+ * })
169
+ * ```
170
+ */
171
+ declare const experimental_JSON_SCHEMA_INPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
172
+ $anchor?: string;
173
+ $comment?: string;
174
+ $defs?: Record<string, JSONSchema>;
175
+ $dynamicAnchor?: string;
176
+ $dynamicRef?: string;
177
+ $id?: string;
178
+ $ref?: string;
179
+ $schema?: string;
180
+ $vocabulary?: Record<string, string>;
181
+ additionalItems?: JSONSchema;
182
+ additionalProperties?: JSONSchema;
183
+ allOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
184
+ anyOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
185
+ const?: typeof $input | undefined;
186
+ contains?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
187
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
188
+ contentMediaType?: string;
189
+ contentSchema?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
190
+ default?: typeof $input | undefined;
191
+ definitions?: Record<string, JSONSchema>;
192
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
193
+ dependentRequired?: Record<string, string[] | readonly string[]>;
194
+ dependentSchemas?: Record<string, JSONSchema>;
195
+ deprecated?: boolean;
196
+ description?: string;
197
+ else?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
198
+ enum?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
199
+ examples?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
200
+ exclusiveMaximum?: number;
201
+ exclusiveMinimum?: number;
202
+ format?: string;
203
+ if?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
204
+ items?: JSONSchema;
205
+ maxContains?: number;
206
+ maximum?: number;
207
+ maxItems?: number;
208
+ maxLength?: number;
209
+ maxProperties?: number;
210
+ minContains?: number;
211
+ minimum?: number;
212
+ minItems?: number;
213
+ minLength?: number;
214
+ minProperties?: number;
215
+ multipleOf?: number;
216
+ not?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
217
+ oneOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
218
+ pattern?: string;
219
+ patternProperties?: Record<string, JSONSchema>;
220
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
221
+ properties?: Record<string, JSONSchema>;
222
+ propertyNames?: JSONSchema;
223
+ readOnly?: boolean;
224
+ required?: string[] | readonly string[];
225
+ then?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
226
+ title?: string;
227
+ type?: JSONSchema.TypeValue | undefined;
228
+ unevaluatedItems?: JSONSchema;
229
+ unevaluatedProperties?: JSONSchema;
230
+ uniqueItems?: boolean;
231
+ writeOnly?: boolean;
232
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
233
+ /**
234
+ * Zod registry for customizing generated JSON schema, only useful for .input
235
+ *
236
+ * @example
237
+ * ```ts
238
+ * import { JSON_SCHEMA_OUTPUT_REGISTRY } from '@orpc/zod/zod4'
239
+ *
240
+ * const user = z.object({
241
+ * name: z.string(),
242
+ * age: z.string().transform(v => Number(v)),
243
+ * })
244
+ *
245
+ * JSON_SCHEMA_OUTPUT_REGISTRY.add(user, {
246
+ * examples: [{ name: 'John', age: 20 }],
247
+ * })
248
+ * ```
249
+ */
250
+ declare const experimental_JSON_SCHEMA_OUTPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
251
+ $anchor?: string;
252
+ $comment?: string;
253
+ $defs?: Record<string, JSONSchema>;
254
+ $dynamicAnchor?: string;
255
+ $dynamicRef?: string;
256
+ $id?: string;
257
+ $ref?: string;
258
+ $schema?: string;
259
+ $vocabulary?: Record<string, string>;
260
+ additionalItems?: JSONSchema;
261
+ additionalProperties?: JSONSchema;
262
+ allOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
263
+ anyOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
264
+ const?: typeof $output | undefined;
265
+ contains?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
266
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
267
+ contentMediaType?: string;
268
+ contentSchema?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
269
+ default?: typeof $output | undefined;
270
+ definitions?: Record<string, JSONSchema>;
271
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
272
+ dependentRequired?: Record<string, string[] | readonly string[]>;
273
+ dependentSchemas?: Record<string, JSONSchema>;
274
+ deprecated?: boolean;
275
+ description?: string;
276
+ else?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
277
+ enum?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
278
+ examples?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
279
+ exclusiveMaximum?: number;
280
+ exclusiveMinimum?: number;
281
+ format?: string;
282
+ if?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
283
+ items?: JSONSchema;
284
+ maxContains?: number;
285
+ maximum?: number;
286
+ maxItems?: number;
287
+ maxLength?: number;
288
+ maxProperties?: number;
289
+ minContains?: number;
290
+ minimum?: number;
291
+ minItems?: number;
292
+ minLength?: number;
293
+ minProperties?: number;
294
+ multipleOf?: number;
295
+ not?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
296
+ oneOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
297
+ pattern?: string;
298
+ patternProperties?: Record<string, JSONSchema>;
299
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
300
+ properties?: Record<string, JSONSchema>;
301
+ propertyNames?: JSONSchema;
302
+ readOnly?: boolean;
303
+ required?: string[] | readonly string[];
304
+ then?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
305
+ title?: string;
306
+ type?: JSONSchema.TypeValue | undefined;
307
+ unevaluatedItems?: JSONSchema;
308
+ unevaluatedProperties?: JSONSchema;
309
+ uniqueItems?: boolean;
310
+ writeOnly?: boolean;
311
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
312
+
313
+ export { experimental_JSON_SCHEMA_INPUT_REGISTRY, experimental_JSON_SCHEMA_OUTPUT_REGISTRY, experimental_JSON_SCHEMA_REGISTRY, experimental_ZodSmartCoercionPlugin, experimental_ZodToJsonSchemaConverter };
314
+ export type { experimental_ZodToJsonSchemaOptions };
@@ -0,0 +1,314 @@
1
+ import { Context } from '@orpc/server';
2
+ import { StandardHandlerPlugin, StandardHandlerOptions } from '@orpc/server/standard';
3
+ import { AnySchema } from '@orpc/contract';
4
+ import { JSONSchema, SchemaConvertOptions, ConditionalSchemaConverter } from '@orpc/openapi';
5
+ import { Interceptor } from '@orpc/shared';
6
+ import * as zod_v4_core from 'zod/v4/core';
7
+ import { $ZodType, $input, $output } from 'zod/v4/core';
8
+
9
+ /**
10
+ * @deprecated Use [Smart Coercion Plugin](https://orpc.unnoq.com/docs/openapi/plugins/smart-coercion) instead.
11
+ */
12
+ declare class experimental_ZodSmartCoercionPlugin<TContext extends Context> implements StandardHandlerPlugin<TContext> {
13
+ #private;
14
+ init(options: StandardHandlerOptions<TContext>): void;
15
+ }
16
+
17
+ interface experimental_ZodToJsonSchemaOptions {
18
+ /**
19
+ * Max depth of lazy type.
20
+ *
21
+ * Used anyJsonSchema (`{}`) when exceed max depth
22
+ *
23
+ * @default 2
24
+ */
25
+ maxLazyDepth?: number;
26
+ /**
27
+ * Max depth of nested types.
28
+ *
29
+ * Used anyJsonSchema (`{}`) when exceed max depth
30
+ *
31
+ * @default 10
32
+ */
33
+ maxStructureDepth?: number;
34
+ /**
35
+ * The schema to be used to represent the any | unknown type.
36
+ *
37
+ * @default { }
38
+ */
39
+ anyJsonSchema?: Exclude<JSONSchema, boolean>;
40
+ /**
41
+ * The schema to be used when the Zod schema is unsupported.
42
+ *
43
+ * @default { not: {} }
44
+ */
45
+ unsupportedJsonSchema?: Exclude<JSONSchema, boolean>;
46
+ /**
47
+ * The schema to be used to represent the undefined type.
48
+ *
49
+ * @default { not: {} }
50
+ */
51
+ undefinedJsonSchema?: Exclude<JSONSchema, boolean>;
52
+ interceptors?: Interceptor<{
53
+ schema: $ZodType;
54
+ options: SchemaConvertOptions;
55
+ lazyDepth: number;
56
+ isHandledCustomJSONSchema: boolean;
57
+ }, [
58
+ required: boolean,
59
+ jsonSchema: Exclude<JSONSchema, boolean>
60
+ ]>[];
61
+ }
62
+ declare class experimental_ZodToJsonSchemaConverter implements ConditionalSchemaConverter {
63
+ #private;
64
+ private readonly maxLazyDepth;
65
+ private readonly maxStructureDepth;
66
+ private readonly anyJsonSchema;
67
+ private readonly unsupportedJsonSchema;
68
+ private readonly undefinedJsonSchema;
69
+ private readonly interceptors;
70
+ constructor(options?: experimental_ZodToJsonSchemaOptions);
71
+ condition(schema: AnySchema | undefined): boolean;
72
+ convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
73
+ }
74
+
75
+ /**
76
+ * Zod registry for customizing generated JSON schema, can use both for .input and .output
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { JSON_SCHEMA_REGISTRY } from '@orpc/zod/zod4'
81
+ *
82
+ * const user = z.object({
83
+ * name: z.string(),
84
+ * age: z.number(),
85
+ * })
86
+ *
87
+ * JSON_SCHEMA_REGISTRY.add(user, {
88
+ * examples: [{ name: 'John', age: 20 }],
89
+ * })
90
+ * ```
91
+ */
92
+ declare const experimental_JSON_SCHEMA_REGISTRY: zod_v4_core.$ZodRegistry<{
93
+ $anchor?: string;
94
+ $comment?: string;
95
+ $defs?: Record<string, JSONSchema>;
96
+ $dynamicAnchor?: string;
97
+ $dynamicRef?: string;
98
+ $id?: string;
99
+ $ref?: string;
100
+ $schema?: string;
101
+ $vocabulary?: Record<string, string>;
102
+ additionalItems?: JSONSchema;
103
+ additionalProperties?: JSONSchema;
104
+ allOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
105
+ anyOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
106
+ const?: typeof $input | typeof $output | undefined;
107
+ contains?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
108
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
109
+ contentMediaType?: string;
110
+ contentSchema?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
111
+ default?: typeof $input | typeof $output | undefined;
112
+ definitions?: Record<string, JSONSchema>;
113
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
114
+ dependentRequired?: Record<string, string[] | readonly string[]>;
115
+ dependentSchemas?: Record<string, JSONSchema>;
116
+ deprecated?: boolean;
117
+ description?: string;
118
+ else?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
119
+ enum?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
120
+ examples?: ((typeof $input | typeof $output)[] | readonly (typeof $input | typeof $output)[]) | undefined;
121
+ exclusiveMaximum?: number;
122
+ exclusiveMinimum?: number;
123
+ format?: string;
124
+ if?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
125
+ items?: JSONSchema;
126
+ maxContains?: number;
127
+ maximum?: number;
128
+ maxItems?: number;
129
+ maxLength?: number;
130
+ maxProperties?: number;
131
+ minContains?: number;
132
+ minimum?: number;
133
+ minItems?: number;
134
+ minLength?: number;
135
+ minProperties?: number;
136
+ multipleOf?: number;
137
+ not?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
138
+ oneOf?: (JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue>[]) | undefined;
139
+ pattern?: string;
140
+ patternProperties?: Record<string, JSONSchema>;
141
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
142
+ properties?: Record<string, JSONSchema>;
143
+ propertyNames?: JSONSchema;
144
+ readOnly?: boolean;
145
+ required?: string[] | readonly string[];
146
+ then?: JSONSchema<typeof $input | typeof $output, JSONSchema.TypeValue> | undefined;
147
+ title?: string;
148
+ type?: JSONSchema.TypeValue | undefined;
149
+ unevaluatedItems?: JSONSchema;
150
+ unevaluatedProperties?: JSONSchema;
151
+ uniqueItems?: boolean;
152
+ writeOnly?: boolean;
153
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
154
+ /**
155
+ * Zod registry for customizing generated JSON schema, only useful for .input
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * import { JSON_SCHEMA_INPUT_REGISTRY } from '@orpc/zod/zod4'
160
+ *
161
+ * const user = z.object({
162
+ * name: z.string(),
163
+ * age: z.string().transform(v => Number(v)),
164
+ * })
165
+ *
166
+ * JSON_SCHEMA_REGISTRY.add(user, {
167
+ * examples: [{ name: 'John', age: "20" }],
168
+ * })
169
+ * ```
170
+ */
171
+ declare const experimental_JSON_SCHEMA_INPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
172
+ $anchor?: string;
173
+ $comment?: string;
174
+ $defs?: Record<string, JSONSchema>;
175
+ $dynamicAnchor?: string;
176
+ $dynamicRef?: string;
177
+ $id?: string;
178
+ $ref?: string;
179
+ $schema?: string;
180
+ $vocabulary?: Record<string, string>;
181
+ additionalItems?: JSONSchema;
182
+ additionalProperties?: JSONSchema;
183
+ allOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
184
+ anyOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
185
+ const?: typeof $input | undefined;
186
+ contains?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
187
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
188
+ contentMediaType?: string;
189
+ contentSchema?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
190
+ default?: typeof $input | undefined;
191
+ definitions?: Record<string, JSONSchema>;
192
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
193
+ dependentRequired?: Record<string, string[] | readonly string[]>;
194
+ dependentSchemas?: Record<string, JSONSchema>;
195
+ deprecated?: boolean;
196
+ description?: string;
197
+ else?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
198
+ enum?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
199
+ examples?: ((typeof $input)[] | readonly (typeof $input)[]) | undefined;
200
+ exclusiveMaximum?: number;
201
+ exclusiveMinimum?: number;
202
+ format?: string;
203
+ if?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
204
+ items?: JSONSchema;
205
+ maxContains?: number;
206
+ maximum?: number;
207
+ maxItems?: number;
208
+ maxLength?: number;
209
+ maxProperties?: number;
210
+ minContains?: number;
211
+ minimum?: number;
212
+ minItems?: number;
213
+ minLength?: number;
214
+ minProperties?: number;
215
+ multipleOf?: number;
216
+ not?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
217
+ oneOf?: (JSONSchema<typeof $input, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $input, JSONSchema.TypeValue>[]) | undefined;
218
+ pattern?: string;
219
+ patternProperties?: Record<string, JSONSchema>;
220
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
221
+ properties?: Record<string, JSONSchema>;
222
+ propertyNames?: JSONSchema;
223
+ readOnly?: boolean;
224
+ required?: string[] | readonly string[];
225
+ then?: JSONSchema<typeof $input, JSONSchema.TypeValue> | undefined;
226
+ title?: string;
227
+ type?: JSONSchema.TypeValue | undefined;
228
+ unevaluatedItems?: JSONSchema;
229
+ unevaluatedProperties?: JSONSchema;
230
+ uniqueItems?: boolean;
231
+ writeOnly?: boolean;
232
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
233
+ /**
234
+ * Zod registry for customizing generated JSON schema, only useful for .input
235
+ *
236
+ * @example
237
+ * ```ts
238
+ * import { JSON_SCHEMA_OUTPUT_REGISTRY } from '@orpc/zod/zod4'
239
+ *
240
+ * const user = z.object({
241
+ * name: z.string(),
242
+ * age: z.string().transform(v => Number(v)),
243
+ * })
244
+ *
245
+ * JSON_SCHEMA_OUTPUT_REGISTRY.add(user, {
246
+ * examples: [{ name: 'John', age: 20 }],
247
+ * })
248
+ * ```
249
+ */
250
+ declare const experimental_JSON_SCHEMA_OUTPUT_REGISTRY: zod_v4_core.$ZodRegistry<{
251
+ $anchor?: string;
252
+ $comment?: string;
253
+ $defs?: Record<string, JSONSchema>;
254
+ $dynamicAnchor?: string;
255
+ $dynamicRef?: string;
256
+ $id?: string;
257
+ $ref?: string;
258
+ $schema?: string;
259
+ $vocabulary?: Record<string, string>;
260
+ additionalItems?: JSONSchema;
261
+ additionalProperties?: JSONSchema;
262
+ allOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
263
+ anyOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
264
+ const?: typeof $output | undefined;
265
+ contains?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
266
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
267
+ contentMediaType?: string;
268
+ contentSchema?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
269
+ default?: typeof $output | undefined;
270
+ definitions?: Record<string, JSONSchema>;
271
+ dependencies?: Record<string, (string[] | readonly string[]) | JSONSchema>;
272
+ dependentRequired?: Record<string, string[] | readonly string[]>;
273
+ dependentSchemas?: Record<string, JSONSchema>;
274
+ deprecated?: boolean;
275
+ description?: string;
276
+ else?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
277
+ enum?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
278
+ examples?: ((typeof $output)[] | readonly (typeof $output)[]) | undefined;
279
+ exclusiveMaximum?: number;
280
+ exclusiveMinimum?: number;
281
+ format?: string;
282
+ if?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
283
+ items?: JSONSchema;
284
+ maxContains?: number;
285
+ maximum?: number;
286
+ maxItems?: number;
287
+ maxLength?: number;
288
+ maxProperties?: number;
289
+ minContains?: number;
290
+ minimum?: number;
291
+ minItems?: number;
292
+ minLength?: number;
293
+ minProperties?: number;
294
+ multipleOf?: number;
295
+ not?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
296
+ oneOf?: (JSONSchema<typeof $output, JSONSchema.TypeValue>[] | readonly JSONSchema<typeof $output, JSONSchema.TypeValue>[]) | undefined;
297
+ pattern?: string;
298
+ patternProperties?: Record<string, JSONSchema>;
299
+ prefixItems?: (JSONSchema<any, JSONSchema.TypeValue>[] | readonly JSONSchema<any, JSONSchema.TypeValue>[]) | JSONSchema;
300
+ properties?: Record<string, JSONSchema>;
301
+ propertyNames?: JSONSchema;
302
+ readOnly?: boolean;
303
+ required?: string[] | readonly string[];
304
+ then?: JSONSchema<typeof $output, JSONSchema.TypeValue> | undefined;
305
+ title?: string;
306
+ type?: JSONSchema.TypeValue | undefined;
307
+ unevaluatedItems?: JSONSchema;
308
+ unevaluatedProperties?: JSONSchema;
309
+ uniqueItems?: boolean;
310
+ writeOnly?: boolean;
311
+ }, zod_v4_core.$ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>>>;
312
+
313
+ export { experimental_JSON_SCHEMA_INPUT_REGISTRY, experimental_JSON_SCHEMA_OUTPUT_REGISTRY, experimental_JSON_SCHEMA_REGISTRY, experimental_ZodSmartCoercionPlugin, experimental_ZodToJsonSchemaConverter };
314
+ export type { experimental_ZodToJsonSchemaOptions };