diff --git a/src/types/index.ts b/src/types/index.ts index 5178bec8..11a8daed 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -44,8 +44,11 @@ export type { default as OmitByType } from './omit-by-type.type' export type { default as OneOrMany } from './one-or-many.type' export type { default as OrDeepPartial } from './or-deep-partial.type' export type { default as OrNever } from './or-never.type' +export type { default as OrNil } from './or-nil.type' +export type { default as OrNull } from './or-null.type' export type { default as OrPartial } from './or-partial.type' export type { default as OrPromise } from './or-promise.type' +export type { default as OrUndefined } from './or-undefined.type' export type { default as Overwrite } from './overwrite.type' export type { default as PartialByRequired } from './partial-by-required.type' export type { default as PartialBy } from './partial-by.type' diff --git a/src/types/or-nil.type.ts b/src/types/or-nil.type.ts new file mode 100644 index 00000000..56d1cc12 --- /dev/null +++ b/src/types/or-nil.type.ts @@ -0,0 +1,15 @@ +import type NIL from './nil.type' + +/** + * @file Type Definitions - OrNil + * @module tutils/types/OrNil + */ + +/** + * Type representing a value that also be `NIL`. + * + * @template T - Value type + */ +type OrNil = T | NIL + +export default OrNil diff --git a/src/types/or-null.type.ts b/src/types/or-null.type.ts new file mode 100644 index 00000000..0b1866ed --- /dev/null +++ b/src/types/or-null.type.ts @@ -0,0 +1,13 @@ +/** + * @file Type Definitions - OrNull + * @module tutils/types/OrNull + */ + +/** + * Type representing a value that also be `null`. + * + * @template T - Value type + */ +type OrNull = T | null + +export default OrNull diff --git a/src/types/or-undefined.type.ts b/src/types/or-undefined.type.ts new file mode 100644 index 00000000..45f62c83 --- /dev/null +++ b/src/types/or-undefined.type.ts @@ -0,0 +1,13 @@ +/** + * @file Type Definitions - OrUndefined + * @module tutils/types/OrUndefined + */ + +/** + * Type representing a value that also be `undefined`. + * + * @template T - Value type + */ +type OrUndefined = T | undefined + +export default OrUndefined