first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { Console, DuplicatesSet, FileMapDelta, FileMapPlugin, FileMapPluginInitOptions, FileMetadata, HasteConflict, HasteMap, HasteMapItemMetadata, HTypeValue, Path, PerfLogger } from "../flow-types";
export interface HasteMapOptions {
readonly console?: null | undefined | Console;
readonly enableHastePackages: boolean;
readonly perfLogger?: null | PerfLogger;
readonly platforms: ReadonlySet<string>;
readonly rootDir: Path;
readonly failValidationOnConflicts: boolean;
}
declare class HastePlugin implements HasteMap, FileMapPlugin<null> {
readonly name: any;
constructor(options: HasteMapOptions);
initialize($$PARAM_0$$: FileMapPluginInitOptions<null>): Promise<void>;
getSerializableSnapshot(): null;
getModule(name: string, platform?: null | undefined | string, supportsNativePlatform?: null | undefined | boolean, type?: null | undefined | HTypeValue): null | undefined | Path;
getPackage(name: string, platform: null | undefined | string, _supportsNativePlatform?: null | undefined | boolean): null | undefined | Path;
_getModuleMetadata(name: string, platform: null | undefined | string, supportsNativePlatform: boolean): HasteMapItemMetadata | null;
_assertNoDuplicates(name: string, platform: string, supportsNativePlatform: boolean, relativePathSet: null | undefined | DuplicatesSet): void;
bulkUpdate(delta: FileMapDelta): Promise<void>;
onNewOrModifiedFile(relativeFilePath: string, fileMetadata: FileMetadata): void;
setModule(id: string, module: HasteMapItemMetadata): void;
onRemovedFile(relativeFilePath: string, fileMetadata: FileMetadata): void;
assertValid(): void;
_recoverDuplicates(moduleName: string, relativeFilePath: string): void;
computeConflicts(): Array<HasteConflict>;
getCacheKey(): string;
}
export default HastePlugin;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/plugins/HastePlugin");

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { FileMapDelta, FileMapPlugin, FileMapPluginInitOptions, MockMap as IMockMap, Path, RawMockMap } from "../flow-types";
export declare const CACHE_VERSION: 2;
declare class MockPlugin implements FileMapPlugin<RawMockMap>, IMockMap {
readonly name: any;
constructor($$PARAM_0$$: {
readonly console: typeof console;
readonly mocksPattern: RegExp;
readonly rawMockMap?: RawMockMap;
readonly rootDir: Path;
readonly throwOnModuleCollision: boolean;
});
initialize($$PARAM_0$$: FileMapPluginInitOptions<RawMockMap>): Promise<void>;
getMockModule(name: string): null | undefined | Path;
bulkUpdate(delta: FileMapDelta): Promise<void>;
onNewOrModifiedFile(relativeFilePath: Path): void;
onRemovedFile(relativeFilePath: Path): void;
getSerializableSnapshot(): RawMockMap;
assertValid(): void;
getCacheKey(): string;
}
export default MockPlugin;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/plugins/MockPlugin");

View File

@@ -0,0 +1,19 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { DuplicatesSet } from "../../flow-types";
export declare class DuplicateHasteCandidatesError extends Error {
hasteName: string;
platform: string | null;
supportsNativePlatform: boolean;
duplicatesSet: DuplicatesSet;
constructor(name: string, platform: string, supportsNativePlatform: boolean, duplicatesSet: DuplicatesSet);
}

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/plugins/haste/DuplicateHasteCandidatesError");
module.exports.default = module.exports;

View File

@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { HasteConflict } from "../../flow-types";
export declare class HasteConflictsError extends Error {
constructor(conflicts: ReadonlyArray<HasteConflict>);
getDetailedMessage(pathsRelativeToRoot: null | undefined | string): string;
}

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/plugins/haste/HasteConflictsError");
module.exports.default = module.exports;

View File

@@ -0,0 +1,22 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
import type { HasteMapItem } from "../../flow-types";
export interface Conflict {
id: string;
platform?: string | null;
absolutePaths: Array<string>;
type?: "duplicate" | "shadowing";
}
export declare function computeHasteConflicts($$PARAM_0$$: {
readonly duplicates: ReadonlyMap<string, ReadonlyMap<string, ReadonlyMap<string, number>>>;
readonly map: ReadonlyMap<string, HasteMapItem>;
readonly rootDir: string;
}): Array<Conflict>;

View File

@@ -0,0 +1,2 @@
module.exports = require("metro-file-map/private/plugins/haste/computeConflicts");
module.exports.default = module.exports;

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
declare function getPlatformExtension(file: string, platforms: ReadonlySet<string>): null | undefined | string;
export default getPlatformExtension;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/plugins/haste/getPlatformExtension");

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
*/
declare const getMockName: (filePath: string) => string;
export default getMockName;

View File

@@ -0,0 +1 @@
module.exports = require("metro-file-map/private/plugins/mocks/getMockName");