import type { IsEqual } from './checks'; /** * Clone object without properties with undefined value. * `CloneWithoutUndefinedProperties<{foo: 1 | undefined, bar: undefined}>` = * `{foo: 1 | undefined, bar: never}`. */ export type CloneWithoutUndefinedProperties = { [Key in keyof Type]: IsEqual extends true ? never : Type[Key]; }; /** * Exclude type undefined from object properties. * `ExcludeUndefinedFromProperties<{foo: 1 | undefined}>` = `{foo: 1}`. */ export type ExcludeUndefinedFromProperties = { [Key in keyof Type]: Exclude; }; /** * Returns `true` if union type includes `undefined` and `false` otherwise. * `IsIncludeUndefined` = `false`. * `IncludeUndefined` = `true`. */ export type IsIncludeUndefined = true extends (Type extends undefined ? true : never) ? true : false; /** * Alias for void type (to suppress the @typescript-eslint/no-invalid-void-type rule). */ export type Void = void;