UNPKG

472 BTypeScriptView Raw
1/**
2Represents an array with `unknown` value.
3
4Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
5
6@example
7```
8import type {UnknownArray} from 'type-fest';
9
10type IsArray<T> = T extends UnknownArray ? true : false;
11
12type A = IsArray<['foo']>;
13//=> true
14
15type B = IsArray<readonly number[]>;
16//=> true
17
18type C = IsArray<string>;
19//=> false
20```
21
22@category Type
23@category Array
24*/
25export type UnknownArray = readonly unknown[];