-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
66 lines (62 loc) · 1.54 KB
/
types.d.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import {SourceMapConsumer} from 'source-map-js';
export type FileObj = {
uri: string;
code: string;
points: (Fun | NativeCall | InlinedFun)[];
sourceMapJSON: {} | null;
};
export type Fun = {
type: 'Fun';
pos: number;
optimizationCount: number;
reasons: string[];
optimized: boolean;
source: {start: number; end: number};
name: string;
};
export type NativeCall = {
type: 'NativeCall';
reasons: string[];
pos: number;
};
export type InlinedFun = {
type: 'InlinedFun';
points: (NativeCall | InlinedFun)[];
name: string;
pos: number;
source: {uri: string; start: number; end: number};
};
export type LFileObj = {
code: string;
sourceMapJSON: {} | null;
isOriginal: boolean;
functions: Map<number, RootFun>;
};
export type RootFun = {
name: string;
source: {start: number; end: number};
optimized: boolean;
versions: RootFunVersion[];
root: boolean;
};
export type RootFunVersion = {
deoptReason: string;
nativeCalls: Map<Pos, Set<string>>;
inlinedFuns: Map<Pos, Inlining>;
id: string;
};
// const funMap = new Map<string, {name: string; start: number; end: number}>();
export type Pos = number & {brand: 'Pos'};
export type SourceId = string & {brand: 'SourceId'};
export type InliningId = string & {brand: 'InliningId'};
export type Source = {
name: string;
start: number;
end: number;
fileName: string;
};
export type Inlining = {
source: Source;
nativeCalls: Map<Pos, Set<string>>;
inlinings: Map<Pos, Inlining>;
};