import { type SchemaLike } from '@logto/shared/universal'; import type { ZodObject, ZodType, ZodOptional, ZodTypeAny } from 'zod'; export type { SchemaLike, SchemaValue, SchemaValuePrimitive } from '@logto/shared/universal'; type ParseOptional = undefined extends K ? ZodOptional>> : ZodType; export type Guard> = ZodObject<{ [key in keyof T]-?: ParseOptional; }, 'strip', ZodTypeAny, T, T>; export type GeneratedSchema>, Schema extends SchemaLike, Table extends string = string, TableSingular extends string = string> = Readonly<{ table: Table; tableSingular: TableSingular; fields: { [key in Key]: string; }; fieldKeys: readonly Key[]; createGuard: Guard; guard: Guard; updateGuard: Guard>; }>;