1// This file doesn't have an intention to express equivalents of Flow utility types using TypeScript types,
2// it just helps an IDE to provide similar experience with basic highlighting and completion, but without full type checking.
3//
4// https://flow.org/en/docs/types/utilities/
5
6type $Keys<T> = keyof T;
7
8type $Values<T> = any;
9
10type $ReadOnly<T> = Readonly<T>;
11
12type $Exact<T> = T; // object types are exact in typescript, but not in flow
13
14type $Diff<A, B> = { [K in Exclude<keyof A, keyof B>]: A[K]};
15
16type $Rest<A, B> = $Diff<A, B>;
17
18type $PropertyType<T, k extends keyof T> = T[k];
19
20type $ElementType<T, K extends keyof T> = T[K];
21
22type $NonMaybeType<T> = NonNullable<T>;
23
24type $ObjMap<T, F> = any;
25
26type $TupleMap<T, F> = any;
27
28type $Call<F extends (...args: any[]) => any> = ReturnType<F>;
29
30type Class<T> = { new(): T };
31
32type $Shape<T> = Partial<T>;
33
34type $Supertype<T> = any;
35
36type $Subtype<T> = any;
37
38// not documented
39type $Exports<T> = any;
40