import type { TObject, TSchema } from "@sinclair/typebox"; import { JavaScriptType } from "./typebox-types.js"; /** * Information about a TypeBox schema that's cached to improve the * performance of `parseFormFields()`. */ export interface SchemaInfo { schema: T; fieldNames: string[]; fields: Record; defaultObject: Record; } /** * Information about a property of a TypeBox schema that's cached to * improve the performance of `parseFormFields()`. */ export interface FieldInfo { fieldName: string | null; fieldType: JavaScriptType; memberType: JavaScriptType | null; isNullable: boolean; isOptional: boolean; hasDefault: boolean; defaultValue: unknown; } /** * Extracts the information from a TypeBox schema needed to parse form data * and query parameters, caching the information to improve performance. * @param schema A TypeBox schema defining an object. * @param modify A function that can extend the cached schema information * with additional information needed by the application. * @returns Cached information about the schema. */ export declare function getSchemaInfo>(schema: T, extend?: (schemaInfo: SchemaInfo) => U): U; /** * Clears the cache of schema information. This is useful for testing. */ export declare function clearSchemaInfoCache(): void; export declare function getDefaultValue(fieldInfo: FieldInfo): unknown; //# sourceMappingURL=schema-info.d.ts.map