/** * @module validators/metadata * @description WeakMap-backed metadata storage for validator schemas. * Allows client configuration and options to be associated with Zod schemas * without modifying the schema objects themselves. */ import type { z } from "zod/v4"; import type { BaseOptions } from "../types.js"; import type { SchemaMetadata } from "../types/inference.js"; /** * Attach metadata to a Zod schema. * @param schema The Zod schema to attach metadata to * @param options The options containing metadata */ export declare function attachMetadata(schema: z.ZodType, options?: BaseOptions): void; /** * Get metadata from a Zod schema. * Retrieves the attached options and client configuration from a validator. * * @param schema - The Zod schema to get metadata from * @returns The attached metadata or undefined * * @example * Checking if a validator is client-exposed * ```ts * const validator = str({ client: { expose: true } }); * const metadata = getMetadata(validator); * console.log(metadata?.client?.expose); // true * ``` * * @example * Getting validator description * ```ts * const validator = num({ description: 'Port number' }); * const metadata = getMetadata(validator); * console.log(metadata?.options.description); // 'Port number' * ``` */ export declare function getMetadata(schema: z.ZodType): SchemaMetadata | undefined;