import type { FieldDescriptor, FieldFlags, FieldRecord } from './types.js'; import type { InferFieldOutput } from './brand.js'; type FlagsOf = F extends FieldDescriptor ? TF : FieldFlags; type HasFlag = FlagsOf[K] extends true ? true : false; type InsertIncluded = HasFlag extends true ? false : HasFlag extends true ? HasFlag extends true ? false : HasFlag extends true ? false : true : true; type InsertOptional = HasFlag extends true ? true : HasFlag extends true ? true : false; type InsertRequiredKeys = { [K in keyof TFields]: InsertIncluded extends true ? InsertOptional extends true ? never : K : never; }[keyof TFields]; type InsertOptionalKeys = { [K in keyof TFields]: InsertIncluded extends true ? InsertOptional extends true ? K : never : never; }[keyof TFields]; /** Insert input shape: omits auto-managed and PK+(defaultRandom|serial); marks nullable/defaulted fields optional. */ export type InsertProjection = { -readonly [K in InsertRequiredKeys]: InferFieldOutput; } & { -readonly [K in InsertOptionalKeys]?: InferFieldOutput; }; /** Select output shape: includes every field with its nullable status preserved through TOutput. */ export type SelectProjection = { -readonly [K in keyof TFields]: InferFieldOutput; }; type UpdateIncluded = HasFlag extends true ? false : HasFlag extends true ? false : HasFlag extends true ? false : true; type UpdateIncludedKeys = { [K in keyof TFields]: UpdateIncluded extends true ? K : never; }[keyof TFields]; /** Update input shape: omits PK/readOnly/auto-managed; all remaining fields are optional. */ export type UpdateProjection = { -readonly [K in UpdateIncludedKeys]?: InferFieldOutput; }; export {}; //# sourceMappingURL=projections.d.ts.map