## API Report File for "@rushstack/heft"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
///
import { AsyncParallelHook } from 'tapable';
import { AsyncSeriesWaterfallHook } from 'tapable';
import { CommandLineChoiceListParameter } from '@rushstack/ts-command-line';
import { CommandLineChoiceParameter } from '@rushstack/ts-command-line';
import { CommandLineFlagParameter } from '@rushstack/ts-command-line';
import { CommandLineIntegerListParameter } from '@rushstack/ts-command-line';
import { CommandLineIntegerParameter } from '@rushstack/ts-command-line';
import { CommandLineParameter } from '@rushstack/ts-command-line';
import { CommandLineStringListParameter } from '@rushstack/ts-command-line';
import { CommandLineStringParameter } from '@rushstack/ts-command-line';
import { CustomValidationFunction } from '@rushstack/heft-config-file';
import * as fs from 'node:fs';
import { ICustomJsonPathMetadata } from '@rushstack/heft-config-file';
import { ICustomPropertyInheritance } from '@rushstack/heft-config-file';
import { IJsonPathMetadata } from '@rushstack/heft-config-file';
import { IJsonPathMetadataResolverOptions } from '@rushstack/heft-config-file';
import { IJsonPathsMetadata } from '@rushstack/heft-config-file';
import { InheritanceType } from '@rushstack/heft-config-file';
import { INonCustomJsonPathMetadata } from '@rushstack/heft-config-file';
import { IOriginalValueOptions } from '@rushstack/heft-config-file';
import { IPackageJson } from '@rushstack/node-core-library';
import { IProjectConfigurationFileSpecification } from '@rushstack/heft-config-file';
import { IPropertiesInheritance } from '@rushstack/heft-config-file';
import { IPropertyInheritance } from '@rushstack/heft-config-file';
import { IPropertyInheritanceDefaults } from '@rushstack/heft-config-file';
import { IRigConfig } from '@rushstack/rig-package';
import { ITerminal } from '@rushstack/terminal';
import { ITerminalProvider } from '@rushstack/terminal';
import type { Operation } from '@rushstack/operation-graph';
import type { OperationGroupRecord } from '@rushstack/operation-graph';
import { PathResolutionMethod } from '@rushstack/heft-config-file';
import { PropertyInheritanceCustomFunction } from '@rushstack/heft-config-file';
import type { SyncHook } from 'tapable';
export { CommandLineChoiceListParameter }
export { CommandLineChoiceParameter }
export { CommandLineFlagParameter }
export { CommandLineIntegerListParameter }
export { CommandLineIntegerParameter }
export { CommandLineParameter }
export { CommandLineStringListParameter }
export { CommandLineStringParameter }
declare namespace ConfigurationFile {
export {
CustomValidationFunction,
ICustomJsonPathMetadata,
ICustomPropertyInheritance,
IJsonPathMetadata,
IJsonPathMetadataResolverOptions,
IJsonPathsMetadata,
INonCustomJsonPathMetadata,
IOriginalValueOptions,
IProjectConfigurationFileSpecification,
IPropertiesInheritance,
IPropertyInheritance,
IPropertyInheritanceDefaults,
InheritanceType,
PathResolutionMethod,
PropertyInheritanceCustomFunction
}
}
export { ConfigurationFile }
// @public
export type GlobFn = (pattern: string | string[], options?: IGlobOptions | undefined) => Promise;
// @public (undocumented)
export class HeftConfiguration {
readonly buildFolderPath: string;
// @internal
_checkForRigAsync(): Promise;
readonly globalTerminal: ITerminal;
get heftPackageJson(): IPackageJson;
// @internal (undocumented)
static initialize(options: _IHeftConfigurationInitializationOptions): HeftConfiguration;
readonly numberOfCores: number;
get projectConfigFolderPath(): string;
get projectPackageJson(): IPackageJson;
get rigConfig(): IRigConfig;
get rigPackageResolver(): IRigPackageResolver;
get slashNormalizedBuildFolderPath(): string;
get tempFolderPath(): string;
readonly terminalProvider: ITerminalProvider;
tryLoadProjectConfigurationFile(options: IProjectConfigurationFileSpecification, terminal: ITerminal): TConfigFile | undefined;
tryLoadProjectConfigurationFileAsync(options: IProjectConfigurationFileSpecification, terminal: ITerminal): Promise;
}
// @public
export interface ICopyOperation extends IFileSelectionSpecifier {
destinationFolders: string[];
flatten?: boolean;
hardlink?: boolean;
}
// @public
export interface IDeleteOperation extends IFileSelectionSpecifier {
}
// @public
export interface IFileSelectionSpecifier {
excludeGlobs?: string[];
fileExtensions?: string[];
includeGlobs?: string[];
sourcePath?: string;
}
// @public
export interface IGlobOptions {
absolute?: boolean;
cwd?: string;
dot?: boolean;
ignore?: string[];
}
// @internal (undocumented)
export interface _IHeftConfigurationInitializationOptions {
cwd: string;
numberOfCores: number;
terminalProvider: ITerminalProvider;
}
// @public
export interface IHeftDefaultParameters {
readonly clean: boolean;
readonly debug: boolean;
readonly locales: Iterable;
readonly production: boolean;
readonly verbose: boolean;
readonly watch: boolean;
}
// @public
export interface IHeftLifecycleCleanHookOptions {
addDeleteOperations: (...deleteOperations: IDeleteOperation[]) => void;
}
// @public
export interface IHeftLifecycleHooks {
clean: AsyncParallelHook;
phaseFinish: SyncHook;
phaseStart: SyncHook;
recordMetrics: AsyncParallelHook;
taskFinish: SyncHook;
taskStart: SyncHook;
toolFinish: AsyncParallelHook;
toolStart: AsyncParallelHook;
}
// @public
export interface IHeftLifecyclePlugin extends IHeftPlugin {
}
// @public
export interface IHeftLifecycleSession {
readonly hooks: IHeftLifecycleHooks;
readonly logger: IScopedLogger;
readonly parameters: IHeftParameters;
requestAccessToPluginByName(pluginToAccessPackage: string, pluginToAccessName: string, pluginApply: (pluginAccessor: T) => void): void;
readonly tempFolderPath: string;
}
// @public
export interface IHeftLifecycleToolFinishHookOptions {
}
// @public
export interface IHeftLifecycleToolStartHookOptions {
}
// @public
export interface IHeftParameters extends IHeftDefaultParameters {
getChoiceListParameter(parameterLongName: string): CommandLineChoiceListParameter;
getChoiceParameter(parameterLongName: string): CommandLineChoiceParameter;
getFlagParameter(parameterLongName: string): CommandLineFlagParameter;
getIntegerListParameter(parameterLongName: string): CommandLineIntegerListParameter;
getIntegerParameter(parameterLongName: string): CommandLineIntegerParameter;
getStringListParameter(parameterLongName: string): CommandLineStringListParameter;
getStringParameter(parameterLongName: string): CommandLineStringParameter;
}
// @public
export interface IHeftParsedCommandLine {
readonly commandName: string;
readonly unaliasedCommandName: string;
}
// @public (undocumented)
export interface IHeftPhase {
// (undocumented)
cleanFiles: ReadonlySet;
// (undocumented)
consumingPhases: ReadonlySet;
// (undocumented)
dependencyPhases: ReadonlySet;
// (undocumented)
readonly phaseDescription: string | undefined;
// (undocumented)
readonly phaseName: string;
// (undocumented)
tasks: ReadonlySet;
// (undocumented)
tasksByName: ReadonlyMap;
}
// @public (undocumented)
export interface IHeftPhaseFinishHookOptions {
// (undocumented)
operation: OperationGroupRecord;
}
// @public
export interface IHeftPhaseOperationMetadata {
// (undocumented)
phase: IHeftPhase;
}
// @public (undocumented)
export interface IHeftPhaseStartHookOptions {
// (undocumented)
operation: OperationGroupRecord;
}
// @public
export interface IHeftPlugin {
readonly accessor?: object;
apply(session: TSession, heftConfiguration: HeftConfiguration, pluginOptions?: TOptions): void;
}
// @public (undocumented)
export interface IHeftRecordMetricsHookOptions {
// (undocumented)
metricData: IMetricsData;
// (undocumented)
metricName: string;
}
// @public (undocumented)
export interface IHeftTask {
// (undocumented)
readonly consumingTasks: ReadonlySet;
// (undocumented)
readonly dependencyTasks: ReadonlySet;
// (undocumented)
readonly parentPhase: IHeftPhase;
// (undocumented)
readonly taskName: string;
}
// @public
export interface IHeftTaskFileOperations {
copyOperations: Set;
deleteOperations: Set;
}
// @public (undocumented)
export interface IHeftTaskFinishHookOptions {
// (undocumented)
operation: Operation;
}
// @public
export interface IHeftTaskHooks {
readonly registerFileOperations: AsyncSeriesWaterfallHook;
readonly run: AsyncParallelHook;
readonly runIncremental: AsyncParallelHook;
}
// @public
export interface IHeftTaskOperationMetadata {
// (undocumented)
phase: IHeftPhase;
// (undocumented)
task: IHeftTask;
}
// @public
export interface IHeftTaskPlugin extends IHeftPlugin {
}
// @public
export interface IHeftTaskRunHookOptions {
// @beta
readonly abortSignal: AbortSignal;
readonly globAsync: GlobFn;
}
// @public
export interface IHeftTaskRunIncrementalHookOptions extends IHeftTaskRunHookOptions {
readonly requestRun: () => void;
readonly watchFs: IWatchFileSystem;
readonly watchGlobAsync: WatchGlobFn;
}
// @public
export interface IHeftTaskSession {
readonly hooks: IHeftTaskHooks;
readonly logger: IScopedLogger;
readonly parameters: IHeftParameters;
readonly parsedCommandLine: IHeftParsedCommandLine;
requestAccessToPluginByName(pluginToAccessPackage: string, pluginToAccessName: string, pluginApply: (pluginAccessor: T) => void): void;
readonly taskName: string;
readonly tempFolderPath: string;
}
// @public (undocumented)
export interface IHeftTaskStartHookOptions {
// (undocumented)
operation: Operation;
}
// @public
export interface IIncrementalCopyOperation extends ICopyOperation {
onlyIfChanged?: boolean;
}
// @public (undocumented)
export interface IMetricsData {
bootDurationMs: number;
command: string;
commandParameters: Record;
encounteredError?: boolean;
machineArch: string;
machineCores: number;
machineOs: string;
machineProcessor: string;
machineTotalMemoryMB: number;
taskTotalExecutionMs: number;
totalUptimeMs: number;
}
// @internal (undocumented)
export interface _IPerformanceData {
// (undocumented)
encounteredError?: boolean;
// (undocumented)
taskTotalExecutionMs: number;
}
// @public
export interface IReaddirOptions {
withFileTypes: true;
}
// @public
export interface IRigPackageResolver {
// (undocumented)
resolvePackageAsync(packageName: string, terminal: ITerminal): Promise;
}
// @beta
export interface IRunScript {
runAsync: (options: IRunScriptOptions) => Promise;
}
// @beta
export interface IRunScriptOptions {
// (undocumented)
heftConfiguration: HeftConfiguration;
// (undocumented)
heftTaskSession: IHeftTaskSession;
// (undocumented)
runOptions: IHeftTaskRunHookOptions;
// (undocumented)
scriptOptions: Record;
}
// @public
export interface IScopedLogger {
emitError(error: Error): void;
emitWarning(warning: Error): void;
readonly hasErrors: boolean;
readonly loggerName: string;
resetErrorsAndWarnings(): void;
readonly terminal: ITerminal;
}
// @public
export interface IWatchedFileState {
changed: boolean;
}
// @public
export interface IWatchFileSystem {
getStateAndTrack(filePath: string): IWatchedFileState;
getStateAndTrackAsync(filePath: string): Promise;
lstat(filePath: string, callback: StatCallback): void;
lstatSync(filePath: string): fs.Stats;
readdir(filePath: string, callback: ReaddirStringCallback): void;
// (undocumented)
readdir(filePath: string, options: IReaddirOptions, callback: ReaddirDirentCallback): void;
readdirSync(filePath: string): string[];
// (undocumented)
readdirSync(filePath: string, options: IReaddirOptions): fs.Dirent[];
stat(filePath: string, callback: StatCallback): void;
statSync(filePath: string): fs.Stats;
}
// @internal
export interface _IWatchpackPendingEventState {
hasPendingEvents: boolean;
pendingFileEvents: ReadonlyArray<_IWatchpackPendingFileEvent>;
}
// @internal
export interface _IWatchpackPendingFileEvent {
filePath: string;
}
// @internal
export class _MetricsCollector {
recordAsync(command: string, performanceData?: Partial<_IPerformanceData>, parameters?: Record): Promise;
// (undocumented)
readonly recordMetricsHook: AsyncParallelHook;
setStartTime(): void;
}
// @public
export type ReaddirDirentCallback = (error: NodeJS.ErrnoException | null, files: fs.Dirent[]) => void;
// @public
export type ReaddirStringCallback = (error: NodeJS.ErrnoException | null, files: string[]) => void;
// @public
export type StatCallback = (error: NodeJS.ErrnoException | null, stats: fs.Stats) => void;
// @internal
export function _tryGetWatchpackPendingEventState(watcher: object | undefined): _IWatchpackPendingEventState | undefined;
// @internal
export function _waitForWatchpackPendingEventsAsync(getWatcher: () => object | undefined, hasChanges: () => boolean): Promise;
// @public
export type WatchGlobFn = (pattern: string | string[], options?: IGlobOptions | undefined) => Promise