import type { NonUndefined, PartialBy } from '@sequelize/utils'; export type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; export type DeepWriteable = { -readonly [K in keyof T]: T[K] extends Function ? T[K] : DeepWriteable; }; /** * Returns all shallow properties that accept `undefined` or `null`. * Does not include Optional properties, only `undefined` or `null`. * * @example * ```typescript * type UndefinedProps = NullishPropertiesOf<{ * id: number | undefined, * createdAt: string | undefined, * firstName: string | null, // nullable properties are included * lastName?: string, // optional properties are not included. * }>; * * // is equal to * * type UndefinedProps = 'id' | 'createdAt' | 'firstName'; * ``` */ export type NullishPropertiesOf = { [P in keyof T]-?: undefined extends T[P] ? P : null extends T[P] ? P : never; }[keyof T]; /** * Makes all shallow properties of an object `optional` if they accept `undefined` or `null` as a value. * * @example * ```typescript * type MyOptionalType = MakeUndefinedOptional<{ * id: number | undefined, * firstName: string, * lastName: string | null, * }>; * * // is equal to * * type MyOptionalType = { * // this property is optional. * id?: number | undefined, * firstName: string, * // this property is optional. * lastName?: string | null, * }; * ``` */ export type MakeNullishOptional = PartialBy>; export type NonUndefinedKeys = { [P in keyof T]: P extends K ? NonUndefined : T[P]; }; export type AllowLowercase = T | Lowercase; export type ConstructorKeys = { [P in keyof T]: T[P] extends new () => any ? P : never; }[keyof T]; type NonConstructorKeys = { [P in keyof T]: T[P] extends new () => any ? never : P; }[keyof T]; export type OmitConstructors = Pick>; export {}; //# sourceMappingURL=types.d.ts.map