/** * Constructs a type by excluding `undefined` from `T`. * * @since v0.1.0 */ export type Defined = T extends undefined ? never : T; /** * Returns a given `value`, if it is defined. * * @throws {TypeError} If the `value` is undefined. * * @since v0.9.0 */ export declare function defined(value: T | undefined): T; /** * A type guard that returns `true`, if a given value is not `undefined`. * * @since v0.1.0 */ export declare function isDefined(value: T | undefined): value is Defined; /** * Constructs a type by excluding defined types from `T`. * * @since v0.3.0 */ export type Undefined = T extends undefined ? T : never; /** * A type guard that returns `true` if a given `value` is `undefined`. * * @since v0.1.0 */ export declare function isUndefined(value: unknown): value is undefined; /** * Constructs a type by excluding `null` from `T`. * * Unlike {@link NonNullable}, this type does not exclude `undefined`. * * @since v0.1.0 */ export type NotNull = T extends null ? never : T; /** * Returns a given `value`, if it is not null. * * @throws {TypeError} If the `value` is null. * * @since v0.9.0 */ export declare function notNull(value: T | null): T; /** * A type guard that returns `true` if a given value is not `null`. * * Returns `false`, if a given value is `undefined`. * * @since v0.1.0 */ export declare function isNotNull(value: T | null): value is NotNull; /** * Constructs a type by excluding non-`null` types from `T`. * * @since v0.3.0 */ export type Null = T extends null ? T : never; /** * A type guard that returns `true` if a given value is `null`. * * @since v0.1.0 */ export declare function isNull(value: unknown): value is null; /** * Constructs a type by excluding `null` and `undefined` from `T`. * * Keeping legacy definition (instead of using T & {}) to ensure support of TypeScript prior to v4.9. * * @see NonNullable * * @since v0.1.0 */ export type Present = T extends null | undefined ? never : T; /** * Returns a given `value`, if it is defined and is not null. * * @throws {TypeError} If the `value` is null or undefined. * * @since v0.9.0 */ export declare function present(value: T | null | undefined): T; /** * A type guard that returns `true` if a given `value` is defined and is not `null`. * * @since v0.1.0 */ export declare function isPresent(value: T | null | undefined): value is Present; /** * Constructs a type by excluding non-`null` and defined types from `T`. * * @since v0.1.0 */ export type Absent = T extends null | undefined ? T : never; /** * A type guard that return `true` if a given `value` is `null` or `undefined`. * * @since v0.1.0 */ export declare function isAbsent(value: unknown): value is null | undefined;