/
types.flow.js
136 lines (123 loc) 路 3.04 KB
/
types.flow.js
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
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import type {
Options as DeltaBundlerOptions,
TransformInputOptions,
} from '../DeltaBundler/types.flow';
import type {TransformProfile} from 'metro-babel-transformer';
import type {
MixedSourceMap,
MetroSourceMapSegmentTuple,
} from 'metro-source-map';
import type {
CustomTransformOptions,
MinifierOptions,
} from 'metro-transform-worker';
type BundleType =
| 'bundle'
| 'delta'
| 'meta'
| 'map'
| 'ram'
| 'cli'
| 'hmr'
| 'todo'
| 'graph';
type MetroSourceMapOrMappings =
| MixedSourceMap
| Array<MetroSourceMapSegmentTuple>;
export type BundleOptions = {
bundleType: BundleType,
customTransformOptions: CustomTransformOptions,
dev: boolean,
entryFile: string,
+excludeSource: boolean,
+hot: boolean,
+inlineSourceMap: boolean,
minify: boolean,
+modulesOnly: boolean,
onProgress: ?(doneCont: number, totalCount: number) => mixed,
+platform: ?string,
+runModule: boolean,
runtimeBytecodeVersion: ?number,
+shallow: boolean,
sourceMapUrl: ?string,
sourceUrl: ?string,
createModuleIdFactory?: () => (path: string) => number,
+unstable_transformProfile: TransformProfile,
...
};
export type SerializerOptions = {|
+sourceMapUrl: ?string,
+sourceUrl: ?string,
+runModule: boolean,
+excludeSource: boolean,
+inlineSourceMap: boolean,
+modulesOnly: boolean,
|};
export type GraphOptions = {|
+shallow: boolean,
|};
// Stricter representation of BundleOptions.
export type SplitBundleOptions = {|
+entryFile: string,
+transformOptions: TransformInputOptions,
+serializerOptions: SerializerOptions,
+graphOptions: GraphOptions,
+onProgress: $PropertyType<DeltaBundlerOptions<>, 'onProgress'>,
|};
export type ModuleGroups = {|
groups: Map<number, Set<number>>,
modulesById: Map<number, ModuleTransportLike>,
modulesInGroups: Set<number>,
|};
export type ModuleTransportLike = {
+code: string,
+id: number,
+map: ?MetroSourceMapOrMappings,
+name?: string,
+sourcePath: string,
...
};
export type ModuleTransportLikeStrict = {|
+code: string,
+id: number,
+map: ?MetroSourceMapOrMappings,
+name?: string,
+sourcePath: string,
|};
export type RamModuleTransport = {|
...ModuleTransportLikeStrict,
+source: string,
+type: string,
|};
export type OutputOptions = {
bundleOutput: string,
bundleEncoding?: 'utf8' | 'utf16le' | 'ascii',
dev?: boolean,
indexedRamBundle?: boolean,
platform: string,
sourcemapOutput?: string,
sourcemapSourcesRoot?: string,
sourcemapUseAbsolutePath?: boolean,
...
};
export type RequestOptions = {|
entryFile: string,
inlineSourceMap?: boolean,
sourceMapUrl?: string,
dev?: boolean,
minify: boolean,
platform: string,
createModuleIdFactory?: () => (path: string) => number,
onProgress?: (transformedFileCount: number, totalFileCount: number) => void,
|};
export type {MinifierOptions};