gitea push
This commit is contained in:
+42
-14
@@ -36,7 +36,7 @@ export interface ZodType<out Output = unknown, out Input = unknown, out Internal
|
||||
safeEncodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.input<this>>>;
|
||||
safeDecodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
|
||||
refine<Ch extends (arg: core.output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | core.$ZodCustomParams): Ch extends (arg: any) => arg is infer R ? this & ZodType<R, core.input<this>> : this;
|
||||
superRefine(refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>): this;
|
||||
superRefine(refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): this;
|
||||
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
|
||||
optional(): ZodOptional<this>;
|
||||
exactOptional(): ZodExactOptional<this>;
|
||||
@@ -129,7 +129,11 @@ export interface ZodString extends _ZodString<core.$ZodStringInternals<string>>
|
||||
nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
|
||||
/** @deprecated Use `z.guid()` instead. */
|
||||
guid(params?: string | core.$ZodCheckGUIDParams): this;
|
||||
/** @deprecated Use `z.cuid()` instead. */
|
||||
/**
|
||||
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
||||
* (timestamps embedded in the id). Use `z.cuid2()` instead.
|
||||
* See https://github.com/paralleldrive/cuid.
|
||||
*/
|
||||
cuid(params?: string | core.$ZodCheckCUIDParams): this;
|
||||
/** @deprecated Use `z.cuid2()` instead. */
|
||||
cuid2(params?: string | core.$ZodCheckCUID2Params): this;
|
||||
@@ -202,10 +206,27 @@ export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
|
||||
}
|
||||
export declare const ZodNanoID: core.$constructor<ZodNanoID>;
|
||||
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID;
|
||||
/**
|
||||
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
||||
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
||||
* See https://github.com/paralleldrive/cuid.
|
||||
*/
|
||||
export interface ZodCUID extends ZodStringFormat<"cuid"> {
|
||||
_zod: core.$ZodCUIDInternals;
|
||||
}
|
||||
/**
|
||||
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
||||
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
||||
* See https://github.com/paralleldrive/cuid.
|
||||
*/
|
||||
export declare const ZodCUID: core.$constructor<ZodCUID>;
|
||||
/**
|
||||
* Validates a CUID v1 string.
|
||||
*
|
||||
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
||||
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
||||
* See https://github.com/paralleldrive/cuid.
|
||||
*/
|
||||
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodCUID;
|
||||
export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
|
||||
_zod: core.$ZodCUID2Internals;
|
||||
@@ -444,8 +465,8 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
||||
strict(): ZodObject<Shape, core.$strict>;
|
||||
/** This is the default behavior. This method call is likely unnecessary. */
|
||||
strip(): ZodObject<Shape, core.$strip>;
|
||||
extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
|
||||
safeExtend<U extends core.$ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>): ZodObject<util.Extend<Shape, U>, Config>;
|
||||
extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, util.Writeable<U>>, Config>;
|
||||
safeExtend<U extends core.$ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>): ZodObject<util.Extend<Shape, util.Writeable<U>>, Config>;
|
||||
/**
|
||||
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
||||
*/
|
||||
@@ -453,22 +474,22 @@ out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.
|
||||
pick<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
||||
omit<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
|
||||
partial(): ZodObject<{
|
||||
[k in keyof Shape]: ZodOptional<Shape[k]>;
|
||||
-readonly [k in keyof Shape]: ZodOptional<Shape[k]>;
|
||||
}, Config>;
|
||||
partial<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{
|
||||
[k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
|
||||
-readonly [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
|
||||
}, Config>;
|
||||
required(): ZodObject<{
|
||||
[k in keyof Shape]: ZodNonOptional<Shape[k]>;
|
||||
-readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>;
|
||||
}, Config>;
|
||||
required<M extends util.Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{
|
||||
[k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
|
||||
-readonly [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
|
||||
}, Config>;
|
||||
}
|
||||
export declare const ZodObject: core.$constructor<ZodObject>;
|
||||
export declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams): ZodObject<util.Writeable<T>, core.$strip>;
|
||||
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$strict>;
|
||||
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$loose>;
|
||||
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<util.Writeable<T>, core.$strict>;
|
||||
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<util.Writeable<T>, core.$loose>;
|
||||
export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]> extends _ZodType<core.$ZodUnionInternals<T>>, core.$ZodUnion<T> {
|
||||
"~standard": ZodStandardSchemaWithJSON<this>;
|
||||
options: T;
|
||||
@@ -490,7 +511,7 @@ export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[]
|
||||
def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
|
||||
}
|
||||
export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
|
||||
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types, Disc>;
|
||||
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable<Disc>, ...core.$ZodTypeDiscriminable<Disc>[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types, Disc>;
|
||||
export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodIntersectionInternals<A, B>>, core.$ZodIntersection<A, B> {
|
||||
"~standard": ZodStandardSchemaWithJSON<this>;
|
||||
}
|
||||
@@ -575,7 +596,7 @@ export interface ZodTransform<O = unknown, I = unknown> extends _ZodType<core.$Z
|
||||
"~standard": ZodStandardSchemaWithJSON<this>;
|
||||
}
|
||||
export declare const ZodTransform: core.$constructor<ZodTransform>;
|
||||
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodTransform<Awaited<O>, I>;
|
||||
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.$RefinementCtx) => O): ZodTransform<Awaited<O>, I>;
|
||||
export interface ZodOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
|
||||
"~standard": ZodStandardSchemaWithJSON<this>;
|
||||
unwrap(): T;
|
||||
@@ -652,6 +673,13 @@ export declare function codec<const A extends core.SomeType, B extends core.Some
|
||||
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
||||
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
||||
}): ZodCodec<A, B>;
|
||||
export declare function invertCodec<A extends core.SomeType, B extends core.SomeType>(codec: ZodCodec<A, B>): ZodCodec<B, A>;
|
||||
export interface ZodPreprocess<B extends core.SomeType = core.$ZodType> extends ZodPipe<core.$ZodTransform, B>, core.$ZodPreprocess<B> {
|
||||
"~standard": ZodStandardSchemaWithJSON<this>;
|
||||
_zod: core.$ZodPreprocessInternals<B>;
|
||||
def: core.$ZodPreprocessDef<B>;
|
||||
}
|
||||
export declare const ZodPreprocess: core.$constructor<ZodPreprocess>;
|
||||
export interface ZodReadonly<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodReadonlyInternals<T>>, core.$ZodReadonly<T> {
|
||||
"~standard": ZodStandardSchemaWithJSON<this>;
|
||||
unwrap(): T;
|
||||
@@ -712,7 +740,7 @@ export declare const ZodCustom: core.$constructor<ZodCustom>;
|
||||
export declare function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O>;
|
||||
export declare function custom<O>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodCustom<O, O>;
|
||||
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
||||
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
|
||||
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
|
||||
export declare const describe: typeof core.describe;
|
||||
export declare const meta: typeof core.meta;
|
||||
type ZodInstanceOfParams = core.Params<ZodCustom, core.$ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
|
||||
@@ -736,4 +764,4 @@ export interface ZodJSONSchema extends _ZodJSONSchema {
|
||||
_zod: ZodJSONSchemaInternals;
|
||||
}
|
||||
export declare function json(params?: string | core.$ZodCustomParams): ZodJSONSchema;
|
||||
export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: core.$RefinementCtx) => A, schema: U): ZodPipe<ZodTransform<A, B>, U>;
|
||||
export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: core.$RefinementCtx) => A, schema: U): ZodPreprocess<U>;
|
||||
|
||||
Reference in New Issue
Block a user