/** * Custom Zod types for Extend-specific field types. * * These create Zod schemas that will be converted to our extend:type fields. */ import { z } from "zod"; import { DATE_TYPE_MARKER, CURRENCY_TYPE_MARKER, SIGNATURE_TYPE_MARKER } from "./types"; /** * Creates a date field schema. * * In the API, this becomes: * ```json * { "type": ["string", "null"], "extend:type": "date" } * ``` * * The output will always be an ISO date string (yyyy-mm-dd) or null. * * @example * ```typescript * const schema = extendSchema({ * invoice_date: extendDate().describe("The invoice date"), * }); * ``` */ export declare function extendDate(): z.ZodNullable & { _extendType: typeof DATE_TYPE_MARKER; }; /** * Creates a currency field schema. * * In the API, this becomes: * ```json * { * "type": "object", * "extend:type": "currency", * "properties": { * "amount": { "type": ["number", "null"] }, * "iso_4217_currency_code": { "type": ["string", "null"] } * }, * "required": ["amount", "iso_4217_currency_code"] * } * ``` * * @example * ```typescript * const schema = extendSchema({ * total_amount: extendCurrency().describe("Total invoice amount"), * }); * ``` */ export declare function extendCurrency(): z.ZodObject<{ amount: z.ZodNullable; iso_4217_currency_code: z.ZodNullable; }> & { _extendType: typeof CURRENCY_TYPE_MARKER; }; /** * Creates a signature field schema. * * In the API, this becomes: * ```json * { * "type": "object", * "extend:type": "signature", * "properties": { * "printed_name": { "type": ["string", "null"] }, * "signature_date": { "type": ["string", "null"], "extend:type": "date" }, * "is_signed": { "type": ["boolean", "null"] }, * "title_or_role": { "type": ["string", "null"] } * }, * "required": ["printed_name", "signature_date", "is_signed", "title_or_role"] * } * ``` * * @example * ```typescript * const schema = extendSchema({ * customer_signature: extendSignature().describe("Customer's signature"), * }); * ``` */ export declare function extendSignature(): z.ZodObject<{ printed_name: z.ZodNullable; signature_date: z.ZodNullable; is_signed: z.ZodNullable; title_or_role: z.ZodNullable; }> & { _extendType: typeof SIGNATURE_TYPE_MARKER; }; /** * Type guard to check if a schema has an extend type marker. */ export declare function hasExtendType(schema: z.ZodType): schema is z.ZodType & { _extendType: symbol; }; /** * Get the extend type marker from a schema, if present. */ export declare function getExtendType(schema: z.ZodType): symbol | undefined;