/** * 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 * @format */ 'use strict'; 'use strict'; type ModuleID = string; export type Path = string; type Platform = string; type Platforms = Set; export type Extensions = Array; export type Module = { path: Path, type: 'Module', getName(): ModuleID, getPackage(): ?Package, isHaste(): Promise, ... }; export type Package = { path: Path, root: Path, type: 'Package', getMain(): Path, getName(): ModuleID, isHaste(): Promise, redirectRequire(id: ModuleID): Path | false, ... }; export type ModuleCache = { getModule(path: Path): Module, getPackage(path: Path): Package, getPackageOf(path: Path): ?Package, ... }; export type FastFS = { dirExists(path: Path): boolean, closest(path: string, fileName: string): ?string, fileExists(path: Path): boolean, getAllFiles(): Array, matches(directory: Path, pattern: RegExp): Array, ... }; type HasteMapOptions = {| extensions: Extensions, files: Array, moduleCache: ModuleCache, platforms: Platforms, preferNativePlatform: true, |}; declare class HasteMap { // node-haste/DependencyGraph/HasteMap.js build(): Promise; constructor(options: HasteMapOptions): void; }