UNPKG

@tinybirdco/mockingbird

Version:
70 lines 2.07 kB
import { z } from "zod"; import { Row } from "../types"; export declare const schemaSchema: z.ZodRecord<z.ZodString, z.ZodObject<{ type: z.ZodString; params: z.ZodOptional<z.ZodAny>; count: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { type: string; count?: number | undefined; params?: any; }, { type: string; count?: number | undefined; params?: any; }>>; export declare const baseConfigSchema: z.ZodObject<{ schema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{ type: z.ZodString; params: z.ZodOptional<z.ZodAny>; count: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { type: string; count?: number | undefined; params?: any; }, { type: string; count?: number | undefined; params?: any; }>>, Record<string, { type: string; count?: number | undefined; params?: any; }>, Record<string, { type: string; count?: number | undefined; params?: any; }>>; eps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; logs: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; }, "strip", z.ZodTypeAny, { schema: Record<string, { type: string; count?: number | undefined; params?: any; }>; eps: number; limit: number; logs?: boolean | undefined; }, { schema: Record<string, { type: string; count?: number | undefined; params?: any; }>; eps?: number | undefined; limit?: number | undefined; logs?: boolean | undefined; }>; export type BaseConfig = z.infer<typeof baseConfigSchema>; export declare abstract class BaseGenerator<C extends BaseConfig> { config: C; private state; abstract sendData(data: Row[]): Promise<void>; constructor(config: C); log(level: "info" | "error", message: string): void; generateRow(): Row; generate(onMessage?: (data: Row[]) => void): Promise<void>; } //# sourceMappingURL=BaseGenerator.d.ts.map