-
Notifications
You must be signed in to change notification settings - Fork 1
/
third-party-libs.js.flow
197 lines (170 loc) · 4.4 KB
/
third-party-libs.js.flow
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/**
* Basic declarations for the npm modules we use.
*/
declare module "module" {
declare export function createRequire(url: any): any;
}
declare module "debug" {
declare export default (namespace: string) => (formatter: string, ...args: any[]) => void;
}
declare var require: {
resolve(specifier: string, opts?: {
paths: string[]
}): string,
};
declare module "json5" {
declare export default {
parse: (string) => mixed,
};
}
declare module "semver" {
declare class SemVer {
build: Array<string>;
loose: ?boolean;
major: number;
minor: number;
patch: number;
prerelease: Array<string | number>;
raw: string;
version: string;
constructor(version: string | SemVer): SemVer;
}
declare module.exports: {
SemVer: SemVer;
coerce(version: string | SemVer): SemVer | null;
gt(v1: string, v2: string): boolean;
intersects(r1: string, r2: string): boolean;
lt(v1: string, v2: string): boolean;
major(v: string): number;
minor(v: string): number;
patch(v: string): number;
satisfies(v1: string, r1: string): boolean;
valid(v: string): boolean;
}
}
declare module "source-map" {
declare export type SourceMap = {
version: 3,
file: ?string,
sourceRoot: ?string,
sources: [?string],
sourcesContent: [?string],
names: [?string],
mappings: string,
};
declare module.exports: {
SourceMapConsumer: typeof SourceMapConsumer,
SourceMapGenerator: typeof SourceMapGenerator,
}
declare class SourceMapConsumer {
static GENERATED_ORDER: 1;
static ORIGINAL_ORDER: 2;
file: string | null;
sourceRoot: string | null;
sources: Array<string>;
constructor(?SourceMap): this;
computeColumnSpans(): string;
originalPositionFor({
line: number,
column: number,
}): {|
source: string,
line: number,
column: number,
name: string | null
|} | {|
source: null,
line: null,
column: null,
name: null
|};
generatedPositionFor({
source: string,
line: number,
column: number,
}): {|
line: number,
column: number,
lastColumn: number | null | void,
|} | {|
line: null,
column: null,
lastColumn: null | void,
|};
allGeneratedPositionsFor({
source: string,
line: number,
column: number,
}): Array<{|
line: number,
column: number,
lastColumn: number,
|}>;
sourceContentFor(string, boolean | void): string | null;
eachMapping(
({|
generatedLine: number,
generatedColumn: number,
source: string,
originalLine: number,
originalColumn: number,
name: string | null,
|} | {|
generatedLine: number,
generatedColumn: number,
source: null,
originalLine: null,
originalColumn: null,
name: null,
|}) => mixed,
context: mixed,
order: ?(1 | 2),
): void;
}
declare class SourceMapGenerator {
constructor(?{
file?: string | null,
sourceRoot?: string | null,
skipValidation?: boolean | null,
}): this;
addMapping({
generated: {
line: number,
column: number,
}
}): void;
setSourceContent(string, string): void;
toJSON(): SourceMap;
}
}
declare module "convert-source-map" {
import type { SourceMap, SourceMapGenerator } from "source-map";
declare class Converter {
toJSON(): string;
toBase64(): string;
toComment(): string;
toObject(): SourceMap
}
declare module.exports: {
SourceMap: SourceMap,
Converter: Converter,
fromObject(obj: SourceMap | SourceMapGenerator): Converter,
fromJSON(str: string | Buffer): Converter,
fromBase64(str: string): Converter,
fromComment(str: string): Converter,
fromMapFileComment(str: string, dir: string): Converter,
fromSource(str: string): Converter,
fromMapFileSource(str: string, dir: string): Converter,
removeComments(str: string): string,
removeMapFileComments(str: string): string,
generateMapFileComment(path: string, options?: ?{ multiline: boolean }): string,
};
}
declare module "core-js-compat/data" {
declare type Target = "node" | "chrome" | "opera" | "edge" | "firefox" | "safari" | "ie" | "ios" | "android" | "electron" | "samsung";
declare module.exports: {
[key: string]: {
[target: Target]: string;
}
}
}