-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathtypes.ts
46 lines (35 loc) · 1.04 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { TypeAnnotation } from './transformer';
import { MinimisedTree, ReferentialEqualityAnnotations } from './plainer';
export type Class = { new (...args: any[]): any };
export type PrimitveJSONValue = string | number | boolean | undefined | null;
export type JSONValue = PrimitveJSONValue | JSONArray | JSONObject;
export interface JSONArray extends Array<JSONValue> {}
export interface JSONObject {
[key: string]: JSONValue;
}
type ClassInstance = any;
export type SerializableJSONValue =
| Symbol
| Set<SuperJSONValue>
| Map<SuperJSONValue, SuperJSONValue>
| undefined
| bigint
| Date
| ClassInstance
| RegExp;
export type SuperJSONValue =
| JSONValue
| SerializableJSONValue
| SuperJSONArray
| SuperJSONObject;
export interface SuperJSONArray extends Array<SuperJSONValue> {}
export interface SuperJSONObject {
[key: string]: SuperJSONValue;
}
export interface SuperJSONResult {
json: JSONValue;
meta?: {
values?: MinimisedTree<TypeAnnotation>;
referentialEqualities?: ReferentialEqualityAnnotations;
};
}