metro 0.84.1 → 0.84.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/package.json +14 -14
  2. package/src/Assets.d.ts +90 -0
  3. package/src/Bundler/util.d.ts +34 -0
  4. package/src/Bundler.d.ts +45 -0
  5. package/src/DeltaBundler/DeltaCalculator.d.ts +78 -0
  6. package/src/DeltaBundler/Graph.d.ts +174 -0
  7. package/src/DeltaBundler/Serializers/baseJSBundle.d.ts +27 -0
  8. package/src/DeltaBundler/Serializers/getAllFiles.d.ts +29 -0
  9. package/src/DeltaBundler/Serializers/getAssets.d.ts +32 -0
  10. package/src/DeltaBundler/Serializers/getExplodedSourceMap.d.ts +33 -0
  11. package/src/DeltaBundler/Serializers/getRamBundleInfo.d.ts +55 -0
  12. package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.d.ts +19 -0
  13. package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.d.ts +40 -0
  14. package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.d.ts +24 -0
  15. package/src/DeltaBundler/Serializers/helpers/js.d.ts +37 -0
  16. package/src/DeltaBundler/Serializers/helpers/processModules.d.ts +32 -0
  17. package/src/DeltaBundler/Serializers/hmrJSBundle.d.ts +37 -0
  18. package/src/DeltaBundler/Serializers/sourceMapGenerator.d.ts +36 -0
  19. package/src/DeltaBundler/Serializers/sourceMapObject.d.ts +30 -0
  20. package/src/DeltaBundler/Serializers/sourceMapString.d.ts +29 -0
  21. package/src/DeltaBundler/Transformer.d.ts +45 -0
  22. package/src/DeltaBundler/Worker.d.ts +44 -0
  23. package/src/DeltaBundler/WorkerFarm.d.ts +77 -0
  24. package/src/DeltaBundler/buildSubgraph.d.ts +37 -0
  25. package/src/DeltaBundler/getTransformCacheKey.d.ts +25 -0
  26. package/src/DeltaBundler/mergeDeltas.d.ts +24 -0
  27. package/src/DeltaBundler/types.d.ts +170 -0
  28. package/src/DeltaBundler.d.ts +67 -0
  29. package/src/HmrServer.d.ts +86 -0
  30. package/src/IncrementalBundler/GraphNotFoundError.d.ts +24 -0
  31. package/src/IncrementalBundler/ResourceNotFoundError.d.ts +22 -0
  32. package/src/IncrementalBundler/RevisionNotFoundError.d.ts +24 -0
  33. package/src/IncrementalBundler.d.ts +103 -0
  34. package/src/ModuleGraph/worker/JsFileWrapping.d.ts +36 -0
  35. package/src/ModuleGraph/worker/collectDependencies.d.ts +138 -0
  36. package/src/ModuleGraph/worker/generateImportNames.d.ts +26 -0
  37. package/src/ModuleGraph/worker/importLocationsPlugin.d.ts +33 -0
  38. package/src/Server/MultipartResponse.d.ts +37 -0
  39. package/src/Server/symbolicate.d.ts +38 -0
  40. package/src/Server.d.ts +278 -0
  41. package/src/cli/parseKeyValueParamArray.d.ts +21 -0
  42. package/src/cli-utils.d.ts +26 -0
  43. package/src/commands/build.d.ts +23 -0
  44. package/src/commands/dependencies.d.ts +23 -0
  45. package/src/commands/serve.d.ts +23 -0
  46. package/src/index.d.ts +187 -0
  47. package/src/lib/BatchProcessor.d.ts +61 -0
  48. package/src/lib/CountingSet.d.ts +55 -0
  49. package/src/lib/JsonReporter.d.ts +44 -0
  50. package/src/lib/RamBundleParser.d.ts +36 -0
  51. package/src/lib/TerminalReporter.d.ts +125 -0
  52. package/src/lib/bundleProgressUtils.d.ts +33 -0
  53. package/src/lib/bundleToString.d.ts +26 -0
  54. package/src/lib/contextModule.d.ts +40 -0
  55. package/src/lib/contextModuleTemplates.d.ts +32 -0
  56. package/src/lib/countLines.d.ts +19 -0
  57. package/src/lib/createWebsocketServer.d.ts +50 -0
  58. package/src/lib/debounceAsyncQueue.d.ts +22 -0
  59. package/src/lib/formatBundlingError.d.ts +30 -0
  60. package/src/lib/getAppendScripts.d.ts +38 -0
  61. package/src/lib/getGraphId.d.ts +32 -0
  62. package/src/lib/getPreludeCode.d.ts +25 -0
  63. package/src/lib/getPrependedScripts.d.ts +31 -0
  64. package/src/lib/isResolvedDependency.d.ts +22 -0
  65. package/src/lib/logToConsole.d.ts +26 -0
  66. package/src/lib/parseBundleOptionsFromBundleRequestUrl.d.ts +24 -0
  67. package/src/lib/parseCustomResolverOptions.d.ts +23 -0
  68. package/src/lib/parseCustomTransformOptions.d.ts +23 -0
  69. package/src/lib/parseJsonBody.d.ts +34 -0
  70. package/src/lib/pathUtils.d.ts +21 -0
  71. package/src/lib/relativizeSourceMap.d.ts +24 -0
  72. package/src/lib/reporting.d.ts +135 -0
  73. package/src/lib/splitBundleOptions.d.ts +23 -0
  74. package/src/lib/transformHelpers.d.ts +42 -0
  75. package/src/node-haste/DependencyGraph/ModuleResolution.d.ts +133 -0
  76. package/src/node-haste/DependencyGraph/createFileMap.d.ts +36 -0
  77. package/src/node-haste/DependencyGraph.d.ts +93 -0
  78. package/src/node-haste/Package.d.ts +28 -0
  79. package/src/node-haste/PackageCache.d.ts +41 -0
  80. package/src/node-haste/lib/AssetPaths.d.ts +36 -0
  81. package/src/node-haste/lib/parsePlatformFilePath.d.ts +32 -0
  82. package/src/shared/output/RamBundle/as-assets.d.ts +32 -0
  83. package/src/shared/output/RamBundle/as-indexed-file.d.ts +45 -0
  84. package/src/shared/output/RamBundle/buildSourcemapWithMetadata.d.ts +30 -0
  85. package/src/shared/output/RamBundle/magic-number.d.ts +21 -0
  86. package/src/shared/output/RamBundle/util.d.ts +48 -0
  87. package/src/shared/output/RamBundle/write-sourcemap.d.ts +23 -0
  88. package/src/shared/output/RamBundle.d.ts +33 -0
  89. package/src/shared/output/bundle.d.ts +34 -0
  90. package/src/shared/output/meta.d.ts +22 -0
  91. package/src/shared/output/unbundle.d.ts +18 -0
  92. package/src/shared/output/writeFile.d.ts +23 -0
  93. package/src/shared/types.d.ts +152 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @generated SignedSource<<9632d9ca461f1fd6aad9131d7afb5839>>
