import { Datasource } from "./types.js"; import { PageAttributes } from "../site/attributes.js"; import z$1 from "zod"; import { nanoid as nanoid$1 } from "nanoid"; //#region src/shared/datasources/utils.d.ts type ToJSONSchemaOptions = Parameters[1]; /** * Converts a Zod schema to JSON Schema. * For `z.iso.datetime()` fields, the pattern accepts both ISO 8601 UTC * (e.g. `2024-01-15T14:30:00Z`) and SQL-style (e.g. `2024-01-15 14:30:00`). */ declare function toJSONSchema(schema: z$1.ZodType, options?: ToJSONSchemaOptions): z$1.core.ZodStandardJSONSchemaPayload>>; declare function stringifyObjectValues(obj: Record): Record; declare function createPlaceholderReplacer(attr?: PageAttributes): (_: unknown, p1: string) => string; declare const placeholderRx: RegExp; /** * Map a datasource schema to include $id, $createdAt, and $updatedAt properties. */ declare function mapDatasourceSchemaWithInternalProperties(schema: z$1.ZodObject): z$1.ZodObject<(keyof T & ("$creationDate" | "$id" | "$lastModificationDate") extends never ? T & { $id: z$1.ZodDefault; $creationDate: z$1.ZodDefault; $lastModificationDate: z$1.ZodDefault; } : { [K in keyof T as K extends "$creationDate" | "$id" | "$lastModificationDate" ? never : K]: T[K] } & { $id: z$1.ZodDefault; $creationDate: z$1.ZodDefault; $lastModificationDate: z$1.ZodDefault; }) extends infer T_1 ? { [k in keyof T_1]: T_1[k] } : never, z$1.core.$strip>; interface DefineDatasourceManifest> { id: string; label: string; description?: string; provider: "internal"; hidden?: boolean; schema: S; labelBy?: string; indexes?: Datasource["indexes"]; foreignKeys?: Datasource["foreignKeys"]; } /** * For now, defineDatasource() force the usage of a custom (internal) datasource */ declare function defineDatasource>(manifest: DefineDatasourceManifest): Omit & { schema: S; }; //#endregion export { ToJSONSchemaOptions, createPlaceholderReplacer, defineDatasource, mapDatasourceSchemaWithInternalProperties, nanoid$1 as nanoid, placeholderRx, stringifyObjectValues, toJSONSchema }; //# sourceMappingURL=utils.d.ts.map