import type { HeftConfiguration, IHeftTaskRunHookOptions, IHeftTaskRunIncrementalHookOptions, IHeftTaskSession } from '@rushstack/heft'; import type { ITerminal } from '@rushstack/terminal'; import type { IAssetPluginOptions, IResourceStaticAssetTypingsConfigurationJson, ISourceStaticAssetTypingsConfigurationJson, StaticAssetConfigurationFileLoader } from './types'; /** * Options for constructing a static asset typings generator */ export interface IStaticAssetGeneratorOptions { /** * A getter for the loader for the riggable config file in the project. */ tryGetConfigAsync: StaticAssetConfigurationFileLoader; /** * The path to the build folder, normalized to use forward slashes as the directory separator. */ slashNormalizedBuildFolderPath: string; /** * @param relativePath - The relative path of the file to get additional output files for. * @returns An array of output file names. */ getAdditionalOutputFiles?: (relativePath: string) => string[]; /** * @param relativePath - The relative path of the file being processed. * @param filePath - The absolute path of the file being processed. * @param oldVersion - The old version of the file, if any. * @returns The new version of the file, if emit should occur. */ getVersionAndEmitOutputFilesAsync: (relativePath: string, filePath: string, oldVersion: string | undefined) => Promise; } export type IRunGeneratorOptions = IHeftTaskRunHookOptions & Partial>; export interface IStaticAssetTypingsGenerator { /** * Runs this generator in incremental mode. * * @param runOptions - The task run hook options from Heft * @returns A promise that resolves when the generator has finished processing. */ runIncrementalAsync: (runOptions: IRunGeneratorOptions) => Promise; } export declare function tryGetConfigFromPluginOptionsAsync(terminal: ITerminal, buildFolder: string, rigConfig: HeftConfiguration['rigConfig'], options: IAssetPluginOptions, type: 'resource'): Promise; export declare function tryGetConfigFromPluginOptionsAsync(terminal: ITerminal, buildFolder: string, rigConfig: HeftConfiguration['rigConfig'], options: IAssetPluginOptions, type: 'source'): Promise; /** * Constructs a typings generator for processing static assets * * @param taskSession - The Heft task session * @param rigConfig - The Heft configuration * @param options - Options for the generator * @returns */ export declare function createTypingsGeneratorAsync(taskSession: IHeftTaskSession, options: IStaticAssetGeneratorOptions): Promise; /** * @internal * Returns true if the current map has different entries than the old map. */ export declare function hasChanges(current: ReadonlyMap, old: ReadonlyMap): boolean; //# sourceMappingURL=StaticAssetTypingsGenerator.d.ts.map