9
+ *
10
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
11
+ * Original file: packages/metro/src/ModuleGraph/worker/generateImportNames.js
12
+ * To regenerate, run:
13
+ * js1 build metro-ts-defs (internal) OR
14
+ * yarn run build-ts-defs (OSS)
15
+ */
16
+
17
+ import type {Node} from '@babel/types';
18
+ /**
19
+ * Select unused names for "metroImportDefault" and "metroImportAll", by
20
+ * calling "generateUid".
21
+ */
22
+ declare function generateImportNames(ast: Node): {
23
+ importAll: string;
24
+ importDefault: string;
25
+ };
26
+ export default generateImportNames;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<644d25f2f9682a306271d052d09b1d2d>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/ModuleGraph/worker/importLocationsPlugin.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {ReadonlySourceLocation} from '../../shared/types';
19
+ import type {PluginObj} from '@babel/core';
20
+ import type * as $$IMPORT_TYPEOF_1$$ from '@babel/types';
21
+ import type {MetroBabelFileMetadata} from 'metro-babel-transformer';
22
+
23
+ type Types = typeof $$IMPORT_TYPEOF_1$$;
24
+ type ImportDeclarationLocs = Set<string>;
25
+ type State = {
26
+ importDeclarationLocs: ImportDeclarationLocs;
27
+ file: {metadata?: MetroBabelFileMetadata};
28
+ };
29
+ declare function importLocationsPlugin($$PARAM_0$$: {
30
+ types: Types;
31
+ }): PluginObj<State>;
32
+ declare function locToKey(loc: ReadonlySourceLocation): string;
33
+ export {importLocationsPlugin, locToKey};
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<355f5514464c4989f90a211782db41e7>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/Server/MultipartResponse.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {IncomingMessage, ServerResponse} from 'http';
19
+
20
+ type Data = string | Buffer | Uint8Array;
21
+ type Headers = {[$$Key$$: string]: string | number};
22
+ declare class MultipartResponse {
23
+ static wrapIfSupported(
24
+ req: IncomingMessage,
25
+ res: ServerResponse,
26
+ ): MultipartResponse | ServerResponse;
27
+ static serializeHeaders(headers: Headers): string;
28
+ res: ServerResponse;
29
+ headers: Headers;
30
+ constructor(res: ServerResponse);
31
+ writeChunk(headers: Headers | null, data?: Data, isLast?: boolean): void;
32
+ writeHead(status: number, headers?: Headers): void;
33
+ setHeader(name: string, value: string | number): void;
34
+ end(data?: Data): void;
35
+ once(name: string, fn: () => unknown): this;
36
+ }
37
+ export default MultipartResponse;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<74bba01977b0b5887c4bb38eb8fc78ea>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/Server/symbolicate.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {ExplodedSourceMap} from '../DeltaBundler/Serializers/getExplodedSourceMap';
19
+ import type {ConfigT} from 'metro-config';
20
+
21
+ export type StackFrameInput = {
22
+ readonly file: null | undefined | string;
23
+ readonly lineNumber: null | undefined | number;
24
+ readonly column: null | undefined | number;
25
+ readonly methodName: null | undefined | string;
26
+ };
27
+ export type IntermediateStackFrame = Omit<
28
+ StackFrameInput,
29
+ keyof {collapse?: boolean}
30
+ > & {collapse?: boolean};
31
+ export type StackFrameOutput = Readonly<IntermediateStackFrame>;
32
+ declare function symbolicate(
33
+ stack: ReadonlyArray<StackFrameInput>,
34
+ maps: Iterable<[string, ExplodedSourceMap]>,
35
+ config: ConfigT,
36
+ extraData: unknown,
37
+ ): Promise<ReadonlyArray<StackFrameOutput>>;
38
+ export default symbolicate;
@@ -0,0 +1,278 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<161e77301d04ce6cc254f1dbf15ef06b>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/Server.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {AssetData} from './Assets';
19
+ import type {ExplodedSourceMap} from './DeltaBundler/Serializers/getExplodedSourceMap';
20
+ import type {RamBundleInfo} from './DeltaBundler/Serializers/getRamBundleInfo';
21
+ import type {
22
+ Module,
23
+ ReadOnlyDependencies,
24
+ ReadOnlyGraph,
25
+ TransformInputOptions,
26
+ } from './DeltaBundler/types';
27
+ import type {RevisionId} from './IncrementalBundler';
28
+ import type {GraphId} from './lib/getGraphId';
29
+ import type {Reporter} from './lib/reporting';
30
+ import type {
31
+ BuildOptions,
32
+ BundleOptions,
33
+ GraphOptions,
34
+ ResolverInputOptions,
35
+ SplitBundleOptions,
36
+ } from './shared/types';
37
+ import type {IncomingMessage} from 'connect';
38
+ import type {ServerResponse} from 'http';
39
+ import type {ConfigT, RootPerfLogger} from 'metro-config';
40
+ import type {
41
+ ActionLogEntryData,
42
+ ActionStartLogEntry,
43
+ } from 'metro-core/private/Logger';
44
+ import type {CustomResolverOptions} from 'metro-resolver/private/types';
45
+ import type {CustomTransformOptions} from 'metro-transform-worker';
46
+
47
+ import IncrementalBundler from './IncrementalBundler';
48
+ import MultipartResponse from './Server/MultipartResponse';
49
+ import {SourcePathsMode} from './shared/types';
50
+ import {Logger} from 'metro-core';
51
+
52
+ export type SegmentLoadData = {
53
+ [$$Key$$: number]: [Array<number>, null | undefined | number];
54
+ };
55
+ export type BundleMetadata = {
56
+ hash: string;
57
+ otaBuildNumber: null | undefined | string;
58
+ mobileConfigs: Array<string>;
59
+ segmentHashes: Array<string>;
60
+ segmentLoadData: SegmentLoadData;
61
+ };
62
+ type ProcessStartContext = Omit<
63
+ SplitBundleOptions,
64
+ keyof {
65
+ readonly buildNumber: number;
66
+ readonly bundleOptions: BundleOptions;
67
+ readonly graphId: GraphId;
68
+ readonly graphOptions: GraphOptions;
69
+ readonly mres: MultipartResponse | ServerResponse;
70
+ readonly req: IncomingMessage;
71
+ readonly revisionId?: null | undefined | RevisionId;
72
+ readonly bundlePerfLogger: RootPerfLogger;
73
+ readonly requestStartTimestamp: number;
74
+ }
75
+ > & {
76
+ readonly buildNumber: number;
77
+ readonly bundleOptions: BundleOptions;
78
+ readonly graphId: GraphId;
79
+ readonly graphOptions: GraphOptions;
80
+ readonly mres: MultipartResponse | ServerResponse;
81
+ readonly req: IncomingMessage;
82
+ readonly revisionId?: null | undefined | RevisionId;
83
+ readonly bundlePerfLogger: RootPerfLogger;
84
+ readonly requestStartTimestamp: number;
85
+ };
86
+ type ProcessDeleteContext = {
87
+ readonly graphId: GraphId;
88
+ readonly req: IncomingMessage;
89
+ readonly res: ServerResponse;
90
+ };
91
+ type ProcessEndContext<T> = Omit<
92
+ ProcessStartContext,
93
+ keyof {readonly result: T}
94
+ > & {readonly result: T};
95
+ export type ServerOptions = Readonly<{
96
+ hasReducedPerformance?: boolean;
97
+ onBundleBuilt?: (bundlePath: string) => void;
98
+ watch?: boolean;
99
+ }>;
100
+ type FetchTiming = {
101
+ graphId: GraphId;
102
+ startTime: number;
103
+ endTime: number | null;
104
+ isPrefetch: boolean;
105
+ };
106
+ declare class Server {
107
+ _bundler: IncrementalBundler;
108
+ _config: ConfigT;
109
+ _createModuleId: (path: string) => number;
110
+ _isEnded: boolean;
111
+ _logger: typeof Logger;
112
+ _nextBundleBuildNumber: number;
113
+ _platforms: Set<string>;
114
+ _reporter: Reporter;
115
+ _serverOptions: ServerOptions | void;
116
+ _allowedSuffixesForSourceRequests: ReadonlyArray<string>;
117
+ _sourceRequestRoutingMap: ReadonlyArray<
118
+ [pathnamePrefix: string, normalizedRootDir: string]
119
+ >;
120
+ _fetchTimings: Array<FetchTiming>;
121
+ _activeFetchCount: number;
122
+ constructor(config: ConfigT, options?: ServerOptions);
123
+ end(): void;
124
+ getBundler(): IncrementalBundler;
125
+ getCreateModuleId(): (path: string) => number;
126
+ _serializeGraph(
127
+ $$PARAM_0$$: Readonly<{
128
+ splitOptions: SplitBundleOptions;
129
+ prepend: ReadonlyArray<Module>;
130
+ graph: ReadOnlyGraph;
131
+ }>,
132
+ ): Promise<{code: string; map: string}>;
133
+ build(
134
+ bundleOptions: BundleOptions,
135
+ $$PARAM_1$$?: BuildOptions,
136
+ ): Promise<{code: string; map: string; assets?: ReadonlyArray<AssetData>}>;
137
+ getRamBundleInfo(options: BundleOptions): Promise<RamBundleInfo>;
138
+ getAssets(options: BundleOptions): Promise<ReadonlyArray<AssetData>>;
139
+ _getAssetsFromDependencies(
140
+ dependencies: ReadOnlyDependencies,
141
+ platform: null | undefined | string,
142
+ ): Promise<ReadonlyArray<AssetData>>;
143
+ getOrderedDependencyPaths(options: {
144
+ readonly dev: boolean;
145
+ readonly entryFile: string;
146
+ readonly minify: boolean;
147
+ readonly platform: null | undefined | string;
148
+ }): Promise<Array<string>>;
149
+ _rangeRequestMiddleware(
150
+ req: IncomingMessage,
151
+ res: ServerResponse,
152
+ data: string | Buffer,
153
+ assetPath: string,
154
+ ): Buffer | string;
155
+ _processSingleAssetRequest(
156
+ req: IncomingMessage,
157
+ res: ServerResponse,
158
+ ): Promise<void>;
159
+ processRequest: (
160
+ $$PARAM_0$$: IncomingMessage,
161
+ $$PARAM_1$$: ServerResponse,
162
+ $$PARAM_2$$: (e: null | undefined | Error) => void,
163
+ ) => void;
164
+ _parseOptions(url: string): BundleOptions;
165
+ _rewriteAndNormalizeUrl(requestUrl: string): string;
166
+ _processRequest(
167
+ req: IncomingMessage,
168
+ res: ServerResponse,
169
+ next: ($$PARAM_0$$: null | undefined | Error) => void,
170
+ ): Promise<void>;
171
+ _processSourceRequest(
172
+ relativeFilePathname: string,
173
+ rootDir: string,
174
+ res: ServerResponse,
175
+ ): Promise<void>;
176
+ _createRequestProcessor<T>($$PARAM_0$$: {
177
+ readonly bundleType: 'assets' | 'bundle' | 'map';
178
+ readonly createStartEntry: (
179
+ context: ProcessStartContext,
180
+ ) => ActionLogEntryData;
181
+ readonly createEndEntry: (
182
+ context: ProcessEndContext<T>,
183
+ ) => Partial<ActionStartLogEntry>;
184
+ readonly build: (context: ProcessStartContext) => Promise<T>;
185
+ readonly delete?: (context: ProcessDeleteContext) => Promise<void>;
186
+ readonly finish: (context: ProcessEndContext<T>) => void;
187
+ }): (
188
+ req: IncomingMessage,
189
+ res: ServerResponse,
190
+ bundleOptions: BundleOptions,
191
+ buildContext: Readonly<{
192
+ buildNumber: number;
193
+ bundlePerfLogger: RootPerfLogger;
194
+ }>,
195
+ ) => Promise<void>;
196
+ _processBundleRequest: (
197
+ req: IncomingMessage,
198
+ res: ServerResponse,
199
+ bundleOptions: BundleOptions,
200
+ buildContext: Readonly<{
201
+ buildNumber: number;
202
+ bundlePerfLogger: RootPerfLogger;
203
+ }>,
204
+ ) => Promise<void>;
205
+ _getSortedModules(graph: ReadOnlyGraph): ReadonlyArray<Module>;
206
+ _processSourceMapRequest: (
207
+ req: IncomingMessage,
208
+ res: ServerResponse,
209
+ bundleOptions: BundleOptions,
210
+ buildContext: Readonly<{
211
+ buildNumber: number;
212
+ bundlePerfLogger: RootPerfLogger;
213
+ }>,
214
+ ) => Promise<void>;
215
+ _processAssetsRequest: (
216
+ req: IncomingMessage,
217
+ res: ServerResponse,
218
+ bundleOptions: BundleOptions,
219
+ buildContext: Readonly<{
220
+ buildNumber: number;
221
+ bundlePerfLogger: RootPerfLogger;
222
+ }>,
223
+ ) => Promise<void>;
224
+ _symbolicate(req: IncomingMessage, res: ServerResponse): Promise<void>;
225
+ _explodedSourceMapForBundleOptions(
226
+ bundleOptions: BundleOptions,
227
+ ): Promise<ExplodedSourceMap>;
228
+ _resolveRelativePath(
229
+ filePath: string,
230
+ $$PARAM_1$$: Readonly<{
231
+ relativeTo: 'project' | 'server';
232
+ resolverOptions: ResolverInputOptions;
233
+ transformOptions: TransformInputOptions;
234
+ }>,
235
+ ): Promise<string>;
236
+ getNewBuildNumber(): number;
237
+ getPlatforms(): ReadonlyArray<string>;
238
+ getWatchFolders(): ReadonlyArray<string>;
239
+ static DEFAULT_GRAPH_OPTIONS: Readonly<{
240
+ customResolverOptions: CustomResolverOptions;
241
+ customTransformOptions: CustomTransformOptions;
242
+ dev: boolean;
243
+ minify: boolean;
244
+ unstable_transformProfile: 'default';
245
+ }>;
246
+ static DEFAULT_BUNDLE_OPTIONS: Omit<
247
+ typeof Server.DEFAULT_GRAPH_OPTIONS,
248
+ keyof {
249
+ excludeSource: false;
250
+ inlineSourceMap: false;
251
+ lazy: false;
252
+ modulesOnly: false;
253
+ onProgress: null;
254
+ runModule: true;
255
+ shallow: false;
256
+ sourceMapUrl: null;
257
+ sourceUrl: null;
258
+ sourcePaths: SourcePathsMode;
259
+ }
260
+ > & {
261
+ excludeSource: false;
262
+ inlineSourceMap: false;
263
+ lazy: false;
264
+ modulesOnly: false;
265
+ onProgress: null;
266
+ runModule: true;
267
+ shallow: false;
268
+ sourceMapUrl: null;
269
+ sourceUrl: null;
270
+ sourcePaths: SourcePathsMode;
271
+ };
272
+ _getServerRootDir(): string;
273
+ _getEntryPointAbsolutePath(entryFile: string): string;
274
+ ready(): Promise<void>;
275
+ _shouldAddModuleToIgnoreList(module: Module): boolean;
276
+ _getModuleSourceUrl(module: Module, mode: SourcePathsMode): string;
277
+ }
278
+ export default Server;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<ece5a9f14463102dc54489fe7db6b3c8>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/cli/parseKeyValueParamArray.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ declare function coerceKeyValueArray(keyValueArray: ReadonlyArray<string>): {
19
+ [key: string]: string;
20
+ };
21
+ export default coerceKeyValueArray;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<b5035a5d26a55e608aca030ee9ee6afa>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/cli-utils.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ export declare const watchFile: (
19
+ filename: string,
20
+ callback: () => unknown,
21
+ ) => Promise<void>;
22
+ export declare type watchFile = typeof watchFile;
23
+ export declare const makeAsyncCommand: <T>(
24
+ command: (argv: T) => Promise<void>,
25
+ ) => (argv: T) => void;
26
+ export declare type makeAsyncCommand = typeof makeAsyncCommand;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<10c41709fa9779dd0e12ef411eaef8eb>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/commands/build.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {CommandModule} from 'yargs';
19
+
20
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: () => CommandModule;
21
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
22
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
23
+ export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<a73d915901dde7a679972b78a1e08a3e>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/commands/dependencies.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {CommandModule} from 'yargs';
19
+
20
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: () => CommandModule;
21
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
22
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
23
+ export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<367f11c0b6933f8c8c58718c7dd41e78>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro/src/commands/serve.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {CommandModule} from 'yargs';
19
+
20
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: () => CommandModule;
21
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
22
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
23
+ export default $$EXPORT_DEFAULT_DECLARATION$$;