metro 0.84.0 → 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.
- package/package.json +15 -14
- package/src/Assets.d.ts +90 -0
- package/src/Bundler/util.d.ts +34 -0
- package/src/Bundler.d.ts +45 -0
- package/src/DeltaBundler/DeltaCalculator.d.ts +78 -0
- package/src/DeltaBundler/Graph.d.ts +174 -0
- package/src/DeltaBundler/Serializers/baseJSBundle.d.ts +27 -0
- package/src/DeltaBundler/Serializers/getAllFiles.d.ts +29 -0
- package/src/DeltaBundler/Serializers/getAssets.d.ts +32 -0
- package/src/DeltaBundler/Serializers/getExplodedSourceMap.d.ts +33 -0
- package/src/DeltaBundler/Serializers/getRamBundleInfo.d.ts +55 -0
- package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.d.ts +19 -0
- package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.d.ts +40 -0
- package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.d.ts +24 -0
- package/src/DeltaBundler/Serializers/helpers/js.d.ts +37 -0
- package/src/DeltaBundler/Serializers/helpers/processModules.d.ts +32 -0
- package/src/DeltaBundler/Serializers/hmrJSBundle.d.ts +37 -0
- package/src/DeltaBundler/Serializers/sourceMapGenerator.d.ts +36 -0
- package/src/DeltaBundler/Serializers/sourceMapObject.d.ts +30 -0
- package/src/DeltaBundler/Serializers/sourceMapString.d.ts +29 -0
- package/src/DeltaBundler/Transformer.d.ts +45 -0
- package/src/DeltaBundler/Worker.d.ts +44 -0
- package/src/DeltaBundler/WorkerFarm.d.ts +77 -0
- package/src/DeltaBundler/buildSubgraph.d.ts +37 -0
- package/src/DeltaBundler/getTransformCacheKey.d.ts +25 -0
- package/src/DeltaBundler/mergeDeltas.d.ts +24 -0
- package/src/DeltaBundler/types.d.ts +170 -0
- package/src/DeltaBundler.d.ts +67 -0
- package/src/HmrServer.d.ts +86 -0
- package/src/IncrementalBundler/GraphNotFoundError.d.ts +24 -0
- package/src/IncrementalBundler/ResourceNotFoundError.d.ts +22 -0
- package/src/IncrementalBundler/RevisionNotFoundError.d.ts +24 -0
- package/src/IncrementalBundler.d.ts +103 -0
- package/src/ModuleGraph/worker/JsFileWrapping.d.ts +36 -0
- package/src/ModuleGraph/worker/collectDependencies.d.ts +138 -0
- package/src/ModuleGraph/worker/generateImportNames.d.ts +26 -0
- package/src/ModuleGraph/worker/importLocationsPlugin.d.ts +33 -0
- package/src/Server/MultipartResponse.d.ts +37 -0
- package/src/Server/symbolicate.d.ts +38 -0
- package/src/Server.d.ts +278 -0
- package/src/Server.js +10 -6
- package/src/Server.js.flow +9 -10
- package/src/cli/parseKeyValueParamArray.d.ts +21 -0
- package/src/cli-utils.d.ts +26 -0
- package/src/commands/build.d.ts +23 -0
- package/src/commands/dependencies.d.ts +23 -0
- package/src/commands/serve.d.ts +23 -0
- package/src/index.d.ts +187 -0
- package/src/index.flow.js +24 -10
- package/src/index.flow.js.flow +25 -10
- package/src/lib/BatchProcessor.d.ts +61 -0
- package/src/lib/CountingSet.d.ts +55 -0
- package/src/lib/JsonReporter.d.ts +44 -0
- package/src/lib/RamBundleParser.d.ts +36 -0
- package/src/lib/TerminalReporter.d.ts +125 -0
- package/src/lib/TerminalReporter.js +6 -7
- package/src/lib/TerminalReporter.js.flow +6 -15
- package/src/lib/bundleProgressUtils.d.ts +33 -0
- package/src/lib/bundleProgressUtils.js +19 -0
- package/src/lib/bundleProgressUtils.js.flow +35 -0
- package/src/lib/bundleToString.d.ts +26 -0
- package/src/lib/contextModule.d.ts +40 -0
- package/src/lib/contextModuleTemplates.d.ts +32 -0
- package/src/lib/countLines.d.ts +19 -0
- package/src/lib/createWebsocketServer.d.ts +50 -0
- package/src/lib/debounceAsyncQueue.d.ts +22 -0
- package/src/lib/formatBundlingError.d.ts +30 -0
- package/src/lib/getAppendScripts.d.ts +38 -0
- package/src/lib/getGraphId.d.ts +32 -0
- package/src/lib/getPreludeCode.d.ts +25 -0
- package/src/lib/getPrependedScripts.d.ts +31 -0
- package/src/lib/isResolvedDependency.d.ts +22 -0
- package/src/lib/logToConsole.d.ts +26 -0
- package/src/lib/parseBundleOptionsFromBundleRequestUrl.d.ts +24 -0
- package/src/lib/parseCustomResolverOptions.d.ts +23 -0
- package/src/lib/parseCustomTransformOptions.d.ts +23 -0
- package/src/lib/parseJsonBody.d.ts +34 -0
- package/src/lib/pathUtils.d.ts +21 -0
- package/src/lib/relativizeSourceMap.d.ts +24 -0
- package/src/lib/reporting.d.ts +135 -0
- package/src/lib/splitBundleOptions.d.ts +23 -0
- package/src/lib/transformHelpers.d.ts +42 -0
- package/src/node-haste/DependencyGraph/ModuleResolution.d.ts +133 -0
- package/src/node-haste/DependencyGraph/createFileMap.d.ts +36 -0
- package/src/node-haste/DependencyGraph.d.ts +93 -0
- package/src/node-haste/Package.d.ts +28 -0
- package/src/node-haste/PackageCache.d.ts +41 -0
- package/src/node-haste/lib/AssetPaths.d.ts +36 -0
- package/src/node-haste/lib/parsePlatformFilePath.d.ts +32 -0
- package/src/shared/output/RamBundle/as-assets.d.ts +32 -0
- package/src/shared/output/RamBundle/as-indexed-file.d.ts +45 -0
- package/src/shared/output/RamBundle/buildSourcemapWithMetadata.d.ts +30 -0
- package/src/shared/output/RamBundle/magic-number.d.ts +21 -0
- package/src/shared/output/RamBundle/util.d.ts +48 -0
- package/src/shared/output/RamBundle/write-sourcemap.d.ts +23 -0
- package/src/shared/output/RamBundle.d.ts +33 -0
- package/src/shared/output/bundle.d.ts +34 -0
- package/src/shared/output/meta.d.ts +22 -0
- package/src/shared/output/unbundle.d.ts +18 -0
- package/src/shared/output/writeFile.d.ts +23 -0
- package/src/shared/types.d.ts +152 -0
|
@@ -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<<6f0cfa5c118fa3cbe65acee044b8c927>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/bundleProgressUtils.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Calculates a conservative progress ratio for bundle building.
|
|
20
|
+
*
|
|
21
|
+
* Because we know the `totalFileCount` is going to progressively increase
|
|
22
|
+
* starting with 1:
|
|
23
|
+
* - We use Math.max(totalFileCount, 10) to prevent the ratio from raising too
|
|
24
|
+
* quickly when the total file count is low. (e.g 1/2 5/6)
|
|
25
|
+
* - We use Math.pow(ratio, 2) as a conservative measure of progress.
|
|
26
|
+
* - The ratio is capped at 0.999 to ensure we don't display 100% until done.
|
|
27
|
+
* - If previousRatio is provided, the ratio will not go backwards.
|
|
28
|
+
*/
|
|
29
|
+
export declare function calculateBundleProgressRatio(
|
|
30
|
+
transformedFileCount: number,
|
|
31
|
+
totalFileCount: number,
|
|
32
|
+
previousRatio?: number,
|
|
33
|
+
): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
exports.calculateBundleProgressRatio = calculateBundleProgressRatio;
|
|
7
|
+
function calculateBundleProgressRatio(
|
|
8
|
+
transformedFileCount,
|
|
9
|
+
totalFileCount,
|
|
10
|
+
previousRatio,
|
|
11
|
+
) {
|
|
12
|
+
const baseRatio = Math.pow(
|
|
13
|
+
transformedFileCount / Math.max(totalFileCount, 10),
|
|
14
|
+
2,
|
|
15
|
+
);
|
|
16
|
+
const ratio =
|
|
17
|
+
previousRatio != null ? Math.max(baseRatio, previousRatio) : baseRatio;
|
|
18
|
+
return Math.min(ratio, 0.999);
|
|
19
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Calculates a conservative progress ratio for bundle building.
|
|
14
|
+
*
|
|
15
|
+
* Because we know the `totalFileCount` is going to progressively increase
|
|
16
|
+
* starting with 1:
|
|
17
|
+
* - We use Math.max(totalFileCount, 10) to prevent the ratio from raising too
|
|
18
|
+
* quickly when the total file count is low. (e.g 1/2 5/6)
|
|
19
|
+
* - We use Math.pow(ratio, 2) as a conservative measure of progress.
|
|
20
|
+
* - The ratio is capped at 0.999 to ensure we don't display 100% until done.
|
|
21
|
+
* - If previousRatio is provided, the ratio will not go backwards.
|
|
22
|
+
*/
|
|
23
|
+
export function calculateBundleProgressRatio(
|
|
24
|
+
transformedFileCount: number,
|
|
25
|
+
totalFileCount: number,
|
|
26
|
+
previousRatio?: number,
|
|
27
|
+
): number {
|
|
28
|
+
const baseRatio = Math.pow(
|
|
29
|
+
transformedFileCount / Math.max(totalFileCount, 10),
|
|
30
|
+
2,
|
|
31
|
+
);
|
|
32
|
+
const ratio =
|
|
33
|
+
previousRatio != null ? Math.max(baseRatio, previousRatio) : baseRatio;
|
|
34
|
+
return Math.min(ratio, 0.999);
|
|
35
|
+
}
|
|
@@ -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<<89a26e72bdd126e3feb0abc9b3186d33>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/bundleToString.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 {Bundle, BundleMetadata} from 'metro-runtime/src/modules/types';
|
|
19
|
+
/**
|
|
20
|
+
* Serializes a bundle into a plain JS bundle.
|
|
21
|
+
*/
|
|
22
|
+
declare function bundleToString(bundle: Bundle): {
|
|
23
|
+
readonly code: string;
|
|
24
|
+
readonly metadata: BundleMetadata;
|
|
25
|
+
};
|
|
26
|
+
export default bundleToString;
|
|
@@ -0,0 +1,40 @@
|
|
|
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<<461f7a7b3b3d99d1f1e7eeeeb5125686>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/contextModule.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 {
|
|
19
|
+
ContextMode,
|
|
20
|
+
RequireContextParams,
|
|
21
|
+
} from '../ModuleGraph/worker/collectDependencies';
|
|
22
|
+
|
|
23
|
+
export type RequireContext = Readonly<{
|
|
24
|
+
recursive: boolean;
|
|
25
|
+
filter: RegExp;
|
|
26
|
+
/** Mode for resolving dynamic dependencies. Defaults to `sync` */
|
|
27
|
+
mode: ContextMode;
|
|
28
|
+
/** Absolute path of the directory to search in */
|
|
29
|
+
from: string;
|
|
30
|
+
}>;
|
|
31
|
+
/** Given a fully qualified require context, return a virtual file path that ensures uniqueness between paths with different contexts. */
|
|
32
|
+
export declare function deriveAbsolutePathFromContext(
|
|
33
|
+
from: string,
|
|
34
|
+
context: RequireContextParams,
|
|
35
|
+
): string;
|
|
36
|
+
/** Match a file against a require context. */
|
|
37
|
+
export declare function fileMatchesContext(
|
|
38
|
+
testPath: string,
|
|
39
|
+
context: RequireContext,
|
|
40
|
+
): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
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<<bcc2ba36a2edccb791b6d380f2c27ebe>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/contextModuleTemplates.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 {ContextMode} from '../ModuleGraph/worker/collectDependencies';
|
|
19
|
+
/**
|
|
20
|
+
* Generate a context module as a virtual file string.
|
|
21
|
+
*
|
|
22
|
+
* @prop {ContextMode} mode indicates how the modules should be loaded.
|
|
23
|
+
* @prop {string} modulePath virtual file path for the virtual module. Example: `require.context('./src')` -> `'/path/to/project/src'`.
|
|
24
|
+
* @prop {string[]} files list of absolute file paths that must be exported from the context module. Example: `['/path/to/project/src/index.js']`.
|
|
25
|
+
*
|
|
26
|
+
* @returns a string representing a context module (virtual file contents).
|
|
27
|
+
*/
|
|
28
|
+
export declare function getContextModuleTemplate(
|
|
29
|
+
mode: ContextMode,
|
|
30
|
+
modulePath: string,
|
|
31
|
+
files: string[],
|
|
32
|
+
): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
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<<a9f443cc44465917ebb470200e0f80d2>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/countLines.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 countLines(string: string): number;
|
|
19
|
+
export default countLines;
|
|
@@ -0,0 +1,50 @@
|
|
|
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<<cc8010b98646f8cfd713ae5505f71ef1>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/createWebsocketServer.js
|
|
13
|
+
* To regenerate, run:
|
|
14
|
+
* js1 build metro-ts-defs (internal) OR
|
|
15
|
+
* yarn run build-ts-defs (OSS)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import ws from 'ws';
|
|
19
|
+
|
|
20
|
+
type WebsocketServiceInterface<T> = {
|
|
21
|
+
readonly onClientConnect: (
|
|
22
|
+
url: string,
|
|
23
|
+
sendFn: (data: string) => void,
|
|
24
|
+
) => Promise<null | undefined | T>;
|
|
25
|
+
readonly onClientDisconnect?: (client: T) => unknown;
|
|
26
|
+
readonly onClientError?: (client: T, e: Error) => unknown;
|
|
27
|
+
readonly onClientMessage?: (
|
|
28
|
+
client: T,
|
|
29
|
+
message: string | Buffer | ArrayBuffer | Array<Buffer>,
|
|
30
|
+
sendFn: (data: string) => void,
|
|
31
|
+
) => unknown;
|
|
32
|
+
};
|
|
33
|
+
type HMROptions<TClient> = {
|
|
34
|
+
websocketServer: WebsocketServiceInterface<TClient>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Returns a WebSocketServer to be attached to an existing HTTP instance. It forwards
|
|
38
|
+
* the received events on the given "websocketServer" parameter. It must be an
|
|
39
|
+
* object with the following fields:
|
|
40
|
+
*
|
|
41
|
+
* - onClientConnect
|
|
42
|
+
* - onClientError
|
|
43
|
+
* - onClientMessage
|
|
44
|
+
* - onClientDisconnect
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
declare function createWebsocketServer<TClient>(
|
|
48
|
+
$$PARAM_0$$: HMROptions<TClient>,
|
|
49
|
+
): ws.Server;
|
|
50
|
+
export default createWebsocketServer;
|
|
@@ -0,0 +1,22 @@
|
|
|
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<<900f968546b7cc3e463e2de9d1f06200>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/debounceAsyncQueue.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 debounceAsyncQueue<T>(
|
|
19
|
+
fn: () => Promise<T>,
|
|
20
|
+
delay: number,
|
|
21
|
+
): () => Promise<T>;
|
|
22
|
+
export default debounceAsyncQueue;
|
|
@@ -0,0 +1,30 @@
|
|
|
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<<0c18118765a7730747fbadfd10e5d8f6>>
|
|
9
|
+
*
|
|
10
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
11
|
+
* Original file: packages/metro/src/lib/formatBundlingError.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 {FormattedError} from 'metro-runtime/src/modules/types';
|
|
18
|
+
|
|
19
|
+
export type CustomError = Error & {
|
|
20
|
+
readonly type?: string;
|
|
21
|
+
filename?: string;
|
|
22
|
+
lineNumber?: number;
|
|
23
|
+
errors?: Array<{
|
|
24
|
+
description: string;
|
|
25
|
+
filename: string;
|
|
26
|
+
lineNumber: number;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
declare function formatBundlingError(error: CustomError): FormattedError;
|
|
30
|
+
export default formatBundlingError;
|
|
@@ -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<<72fd04e53dc895f1305e10043f986edc>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/getAppendScripts.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 {Module} from '../DeltaBundler';
|
|
19
|
+
|
|
20
|
+
type Options<T extends number | string> = Readonly<{
|
|
21
|
+
asyncRequireModulePath: string;
|
|
22
|
+
createModuleId: ($$PARAM_0$$: string) => T;
|
|
23
|
+
getRunModuleStatement: (moduleId: T, globalPrefix: string) => string;
|
|
24
|
+
globalPrefix: string;
|
|
25
|
+
inlineSourceMap: null | undefined | boolean;
|
|
26
|
+
runBeforeMainModule: ReadonlyArray<string>;
|
|
27
|
+
runModule: boolean;
|
|
28
|
+
shouldAddToIgnoreList: ($$PARAM_0$$: Module) => boolean;
|
|
29
|
+
sourceMapUrl: null | undefined | string;
|
|
30
|
+
sourceUrl: null | undefined | string;
|
|
31
|
+
getSourceUrl: null | undefined | (($$PARAM_0$$: Module) => string);
|
|
32
|
+
}>;
|
|
33
|
+
declare function getAppendScripts<T extends number | string>(
|
|
34
|
+
entryPoint: string,
|
|
35
|
+
modules: ReadonlyArray<Module>,
|
|
36
|
+
options: Options<T>,
|
|
37
|
+
): ReadonlyArray<Module>;
|
|
38
|
+
export default getAppendScripts;
|
|
@@ -0,0 +1,32 @@
|
|
|
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<<cb5003f203d26e24459419b5f28e4f06>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/getGraphId.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 {TransformInputOptions} from '../DeltaBundler/types';
|
|
19
|
+
import type {ResolverInputOptions} from '../shared/types';
|
|
20
|
+
|
|
21
|
+
export declare type GraphId = string;
|
|
22
|
+
declare function getGraphId(
|
|
23
|
+
entryFile: string,
|
|
24
|
+
options: TransformInputOptions,
|
|
25
|
+
$$PARAM_2$$: Readonly<{
|
|
26
|
+
shallow: boolean;
|
|
27
|
+
lazy: boolean;
|
|
28
|
+
unstable_allowRequireContext: boolean;
|
|
29
|
+
resolverOptions: ResolverInputOptions;
|
|
30
|
+
}>,
|
|
31
|
+
): GraphId;
|
|
32
|
+
export default getGraphId;
|
|
@@ -0,0 +1,25 @@
|
|
|
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<<c57e62398654e4f07fea53d28c279b20>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/getPreludeCode.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 getPreludeCode($$PARAM_0$$: {
|
|
19
|
+
readonly extraVars?: {[$$Key$$: string]: unknown};
|
|
20
|
+
readonly isDev: boolean;
|
|
21
|
+
readonly globalPrefix: string;
|
|
22
|
+
readonly requireCycleIgnorePatterns: ReadonlyArray<RegExp>;
|
|
23
|
+
readonly unstable_forceFullRefreshPatterns: ReadonlyArray<RegExp>;
|
|
24
|
+
}): string;
|
|
25
|
+
export default getPreludeCode;
|
|
@@ -0,0 +1,31 @@
|
|
|
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<<a85e80b79c0295e96824c17436edfcca>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/getPrependedScripts.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 Bundler from '../Bundler';
|
|
19
|
+
import type {Module, default as DeltaBundler} from '../DeltaBundler';
|
|
20
|
+
import type {TransformInputOptions} from '../DeltaBundler/types';
|
|
21
|
+
import type {ResolverInputOptions} from '../shared/types';
|
|
22
|
+
import type {ConfigT} from 'metro-config';
|
|
23
|
+
|
|
24
|
+
declare function getPrependedScripts(
|
|
25
|
+
config: ConfigT,
|
|
26
|
+
options: Omit<TransformInputOptions, 'type'>,
|
|
27
|
+
resolverOptions: ResolverInputOptions,
|
|
28
|
+
bundler: Bundler,
|
|
29
|
+
deltaBundler: DeltaBundler,
|
|
30
|
+
): Promise<ReadonlyArray<Module>>;
|
|
31
|
+
export default getPrependedScripts;
|
|
@@ -0,0 +1,22 @@
|
|
|
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<<f1d42fcf747b4fa7641e50b8d4ddc424>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/isResolvedDependency.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 {Dependency, ResolvedDependency} from '../DeltaBundler/types';
|
|
19
|
+
|
|
20
|
+
export declare function isResolvedDependency(
|
|
21
|
+
dep: Dependency,
|
|
22
|
+
): dep is ResolvedDependency;
|
|
@@ -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<<95cf7d414507e2035210d06882d858b3>>
|
|
9
|
+
*
|
|
10
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
11
|
+
* Original file: packages/metro/src/lib/logToConsole.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 {Terminal} from 'metro-core';
|
|
18
|
+
|
|
19
|
+
declare const $$EXPORT_DEFAULT_DECLARATION$$: (
|
|
20
|
+
terminal: Terminal,
|
|
21
|
+
level: string,
|
|
22
|
+
...data: Array<unknown>
|
|
23
|
+
) => void;
|
|
24
|
+
declare type $$EXPORT_DEFAULT_DECLARATION$$ =
|
|
25
|
+
typeof $$EXPORT_DEFAULT_DECLARATION$$;
|
|
26
|
+
export default $$EXPORT_DEFAULT_DECLARATION$$;
|
|
@@ -0,0 +1,24 @@
|
|
|
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<<972fc847af4a55ba0e4863c90532e99c>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/parseBundleOptionsFromBundleRequestUrl.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 {BundleOptions} from '../shared/types';
|
|
19
|
+
|
|
20
|
+
declare function parseBundleOptionsFromBundleRequestUrl(
|
|
21
|
+
rawNonJscSafeUrlEncodedUrl: string,
|
|
22
|
+
platforms: Set<string>,
|
|
23
|
+
): Omit<BundleOptions, keyof {bundleType: string}> & {bundleType: string};
|
|
24
|
+
export default parseBundleOptionsFromBundleRequestUrl;
|
|
@@ -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<<e0f212b1e687fef985215d8c152e7c04>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/parseCustomResolverOptions.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 {CustomResolverOptions} from 'metro-resolver';
|
|
19
|
+
|
|
20
|
+
declare function parseCustomResolverOptions(
|
|
21
|
+
searchParams: URLSearchParams,
|
|
22
|
+
): CustomResolverOptions;
|
|
23
|
+
export default parseCustomResolverOptions;
|
|
@@ -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<<086e5d861160a99775fa58beba59492a>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/parseCustomTransformOptions.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 {CustomTransformOptions} from 'metro-transform-worker';
|
|
19
|
+
|
|
20
|
+
declare function parseCustomTransformOptions(
|
|
21
|
+
searchParams: URLSearchParams,
|
|
22
|
+
): CustomTransformOptions;
|
|
23
|
+
export default parseCustomTransformOptions;
|
|
@@ -0,0 +1,34 @@
|
|
|
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<<cd5e7346556814416374b8c8e79a8674>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/parseJsonBody.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} from 'http';
|
|
19
|
+
|
|
20
|
+
export type JsonData =
|
|
21
|
+
| {[$$Key$$: string]: JsonData}
|
|
22
|
+
| Array<JsonData>
|
|
23
|
+
| string
|
|
24
|
+
| number
|
|
25
|
+
| boolean
|
|
26
|
+
| null;
|
|
27
|
+
/**
|
|
28
|
+
* Attempt to parse a request body as JSON.
|
|
29
|
+
*/
|
|
30
|
+
declare function parseJsonBody(
|
|
31
|
+
req: IncomingMessage,
|
|
32
|
+
options?: {strict?: boolean},
|
|
33
|
+
): Promise<JsonData>;
|
|
34
|
+
export default parseJsonBody;
|
|
@@ -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
|
+
* @generated SignedSource<<61d935169a7ad0d7f2d7b4c6e4eb0a96>>
|
|
9
|
+
*
|
|
10
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
11
|
+
* Original file: packages/metro/src/lib/pathUtils.js
|
|
12
|
+
* To regenerate, run:
|
|
13
|
+
* js1 build metro-ts-defs (internal) OR
|
|
14
|
+
* yarn run build-ts-defs (OSS)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export declare const normalizePathSeparatorsToPosix: (
|
|
18
|
+
$$PARAM_0$$: string,
|
|
19
|
+
) => string;
|
|
20
|
+
export declare type normalizePathSeparatorsToPosix =
|
|
21
|
+
typeof normalizePathSeparatorsToPosix;
|
|
@@ -0,0 +1,24 @@
|
|
|
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<<5282fe2c42baa79f957ef2a40bec560b>>
|
|
10
|
+
*
|
|
11
|
+
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
|
|
12
|
+
* Original file: packages/metro/src/lib/relativizeSourceMap.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 {MixedSourceMap} from 'metro-source-map';
|
|
19
|
+
|
|
20
|
+
declare function relativizeSourceMapInline(
|
|
21
|
+
sourceMap: MixedSourceMap,
|
|
22
|
+
sourcesRoot: string,
|
|
23
|
+
): void;
|
|
24
|
+
export default relativizeSourceMapInline;
|