UNPKG

2.11 kBTypeScriptView Raw
1export { ArrayUtils } from './array-utils';
2export { Prioritizeable } from './prioritizeable';
3export declare type Deferred<T> = {
4 [P in keyof T]: Promise<T[P]>;
5};
6export declare type MaybeArray<T> = T | T[];
7export declare type MaybeNull<T> = {
8 [P in keyof T]: T[P] | null;
9};
10export declare type MaybePromise<T> = T | PromiseLike<T>;
11export declare type MaybeUndefined<T> = {
12 [P in keyof T]?: T[P] | undefined;
13};
14export declare type Mutable<T> = {
15 -readonly [P in keyof T]: T[P];
16};
17export declare type RecursivePartial<T> = {
18 [P in keyof T]?: T[P] extends (infer I)[] ? RecursivePartial<I>[] : RecursivePartial<T[P]>;
19};
20export declare function isBoolean(value: unknown): value is boolean;
21export declare function isString(value: unknown): value is string;
22export declare function isNumber(value: unknown): value is number;
23export declare function isError(value: unknown): value is Error;
24export declare function isErrorLike(value: unknown): value is Error;
25export declare function isFunction<T extends (...args: unknown[]) => unknown>(value: unknown): value is T;
26export declare function isObject<T = Record<string | number | symbol, unknown>>(value: unknown): value is T;
27export declare function isUndefined(value: unknown): value is undefined;
28/**
29 * @param value value to check.
30 * @param every optional predicate ran on every element of the array.
31 * @param thisArg value to substitute `this` with when invoking in the predicate.
32 * @returns whether or not `value` is an array.
33 */
34export declare function isArray<T>(value: unknown, every?: (value: unknown) => unknown, thisArg?: unknown): value is T[];
35export declare function isStringArray(value: unknown): value is string[];
36/**
37 * Creates a shallow copy with all ownkeys of the original object that are `null` made `undefined`
38 */
39export declare function nullToUndefined<T>(nullable: MaybeNull<T>): MaybeUndefined<T>;
40/**
41 * Throws when called and statically makes sure that all variants of a type were consumed.
42 */
43export declare function unreachable(_never: never, message?: string): never;
44//# sourceMappingURL=types.d.ts.map
\No newline at end of file