/
third-party-libs.js.flow
123 lines (104 loc) 路 2.89 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
/**
* 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: {
SourceMapGenerator: typeof SourceMapGenerator,
}
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" | "rhino";
declare module.exports: {
[key: string]: {
[target: Target]: string;
}
}
}