import { TailorDBType } from "../../configure/services/tailordb/schema.mjs"; import { TailorField } from "../../configure/types/type.mjs"; import { output } from "../../configure/index.mjs"; import { StandardSchemaV1 } from "@standard-schema/spec"; //#region src/utils/test/index.d.ts /** * Creates a hook function that processes TailorDB table fields * - Uses existing id from data if provided, otherwise generates UUID for id fields * - Recursively processes nested types * - Executes hooks.create for fields with create hooks * - Takes each field from the data's own properties, so a field named after a * member of `Object` such as `toString` is read from the record rather than * from the prototype * @template T - The output type of the hook function * @param type - TailorDB table definition * @returns A function that transforms input data according to field hooks */ export declare function createTailorDBHook>(type: T): (data: unknown, now?: Date) => Partial>; /** * Creates the standard schema definition used to validate seed rows. * Runs the hook, then the table's own `validate`, and the field schema only when * that reported nothing, so both levels of validation report as issues rather * than by throwing. When the table is given, a key the row carries that the table * does not declare is reported as an issue as well, including keys inside nested * objects, so a row that no longer matches the table fails here instead of when * it is applied. * @template T - The output type after validation * @param schemaType - TailorDB field schema for validation * @param hook - Hook function to transform data before validation * @param type - TailorDB table definition; runs its table-level `validate` and * rejects fields it does not declare * @returns Schema object with ~standard section for defineSchema */ export declare function createStandardSchema>(schemaType: TailorField, hook: (data: unknown) => Partial, type?: TailorDBType): { readonly "~standard": { readonly version: 1; readonly vendor: "@tailor-platform/sdk"; readonly validate: (value: unknown) => StandardSchemaV1.Result; }; }; //#endregion