import { z, ZodObject } from "zod"; import { ZodRawShape } from "zod/lib/types"; import { Identifiable } from "../identifiable"; export declare const UnsafeEntitySymbol: symbol; export declare const EntitySymbol: symbol; export type EntityCore = Identifiable & { createdAt: Date; updatedAt: Date; }; export declare const EntityCoreShape: { id: z.ZodString; createdAt: z.ZodDate; updatedAt: z.ZodDate; }; export type EntityCoreShapeType = typeof EntityCoreShape; type EntityFn
= { copy: (fields: Partial
) => Zentity
; toPlain: () => P & EntityCore; }; type NonBrandedEntity
= EntityCore & P & EntityFn
& E; export type UnsafeZentity
= NonBrandedEntity
& { _brand: typeof UnsafeEntitySymbol; validate: () => Zentity
; }; export type Zentity
= UnsafeZentity
& {
_safe: typeof EntitySymbol;
};
export declare function isZentity(data: any): data is Zentity = {
name: string;
create: (params: ZodShapeType & EntityCore) => Zentity & {
id: string;
}) => Zentity & EntityCore) => UnsafeZentity;
shape: S & EntityCoreShapeType;
extend: (e: EntityCore & ZodShapeType) => R;
};
export type inferPlainTypeFromClass & EntityCore : never;
export type inferZentityTypeFromClass & R : never;
export type inferEntity = z.infer = (e: EntityCore & ZodShapeType) => R;
export declare function entity(options: {
name: string;
shape: S;
extend?: Extender;
}): EntityClass;
export {};
//# sourceMappingURL=zentity.d.ts.map