import type {OptionalKeysOf} from './optional-keys-of'; /** Creates a type that represents `true` or `false` depending on whether the given type has any optional fields. This is useful when you want to create an API whose behavior depends on the presence or absence of optional fields. @example ``` import type {HasOptionalKeys, OptionalKeysOf} from 'type-fest'; type UpdateService = { removeField: HasOptionalKeys extends true ? (field: OptionalKeysOf) => Promise : never } ``` @category Utilities */ export type HasOptionalKeys = OptionalKeysOf extends never ? false : true;