UNPKG

zod-v4-mocks

Version:
27 lines (26 loc) 972 B
import { z } from 'zod/v4'; import type { CustomGeneratorType, GeneraterOptions, MockConfig } from './type'; declare class MockGenerator { protected options: GeneraterOptions; constructor(config?: Partial<MockConfig>); /** * @description if return value is undefined, fallback to default generator */ supply(constructor: z.core.$constructor<any>, value: any): MockGenerator; /** * @description if return value is undefined, fallback to default generator */ override(customGenerator: CustomGeneratorType): MockGenerator; register(schemas: z.ZodType[]): this; generate(schema: z.ZodType): unknown; } export type { MockGenerator }; export declare function initGenerator(config?: Partial<MockConfig>): MockGenerator; /** * @deprecated Use generateMock function instead */ export declare class ZodMockGenerator { private config; constructor(config: Partial<MockConfig>); generate(schema: z.ZodType): unknown; }