Comparing version 0.0.7 to 0.0.8
@@ -11,6 +11,10 @@ import { ZodObject, ZodRawShape, ZodType, ParseParams, SafeParseReturnType } from "zod"; | ||
export declare function isZodClass(a: any): a is Ctor; | ||
export declare function Z<Super extends Ctor>(Super: Super): { | ||
parse(value: unknown): InstanceType<Super>; | ||
extend<Shape extends ZodRawShape>(shape: Shape): ZodClass<Omit<Super["shape"], keyof Shape> & Shape, InstanceType<Super>>; | ||
}; | ||
export interface Z { | ||
<T extends ZodRawShape>(shape: T): ZodClass<T>; | ||
<Super extends Ctor>(Super: Super): { | ||
parse(value: unknown): InstanceType<Super>; | ||
extend<Shape extends ZodRawShape>(shape: Shape): ZodClass<Omit<Super["shape"], keyof Shape> & Shape, InstanceType<Super>>; | ||
}; | ||
} | ||
export declare const Z: Z; | ||
export interface ZodClass<T extends ZodRawShape, Self = {}> extends Omit<ZodObject<T>, "parse" | "parseAsync" | "safeParse" | "safeParseAsync"> { | ||
@@ -17,0 +21,0 @@ [IS_ZOD_CLASS]: true; |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.isZodClass = isZodClass; | ||
function Z(Super) { | ||
exports.Z = function (Super) { | ||
return { | ||
@@ -30,4 +30,3 @@ parse(value) { | ||
}; | ||
} | ||
exports.Z = Z; | ||
}; | ||
/** | ||
@@ -48,3 +47,3 @@ * Creates a class and a Zod schema in one line. | ||
*/ | ||
Z["class"] = function (shape) { | ||
exports.Z["class"] = function (shape) { | ||
var _a, _b; | ||
@@ -51,0 +50,0 @@ const _schema = (0, zod_1.object)(shape); |
@@ -11,6 +11,10 @@ import { ZodObject, ZodRawShape, ZodType, ParseParams, SafeParseReturnType } from "zod"; | ||
export declare function isZodClass(a: any): a is Ctor; | ||
export declare function Z<Super extends Ctor>(Super: Super): { | ||
parse(value: unknown): InstanceType<Super>; | ||
extend<Shape extends ZodRawShape>(shape: Shape): ZodClass<Omit<Super["shape"], keyof Shape> & Shape, InstanceType<Super>>; | ||
}; | ||
export interface Z { | ||
<T extends ZodRawShape>(shape: T): ZodClass<T>; | ||
<Super extends Ctor>(Super: Super): { | ||
parse(value: unknown): InstanceType<Super>; | ||
extend<Shape extends ZodRawShape>(shape: Shape): ZodClass<Omit<Super["shape"], keyof Shape> & Shape, InstanceType<Super>>; | ||
}; | ||
} | ||
export declare const Z: Z; | ||
export interface ZodClass<T extends ZodRawShape, Self = {}> extends Omit<ZodObject<T>, "parse" | "parseAsync" | "safeParse" | "safeParseAsync"> { | ||
@@ -17,0 +21,0 @@ [IS_ZOD_CLASS]: true; |
@@ -6,3 +6,3 @@ import { object, } from "zod"; | ||
} | ||
export function Z(Super) { | ||
export const Z = function (Super) { | ||
return { | ||
@@ -26,3 +26,3 @@ parse(value) { | ||
}; | ||
} | ||
}; | ||
/** | ||
@@ -29,0 +29,0 @@ * Creates a class and a Zod schema in one line. |
{ | ||
"name": "zod-class", | ||
"description": "Create classes from Zod Object schemas all in one line", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "url": "https://github.com/sam-goodwin/zod-class" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
73785
226