/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { type Package } from "@fluidframework/build-tools"; type PackageName = string; type Script = string; /** * `${package.name}#${script}` */ export type PackageNameAndScript = string; type AbsoluteFilePath = string; type ModuleType = "CommonJS" | "ESM"; /** * Representation of a package.json script that generates "build" output. */ export interface BuildScript { /** * Name of the package where script is located. */ packageName: PackageName; /** * Name of the script within package. */ script: Script; /** * The recognized module type, if any, that the script generates. * An `undefined` value indicates that script is not known to be associated * with a certain module type. This might happen for script that only copies * files as copying files has no inherent association to one module type or * the other. */ moduleType: ModuleType | undefined; } /** * Maintains a database of build outputs by package script entries. * * @remarks * Queries made to the database provide context (package group) sufficient * to load packages and their dependencies, which are cached to expedite * further queries. * See {@link @fluidframework/build-tools#FluidRepo.createPackageMap | FluidRepo.createPackageMap} * for package group (map) creation. */ export declare class FluidBuildDatabase { private readonly outputSource; private readonly packageBuildScripts; /** * Find build scripts in dependencies that match given scripts module type * * @param packageGroup - map (cache) of packageName's related packages * @param packageName - package name * @param script - packages script name * @param ignorePackage - optional filter function to ignore select packages * @returns Array of groups of possible predecessor tasks */ getPossiblePredecessorTasks(packageGroup: ReadonlyMap, packageName: PackageName, script: Script, ignorePackage?: (packageInfo: { name: string; version: string; }) => boolean): BuildScript[][]; /** * Exact set of predecessor tasks that build given inputs. * * @param packageGroup - map (cache) of packageName's related packages * @param packageName - package name * @param requiredInputs - absolute file paths required * @returns Set of predecessor tasks */ getPredecessorTasks(packageGroup: ReadonlyMap, packageName: PackageName, requiredInputs: AbsoluteFilePath[]): Set; private loadPackageAndDependencies; } export {}; //# sourceMappingURL=fluidBuildDatabase.d.ts.map