import { CoDiscriminatedUnionSchema, CoValueClass, CoreCoFeedSchema, CoreCoListSchema, CoreCoMapSchema, CoreCoRecordSchema, CoreCoVectorSchema, CorePlainTextSchema, Simplify, CoreSnapshotRefSchema, SnapshotRef, InstanceOfSchemaCoValuesMaybeLoaded } from "../../../internal.js"; import { CoreCoOptionalSchema } from "../schemaTypes/CoOptionalSchema.js"; import { CoreCoValueSchema } from "../schemaTypes/CoValueSchema.js"; import { CoreRichTextSchema } from "../schemaTypes/RichTextSchema.js"; import { z } from "../zodReExport.js"; import { AnyZodOrCoValueSchema, Loaded } from "../zodSchema.js"; import { TypeOfZodSchema } from "./TypeOfZodSchema.js"; /** * The type of value that can be used to initialize a CoField of the given schema. * * For CoValue fields, this can be either a shallowly-loaded CoValue instance * or a JSON object that will be used to create the CoValue. */ export type CoFieldSchemaInit = S extends CoreCoValueSchema ? S extends CoreSnapshotRefSchema ? SnapshotRef> : Loaded | (S extends CoreCoRecordSchema ? CoMapSchemaInit<{ [key in z.output & string]: V; }> : S extends CoreCoMapSchema ? CoMapSchemaInit : S extends CoreCoListSchema ? CoListSchemaInit : S extends CoreCoFeedSchema ? CoFeedSchemaInit : S extends CoreCoVectorSchema ? CoVectorSchemaInit : S extends CorePlainTextSchema | CoreRichTextSchema ? string : S extends CoreCoOptionalSchema ? CoFieldSchemaInit | undefined : S extends CoDiscriminatedUnionSchema ? CoFieldSchemaInit : never) : S extends z.core.$ZodType ? TypeOfZodSchema : S extends CoValueClass ? InstanceType : never; export type CoMapSchemaInit = Simplify<{ [Key in keyof Shape as Shape[Key] extends CoreCoOptionalSchema | z.core.$ZodOptional ? never : Key]: CoFieldSchemaInit; } & { [Key in keyof Shape as Shape[Key] extends CoreCoOptionalSchema | z.core.$ZodOptional ? Key : never]?: CoFieldSchemaInit; }>; export type CoListSchemaInit = Simplify>>; export type CoFeedSchemaInit = Simplify>>; export type CoVectorSchemaInit = ReadonlyArray | Float32Array; /** * The convenience type for extracting the init type of a CoValue schema. */ export type CoInput = S extends CoreCoValueSchema ? Exclude, Loaded> : CoFieldSchemaInit; //# sourceMappingURL=CoFieldSchemaInit.d.ts.map