1 | import type { ArrayLike, Class, Falsy, NodeStream, NonEmptyString, ObservableLike, Predicate, Primitive, TypedArray, WeakRef, Whitespace } from './types.js';
|
2 | type ExtractFromGlobalConstructors<Name extends string> = Name extends string ? typeof globalThis extends Record<Name, new (...arguments_: any[]) => infer T> ? T : never : never;
|
3 | type NodeBuffer = ExtractFromGlobalConstructors<'Buffer'>;
|
4 | declare const objectTypeNames: readonly ["Function", "Generator", "AsyncGenerator", "GeneratorFunction", "AsyncGeneratorFunction", "AsyncFunction", "Observable", "Array", "Buffer", "Blob", "Object", "RegExp", "Date", "Error", "Map", "Set", "WeakMap", "WeakSet", "WeakRef", "ArrayBuffer", "SharedArrayBuffer", "DataView", "Promise", "URL", "FormData", "URLSearchParams", "HTMLElement", "NaN", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array"];
|
5 | type ObjectTypeName = typeof objectTypeNames[number];
|
6 | declare const primitiveTypeNames: readonly ["null", "undefined", "string", "number", "bigint", "boolean", "symbol"];
|
7 | type PrimitiveTypeName = typeof primitiveTypeNames[number];
|
8 | export type TypeName = ObjectTypeName | PrimitiveTypeName;
|
9 | declare const assertionTypeDescriptions: readonly ["positive number", "negative number", "Class", "string with a number", "null or undefined", "Iterable", "AsyncIterable", "native Promise", "EnumCase", "string with a URL", "truthy", "falsy", "primitive", "integer", "plain object", "TypedArray", "array-like", "tuple-like", "Node.js Stream", "infinite number", "empty array", "non-empty array", "empty string", "empty string or whitespace", "non-empty string", "non-empty string and not whitespace", "empty object", "non-empty object", "empty set", "non-empty set", "empty map", "non-empty map", "PropertyKey", "even integer", "odd integer", "T", "in range", "predicate returns truthy for any value", "predicate returns truthy for all values", "valid Date", "valid length", "whitespace string", "Function", "Generator", "AsyncGenerator", "GeneratorFunction", "AsyncGeneratorFunction", "AsyncFunction", "Observable", "Array", "Buffer", "Blob", "Object", "RegExp", "Date", "Error", "Map", "Set", "WeakMap", "WeakSet", "WeakRef", "ArrayBuffer", "SharedArrayBuffer", "DataView", "Promise", "URL", "FormData", "URLSearchParams", "HTMLElement", "NaN", "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array", "null", "undefined", "string", "number", "bigint", "boolean", "symbol"];
|
10 | export type AssertionTypeDescription = typeof assertionTypeDescriptions[number];
|
11 | declare function detect(value: unknown): TypeName;
|
12 | declare const is: typeof detect & {
|
13 | all: typeof isAll;
|
14 | any: typeof isAny;
|
15 | array: typeof isArray;
|
16 | arrayBuffer: typeof isArrayBuffer;
|
17 | arrayLike: typeof isArrayLike;
|
18 | asyncFunction: typeof isAsyncFunction;
|
19 | asyncGenerator: typeof isAsyncGenerator;
|
20 | asyncGeneratorFunction: typeof isAsyncGeneratorFunction;
|
21 | asyncIterable: typeof isAsyncIterable;
|
22 | bigint: typeof isBigint;
|
23 | bigInt64Array: typeof isBigInt64Array;
|
24 | bigUint64Array: typeof isBigUint64Array;
|
25 | blob: typeof isBlob;
|
26 | boolean: typeof isBoolean;
|
27 | boundFunction: typeof isBoundFunction;
|
28 | buffer: typeof isBuffer;
|
29 | class: typeof isClass;
|
30 | dataView: typeof isDataView;
|
31 | date: typeof isDate;
|
32 | detect: typeof detect;
|
33 | directInstanceOf: typeof isDirectInstanceOf;
|
34 | emptyArray: typeof isEmptyArray;
|
35 | emptyMap: typeof isEmptyMap;
|
36 | emptyObject: typeof isEmptyObject;
|
37 | emptySet: typeof isEmptySet;
|
38 | emptyString: typeof isEmptyString;
|
39 | emptyStringOrWhitespace: typeof isEmptyStringOrWhitespace;
|
40 | enumCase: typeof isEnumCase;
|
41 | error: typeof isError;
|
42 | evenInteger: typeof isEvenInteger;
|
43 | falsy: typeof isFalsy;
|
44 | float32Array: typeof isFloat32Array;
|
45 | float64Array: typeof isFloat64Array;
|
46 | formData: typeof isFormData;
|
47 | function: typeof isFunction;
|
48 | generator: typeof isGenerator;
|
49 | generatorFunction: typeof isGeneratorFunction;
|
50 | htmlElement: typeof isHtmlElement;
|
51 | infinite: typeof isInfinite;
|
52 | inRange: typeof isInRange;
|
53 | int16Array: typeof isInt16Array;
|
54 | int32Array: typeof isInt32Array;
|
55 | int8Array: typeof isInt8Array;
|
56 | integer: typeof isInteger;
|
57 | iterable: typeof isIterable;
|
58 | map: typeof isMap;
|
59 | nan: typeof isNan;
|
60 | nativePromise: typeof isNativePromise;
|
61 | negativeNumber: typeof isNegativeNumber;
|
62 | nodeStream: typeof isNodeStream;
|
63 | nonEmptyArray: typeof isNonEmptyArray;
|
64 | nonEmptyMap: typeof isNonEmptyMap;
|
65 | nonEmptyObject: typeof isNonEmptyObject;
|
66 | nonEmptySet: typeof isNonEmptySet;
|
67 | nonEmptyString: typeof isNonEmptyString;
|
68 | nonEmptyStringAndNotWhitespace: typeof isNonEmptyStringAndNotWhitespace;
|
69 | null: typeof isNull;
|
70 | nullOrUndefined: typeof isNullOrUndefined;
|
71 | number: typeof isNumber;
|
72 | numericString: typeof isNumericString;
|
73 | object: typeof isObject;
|
74 | observable: typeof isObservable;
|
75 | oddInteger: typeof isOddInteger;
|
76 | plainObject: typeof isPlainObject;
|
77 | positiveNumber: typeof isPositiveNumber;
|
78 | primitive: typeof isPrimitive;
|
79 | promise: typeof isPromise;
|
80 | propertyKey: typeof isPropertyKey;
|
81 | regExp: typeof isRegExp;
|
82 | safeInteger: typeof isSafeInteger;
|
83 | set: typeof isSet;
|
84 | sharedArrayBuffer: typeof isSharedArrayBuffer;
|
85 | string: typeof isString;
|
86 | symbol: typeof isSymbol;
|
87 | truthy: typeof isTruthy;
|
88 | tupleLike: typeof isTupleLike;
|
89 | typedArray: typeof isTypedArray;
|
90 | uint16Array: typeof isUint16Array;
|
91 | uint32Array: typeof isUint32Array;
|
92 | uint8Array: typeof isUint8Array;
|
93 | uint8ClampedArray: typeof isUint8ClampedArray;
|
94 | undefined: typeof isUndefined;
|
95 | urlInstance: typeof isUrlInstance;
|
96 | urlSearchParams: typeof isUrlSearchParams;
|
97 | urlString: typeof isUrlString;
|
98 | validDate: typeof isValidDate;
|
99 | validLength: typeof isValidLength;
|
100 | weakMap: typeof isWeakMap;
|
101 | weakRef: typeof isWeakRef;
|
102 | weakSet: typeof isWeakSet;
|
103 | whitespaceString: typeof isWhitespaceString;
|
104 | };
|
105 | export declare function isAll(predicate: Predicate, ...values: unknown[]): boolean;
|
106 | export declare function isAny(predicate: Predicate | Predicate[], ...values: unknown[]): boolean;
|
107 | export declare function isArray<T = unknown>(value: unknown, assertion?: (value: T) => value is T): value is T[];
|
108 | export declare function isArrayBuffer(value: unknown): value is ArrayBuffer;
|
109 | export declare function isArrayLike<T = unknown>(value: unknown): value is ArrayLike<T>;
|
110 | export declare function isAsyncFunction<T = unknown>(value: unknown): value is ((...arguments_: any[]) => Promise<T>);
|
111 | export declare function isAsyncGenerator(value: unknown): value is AsyncGenerator;
|
112 | export declare function isAsyncGeneratorFunction(value: unknown): value is ((...arguments_: any[]) => Promise<unknown>);
|
113 | export declare function isAsyncIterable<T = unknown>(value: unknown): value is AsyncIterable<T>;
|
114 | export declare function isBigint(value: unknown): value is bigint;
|
115 | export declare function isBigInt64Array(value: unknown): value is BigInt64Array;
|
116 | export declare function isBigUint64Array(value: unknown): value is BigUint64Array;
|
117 | export declare function isBlob(value: unknown): value is Blob;
|
118 | export declare function isBoolean(value: unknown): value is boolean;
|
119 | export declare function isBoundFunction(value: unknown): value is Function;
|
120 |
|
121 |
|
122 |
|
123 | export declare function isBuffer(value: unknown): value is NodeBuffer;
|
124 | export declare function isClass<T = unknown>(value: unknown): value is Class<T>;
|
125 | export declare function isDataView(value: unknown): value is DataView;
|
126 | export declare function isDate(value: unknown): value is Date;
|
127 | export declare function isDirectInstanceOf<T>(instance: unknown, class_: Class<T>): instance is T;
|
128 | export declare function isEmptyArray(value: unknown): value is never[];
|
129 | export declare function isEmptyMap(value: unknown): value is Map<never, never>;
|
130 | export declare function isEmptyObject<Key extends keyof any = string>(value: unknown): value is Record<Key, never>;
|
131 | export declare function isEmptySet(value: unknown): value is Set<never>;
|
132 | export declare function isEmptyString(value: unknown): value is '';
|
133 | export declare function isEmptyStringOrWhitespace(value: unknown): value is '' | Whitespace;
|
134 | export declare function isEnumCase<T = unknown>(value: unknown, targetEnum: T): value is T[keyof T];
|
135 | export declare function isError(value: unknown): value is Error;
|
136 | export declare function isEvenInteger(value: unknown): value is number;
|
137 | export declare function isFalsy(value: unknown): value is Falsy;
|
138 | export declare function isFloat32Array(value: unknown): value is Float32Array;
|
139 | export declare function isFloat64Array(value: unknown): value is Float64Array;
|
140 | export declare function isFormData(value: unknown): value is FormData;
|
141 | export declare function isFunction(value: unknown): value is Function;
|
142 | export declare function isGenerator(value: unknown): value is Generator;
|
143 | export declare function isGeneratorFunction(value: unknown): value is GeneratorFunction;
|
144 | export declare function isHtmlElement(value: unknown): value is HTMLElement;
|
145 | export declare function isInfinite(value: unknown): value is number;
|
146 | export declare function isInRange(value: number, range: number | [number, number]): value is number;
|
147 | export declare function isInt16Array(value: unknown): value is Int16Array;
|
148 | export declare function isInt32Array(value: unknown): value is Int32Array;
|
149 | export declare function isInt8Array(value: unknown): value is Int8Array;
|
150 | export declare function isInteger(value: unknown): value is number;
|
151 | export declare function isIterable<T = unknown>(value: unknown): value is Iterable<T>;
|
152 | export declare function isMap<Key = unknown, Value = unknown>(value: unknown): value is Map<Key, Value>;
|
153 | export declare function isNan(value: unknown): boolean;
|
154 | export declare function isNativePromise<T = unknown>(value: unknown): value is Promise<T>;
|
155 | export declare function isNegativeNumber(value: unknown): value is number;
|
156 | export declare function isNodeStream(value: unknown): value is NodeStream;
|
157 | export declare function isNonEmptyArray<T = unknown, Item = unknown>(value: T | Item[]): value is [Item, ...Item[]];
|
158 | export declare function isNonEmptyMap<Key = unknown, Value = unknown>(value: unknown): value is Map<Key, Value>;
|
159 | export declare function isNonEmptyObject<Key extends keyof any = string, Value = unknown>(value: unknown): value is Record<Key, Value>;
|
160 | export declare function isNonEmptySet<T = unknown>(value: unknown): value is Set<T>;
|
161 | export declare function isNonEmptyString(value: unknown): value is NonEmptyString;
|
162 | export declare function isNonEmptyStringAndNotWhitespace(value: unknown): value is NonEmptyString;
|
163 | export declare function isNull(value: unknown): value is null;
|
164 | export declare function isNullOrUndefined(value: unknown): value is null | undefined;
|
165 | export declare function isNumber(value: unknown): value is number;
|
166 | export declare function isNumericString(value: unknown): value is `${number}`;
|
167 | export declare function isObject(value: unknown): value is object;
|
168 | export declare function isObservable(value: unknown): value is ObservableLike;
|
169 | export declare function isOddInteger(value: unknown): value is number;
|
170 | export declare function isPlainObject<Value = unknown>(value: unknown): value is Record<PropertyKey, Value>;
|
171 | export declare function isPositiveNumber(value: unknown): value is number;
|
172 | export declare function isPrimitive(value: unknown): value is Primitive;
|
173 | export declare function isPromise<T = unknown>(value: unknown): value is Promise<T>;
|
174 | export declare function isPropertyKey(value: unknown): value is PropertyKey;
|
175 | export declare function isRegExp(value: unknown): value is RegExp;
|
176 | export declare function isSafeInteger(value: unknown): value is number;
|
177 | export declare function isSet<T = unknown>(value: unknown): value is Set<T>;
|
178 | export declare function isSharedArrayBuffer(value: unknown): value is SharedArrayBuffer;
|
179 | export declare function isString(value: unknown): value is string;
|
180 | export declare function isSymbol(value: unknown): value is symbol;
|
181 | export declare function isTruthy<T>(value: T | Falsy): value is T;
|
182 | type TypeGuard<T> = (value: unknown) => value is T;
|
183 | type ResolveTypesOfTypeGuardsTuple<TypeGuardsOfT, ResultOfT extends unknown[] = []> = TypeGuardsOfT extends [TypeGuard<infer U>, ...infer TOthers] ? ResolveTypesOfTypeGuardsTuple<TOthers, [...ResultOfT, U]> : TypeGuardsOfT extends undefined[] ? ResultOfT : never;
|
184 | export declare function isTupleLike<T extends Array<TypeGuard<unknown>>>(value: unknown, guards: [...T]): value is ResolveTypesOfTypeGuardsTuple<T>;
|
185 | export declare function isTypedArray(value: unknown): value is TypedArray;
|
186 | export declare function isUint16Array(value: unknown): value is Uint16Array;
|
187 | export declare function isUint32Array(value: unknown): value is Uint32Array;
|
188 | export declare function isUint8Array(value: unknown): value is Uint8Array;
|
189 | export declare function isUint8ClampedArray(value: unknown): value is Uint8ClampedArray;
|
190 | export declare function isUndefined(value: unknown): value is undefined;
|
191 | export declare function isUrlInstance(value: unknown): value is URL;
|
192 | export declare function isUrlSearchParams(value: unknown): value is URLSearchParams;
|
193 | export declare function isUrlString(value: unknown): value is string;
|
194 | export declare function isValidDate(value: unknown): value is Date;
|
195 | export declare function isValidLength(value: unknown): value is number;
|
196 | export declare function isWeakMap<Key extends object = object, Value = unknown>(value: unknown): value is WeakMap<Key, Value>;
|
197 | export declare function isWeakRef(value: unknown): value is WeakRef<object>;
|
198 | export declare function isWeakSet(value: unknown): value is WeakSet<object>;
|
199 | export declare function isWhitespaceString(value: unknown): value is Whitespace;
|
200 | type Assert = {
|
201 | undefined: (value: unknown, message?: string) => asserts value is undefined;
|
202 | string: (value: unknown, message?: string) => asserts value is string;
|
203 | number: (value: unknown, message?: string) => asserts value is number;
|
204 | positiveNumber: (value: unknown, message?: string) => asserts value is number;
|
205 | negativeNumber: (value: unknown, message?: string) => asserts value is number;
|
206 | bigint: (value: unknown, message?: string) => asserts value is bigint;
|
207 | function: (value: unknown, message?: string) => asserts value is Function;
|
208 | null: (value: unknown, message?: string) => asserts value is null;
|
209 | class: <T = unknown>(value: unknown, message?: string) => asserts value is Class<T>;
|
210 | boolean: (value: unknown, message?: string) => asserts value is boolean;
|
211 | symbol: (value: unknown, message?: string) => asserts value is symbol;
|
212 | numericString: (value: unknown, message?: string) => asserts value is `${number}`;
|
213 | array: <T = unknown>(value: unknown, assertion?: (element: unknown) => asserts element is T, message?: string) => asserts value is T[];
|
214 | buffer: (value: unknown, message?: string) => asserts value is NodeBuffer;
|
215 | blob: (value: unknown, message?: string) => asserts value is Blob;
|
216 | nullOrUndefined: (value: unknown, message?: string) => asserts value is null | undefined;
|
217 | object: <Key extends keyof any = string, Value = unknown>(value: unknown, message?: string) => asserts value is Record<Key, Value>;
|
218 | iterable: <T = unknown>(value: unknown, message?: string) => asserts value is Iterable<T>;
|
219 | asyncIterable: <T = unknown>(value: unknown, message?: string) => asserts value is AsyncIterable<T>;
|
220 | generator: (value: unknown, message?: string) => asserts value is Generator;
|
221 | asyncGenerator: (value: unknown, message?: string) => asserts value is AsyncGenerator;
|
222 | nativePromise: <T = unknown>(value: unknown, message?: string) => asserts value is Promise<T>;
|
223 | promise: <T = unknown>(value: unknown, message?: string) => asserts value is Promise<T>;
|
224 | generatorFunction: (value: unknown, message?: string) => asserts value is GeneratorFunction;
|
225 | asyncGeneratorFunction: (value: unknown, message?: string) => asserts value is AsyncGeneratorFunction;
|
226 | asyncFunction: (value: unknown, message?: string) => asserts value is Function;
|
227 | boundFunction: (value: unknown, message?: string) => asserts value is Function;
|
228 | regExp: (value: unknown, message?: string) => asserts value is RegExp;
|
229 | date: (value: unknown, message?: string) => asserts value is Date;
|
230 | error: (value: unknown, message?: string) => asserts value is Error;
|
231 | map: <Key = unknown, Value = unknown>(value: unknown, message?: string) => asserts value is Map<Key, Value>;
|
232 | set: <T = unknown>(value: unknown, message?: string) => asserts value is Set<T>;
|
233 | weakMap: <Key extends object = object, Value = unknown>(value: unknown, message?: string) => asserts value is WeakMap<Key, Value>;
|
234 | weakSet: <T extends object = object>(value: unknown, message?: string) => asserts value is WeakSet<T>;
|
235 | weakRef: <T extends object = object>(value: unknown, message?: string) => asserts value is WeakRef<T>;
|
236 | int8Array: (value: unknown, message?: string) => asserts value is Int8Array;
|
237 | uint8Array: (value: unknown, message?: string) => asserts value is Uint8Array;
|
238 | uint8ClampedArray: (value: unknown, message?: string) => asserts value is Uint8ClampedArray;
|
239 | int16Array: (value: unknown, message?: string) => asserts value is Int16Array;
|
240 | uint16Array: (value: unknown, message?: string) => asserts value is Uint16Array;
|
241 | int32Array: (value: unknown, message?: string) => asserts value is Int32Array;
|
242 | uint32Array: (value: unknown, message?: string) => asserts value is Uint32Array;
|
243 | float32Array: (value: unknown, message?: string) => asserts value is Float32Array;
|
244 | float64Array: (value: unknown, message?: string) => asserts value is Float64Array;
|
245 | bigInt64Array: (value: unknown, message?: string) => asserts value is BigInt64Array;
|
246 | bigUint64Array: (value: unknown, message?: string) => asserts value is BigUint64Array;
|
247 | arrayBuffer: (value: unknown, message?: string) => asserts value is ArrayBuffer;
|
248 | sharedArrayBuffer: (value: unknown, message?: string) => asserts value is SharedArrayBuffer;
|
249 | dataView: (value: unknown, message?: string) => asserts value is DataView;
|
250 | enumCase: <T = unknown>(value: unknown, targetEnum: T, message?: string) => asserts value is T[keyof T];
|
251 | urlInstance: (value: unknown, message?: string) => asserts value is URL;
|
252 | urlString: (value: unknown, message?: string) => asserts value is string;
|
253 | truthy: <T>(value: T | Falsy, message?: string) => asserts value is T;
|
254 | falsy: (value: unknown, message?: string) => asserts value is Falsy;
|
255 | nan: (value: unknown, message?: string) => asserts value is number;
|
256 | primitive: (value: unknown, message?: string) => asserts value is Primitive;
|
257 | integer: (value: unknown, message?: string) => asserts value is number;
|
258 | safeInteger: (value: unknown, message?: string) => asserts value is number;
|
259 | plainObject: <Value = unknown>(value: unknown, message?: string) => asserts value is Record<PropertyKey, Value>;
|
260 | typedArray: (value: unknown, message?: string) => asserts value is TypedArray;
|
261 | arrayLike: <T = unknown>(value: unknown, message?: string) => asserts value is ArrayLike<T>;
|
262 | tupleLike: <T extends Array<TypeGuard<unknown>>>(value: unknown, guards: [...T], message?: string) => asserts value is ResolveTypesOfTypeGuardsTuple<T>;
|
263 | htmlElement: (value: unknown, message?: string) => asserts value is HTMLElement;
|
264 | observable: (value: unknown, message?: string) => asserts value is ObservableLike;
|
265 | nodeStream: (value: unknown, message?: string) => asserts value is NodeStream;
|
266 | infinite: (value: unknown, message?: string) => asserts value is number;
|
267 | emptyArray: (value: unknown, message?: string) => asserts value is never[];
|
268 | nonEmptyArray: <T = unknown, Item = unknown>(value: T | Item[], message?: string) => asserts value is [Item, ...Item[]];
|
269 | emptyString: (value: unknown, message?: string) => asserts value is '';
|
270 | emptyStringOrWhitespace: (value: unknown, message?: string) => asserts value is '' | Whitespace;
|
271 | nonEmptyString: (value: unknown, message?: string) => asserts value is string;
|
272 | nonEmptyStringAndNotWhitespace: (value: unknown, message?: string) => asserts value is string;
|
273 | emptyObject: <Key extends keyof any = string>(value: unknown, message?: string) => asserts value is Record<Key, never>;
|
274 | nonEmptyObject: <Key extends keyof any = string, Value = unknown>(value: unknown, message?: string) => asserts value is Record<Key, Value>;
|
275 | emptySet: (value: unknown, message?: string) => asserts value is Set<never>;
|
276 | nonEmptySet: <T = unknown>(value: unknown, message?: string) => asserts value is Set<T>;
|
277 | emptyMap: (value: unknown, message?: string) => asserts value is Map<never, never>;
|
278 | nonEmptyMap: <Key = unknown, Value = unknown>(value: unknown, message?: string) => asserts value is Map<Key, Value>;
|
279 | propertyKey: (value: unknown, message?: string) => asserts value is PropertyKey;
|
280 | formData: (value: unknown, message?: string) => asserts value is FormData;
|
281 | urlSearchParams: (value: unknown, message?: string) => asserts value is URLSearchParams;
|
282 | validDate: (value: unknown, message?: string) => asserts value is Date;
|
283 | validLength: (value: unknown, message?: string) => asserts value is number;
|
284 | whitespaceString: (value: unknown, message?: string) => asserts value is string;
|
285 | evenInteger: (value: number, message?: string) => asserts value is number;
|
286 | oddInteger: (value: number, message?: string) => asserts value is number;
|
287 | directInstanceOf: <T>(instance: unknown, class_: Class<T>, message?: string) => asserts instance is T;
|
288 | inRange: (value: number, range: number | [number, number], message?: string) => asserts value is number;
|
289 | any: (predicate: Predicate | Predicate[], ...values: unknown[]) => void | never;
|
290 | all: (predicate: Predicate, ...values: unknown[]) => void | never;
|
291 | };
|
292 | export declare const assert: Assert;
|
293 | export declare function assertAll(predicate: Predicate, ...values: unknown[]): void | never;
|
294 | export declare function assertAny(predicate: Predicate | Predicate[], ...values: unknown[]): void | never;
|
295 | export declare function assertArray<T = unknown>(value: unknown, assertion?: (element: unknown) => asserts element is T, message?: string): asserts value is T[];
|
296 | export declare function assertArrayBuffer(value: unknown, message?: string): asserts value is ArrayBuffer;
|
297 | export declare function assertArrayLike<T = unknown>(value: unknown, message?: string): asserts value is ArrayLike<T>;
|
298 | export declare function assertAsyncFunction(value: unknown, message?: string): asserts value is Function;
|
299 | export declare function assertAsyncGenerator(value: unknown, message?: string): asserts value is AsyncGenerator;
|
300 | export declare function assertAsyncGeneratorFunction(value: unknown, message?: string): asserts value is AsyncGeneratorFunction;
|
301 | export declare function assertAsyncIterable<T = unknown>(value: unknown, message?: string): asserts value is AsyncIterable<T>;
|
302 | export declare function assertBigint(value: unknown, message?: string): asserts value is bigint;
|
303 | export declare function assertBigInt64Array(value: unknown, message?: string): asserts value is BigInt64Array;
|
304 | export declare function assertBigUint64Array(value: unknown, message?: string): asserts value is BigUint64Array;
|
305 | export declare function assertBlob(value: unknown, message?: string): asserts value is Blob;
|
306 | export declare function assertBoolean(value: unknown, message?: string): asserts value is boolean;
|
307 | export declare function assertBoundFunction(value: unknown, message?: string): asserts value is Function;
|
308 | /**
|
309 | Note: [Prefer using `Uint8Array` instead of `Buffer`.](https://sindresorhus.com/blog/goodbye-nodejs-buffer)
|
310 | */
|
311 | export declare function assertBuffer(value: unknown, message?: string): asserts value is NodeBuffer;
|
312 | export declare function assertClass<T>(value: unknown, message?: string): asserts value is Class<T>;
|
313 | export declare function assertDataView(value: unknown, message?: string): asserts value is DataView;
|
314 | export declare function assertDate(value: unknown, message?: string): asserts value is Date;
|
315 | export declare function assertDirectInstanceOf<T>(instance: unknown, class_: Class<T>, message?: string): asserts instance is T;
|
316 | export declare function assertEmptyArray(value: unknown, message?: string): asserts value is never[];
|
317 | export declare function assertEmptyMap(value: unknown, message?: string): asserts value is Map<never, never>;
|
318 | export declare function assertEmptyObject<Key extends keyof any = string>(value: unknown, message?: string): asserts value is Record<Key, never>;
|
319 | export declare function assertEmptySet(value: unknown, message?: string): asserts value is Set<never>;
|
320 | export declare function assertEmptyString(value: unknown, message?: string): asserts value is '';
|
321 | export declare function assertEmptyStringOrWhitespace(value: unknown, message?: string): asserts value is '' | Whitespace;
|
322 | export declare function assertEnumCase<T = unknown>(value: unknown, targetEnum: T, message?: string): asserts value is T[keyof T];
|
323 | export declare function assertError(value: unknown, message?: string): asserts value is Error;
|
324 | export declare function assertEvenInteger(value: number, message?: string): asserts value is number;
|
325 | export declare function assertFalsy(value: unknown, message?: string): asserts value is Falsy;
|
326 | export declare function assertFloat32Array(value: unknown, message?: string): asserts value is Float32Array;
|
327 | export declare function assertFloat64Array(value: unknown, message?: string): asserts value is Float64Array;
|
328 | export declare function assertFormData(value: unknown, message?: string): asserts value is FormData;
|
329 | export declare function assertFunction(value: unknown, message?: string): asserts value is Function;
|
330 | export declare function assertGenerator(value: unknown, message?: string): asserts value is Generator;
|
331 | export declare function assertGeneratorFunction(value: unknown, message?: string): asserts value is GeneratorFunction;
|
332 | export declare function assertHtmlElement(value: unknown, message?: string): asserts value is HTMLElement;
|
333 | export declare function assertInfinite(value: unknown, message?: string): asserts value is number;
|
334 | export declare function assertInRange(value: number, range: number | [number, number], message?: string): asserts value is number;
|
335 | export declare function assertInt16Array(value: unknown, message?: string): asserts value is Int16Array;
|
336 | export declare function assertInt32Array(value: unknown, message?: string): asserts value is Int32Array;
|
337 | export declare function assertInt8Array(value: unknown, message?: string): asserts value is Int8Array;
|
338 | export declare function assertInteger(value: unknown, message?: string): asserts value is number;
|
339 | export declare function assertIterable<T = unknown>(value: unknown, message?: string): asserts value is Iterable<T>;
|
340 | export declare function assertMap<Key = unknown, Value = unknown>(value: unknown, message?: string): asserts value is Map<Key, Value>;
|
341 | export declare function assertNan(value: unknown, message?: string): asserts value is number;
|
342 | export declare function assertNativePromise<T = unknown>(value: unknown, message?: string): asserts value is Promise<T>;
|
343 | export declare function assertNegativeNumber(value: unknown, message?: string): asserts value is number;
|
344 | export declare function assertNodeStream(value: unknown, message?: string): asserts value is NodeStream;
|
345 | export declare function assertNonEmptyArray<T = unknown, Item = unknown>(value: T | Item[], message?: string): asserts value is [Item, ...Item[]];
|
346 | export declare function assertNonEmptyMap<Key = unknown, Value = unknown>(value: unknown, message?: string): asserts value is Map<Key, Value>;
|
347 | export declare function assertNonEmptyObject<Key extends keyof any = string, Value = unknown>(value: unknown, message?: string): asserts value is Record<Key, Value>;
|
348 | export declare function assertNonEmptySet<T = unknown>(value: unknown, message?: string): asserts value is Set<T>;
|
349 | export declare function assertNonEmptyString(value: unknown, message?: string): asserts value is string;
|
350 | export declare function assertNonEmptyStringAndNotWhitespace(value: unknown, message?: string): asserts value is string;
|
351 | export declare function assertNull(value: unknown, message?: string): asserts value is null;
|
352 | export declare function assertNullOrUndefined(value: unknown, message?: string): asserts value is null | undefined;
|
353 | export declare function assertNumber(value: unknown, message?: string): asserts value is number;
|
354 | export declare function assertNumericString(value: unknown, message?: string): asserts value is `${number}`;
|
355 | export declare function assertObject(value: unknown, message?: string): asserts value is object;
|
356 | export declare function assertObservable(value: unknown, message?: string): asserts value is ObservableLike;
|
357 | export declare function assertOddInteger(value: number, message?: string): asserts value is number;
|
358 | export declare function assertPlainObject<Value = unknown>(value: unknown, message?: string): asserts value is Record<PropertyKey, Value>;
|
359 | export declare function assertPositiveNumber(value: unknown, message?: string): asserts value is number;
|
360 | export declare function assertPrimitive(value: unknown, message?: string): asserts value is Primitive;
|
361 | export declare function assertPromise<T = unknown>(value: unknown, message?: string): asserts value is Promise<T>;
|
362 | export declare function assertPropertyKey(value: unknown, message?: string): asserts value is number;
|
363 | export declare function assertRegExp(value: unknown, message?: string): asserts value is RegExp;
|
364 | export declare function assertSafeInteger(value: unknown, message?: string): asserts value is number;
|
365 | export declare function assertSet<T = unknown>(value: unknown, message?: string): asserts value is Set<T>;
|
366 | export declare function assertSharedArrayBuffer(value: unknown, message?: string): asserts value is SharedArrayBuffer;
|
367 | export declare function assertString(value: unknown, message?: string): asserts value is string;
|
368 | export declare function assertSymbol(value: unknown, message?: string): asserts value is symbol;
|
369 | export declare function assertTruthy<T>(value: T | Falsy, message?: string): asserts value is T;
|
370 | export declare function assertTupleLike<T extends Array<TypeGuard<unknown>>>(value: unknown, guards: [...T], message?: string): asserts value is ResolveTypesOfTypeGuardsTuple<T>;
|
371 | export declare function assertTypedArray(value: unknown, message?: string): asserts value is TypedArray;
|
372 | export declare function assertUint16Array(value: unknown, message?: string): asserts value is Uint16Array;
|
373 | export declare function assertUint32Array(value: unknown, message?: string): asserts value is Uint32Array;
|
374 | export declare function assertUint8Array(value: unknown, message?: string): asserts value is Uint8Array;
|
375 | export declare function assertUint8ClampedArray(value: unknown, message?: string): asserts value is Uint8ClampedArray;
|
376 | export declare function assertUndefined(value: unknown, message?: string): asserts value is undefined;
|
377 | export declare function assertUrlInstance(value: unknown, message?: string): asserts value is URL;
|
378 | export declare function assertUrlSearchParams(value: unknown, message?: string): asserts value is URLSearchParams;
|
379 | export declare function assertUrlString(value: unknown, message?: string): asserts value is string;
|
380 | export declare function assertValidDate(value: unknown, message?: string): asserts value is Date;
|
381 | export declare function assertValidLength(value: unknown, message?: string): asserts value is number;
|
382 | export declare function assertWeakMap<Key extends object = object, Value = unknown>(value: unknown, message?: string): asserts value is WeakMap<Key, Value>;
|
383 | export declare function assertWeakRef<T extends object = object>(value: unknown, message?: string): asserts value is WeakRef<T>;
|
384 | export declare function assertWeakSet<T extends object = object>(value: unknown, message?: string): asserts value is WeakSet<T>;
|
385 | export declare function assertWhitespaceString(value: unknown, message?: string): asserts value is string;
|
386 | export default is;
|
387 | export type { ArrayLike, Class, NodeStream, ObservableLike, Predicate, Primitive, TypedArray, } from './types.js';
|
388 |
|
\ | No newline at end of file |