dt-app
Version:
The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.
47 lines (46 loc) • 1.78 kB
TypeScript
import type { OutputFile } from 'esbuild';
import type { CliAsset } from '../config/cli-options';
export declare const renderFileModeLabel: {
created: string;
updated: string;
deleted: string;
copied: string;
};
/** A single file inside a file map */
export type VirtualFile = {
content: Buffer;
mode?: keyof typeof renderFileModeLabel;
sourceMap?: Buffer;
};
/**
* The path represents a unix styled path relative to the app root
*/
export type FileMap = Record<string, VirtualFile>;
export type ImmutableFileMap = Readonly<{
readonly [path: string]: Readonly<VirtualFile>;
}>;
export type FileManager = {
fileExists: (filepath: string) => boolean;
throwIfFileDoesNotExist: (filepath: string) => void;
getFile: (filepath: string) => VirtualFile;
getFileName: (filepath: string) => string;
getFilePathsByRegex: (regex: RegExp | string) => string[];
getFileMap: () => ImmutableFileMap;
setFile: (filepath: string, content: Buffer) => void;
setFiles: (files: Record<string, VirtualFile>) => void;
mapEsbuildOutputFiles: (outputFiles: OutputFile[] | undefined, root: string, outdir: string) => FileManager;
deleteFile: (filepath: string) => void;
writeFileToDisc: (filepath: string) => Promise<void>;
writeFileMapToDisc: (root: string, dryRun?: boolean) => Promise<void>;
addAssetFiles: (options: {
root: string;
assetConfigs: CliAsset[];
distDir: string;
}) => Promise<void>;
resetFileMap: () => void;
};
/**
* This function should only be used for creating fileMap helpers that are not shared across more than one module
*/
export declare function createFileManager(initFileMap?: FileMap): FileManager;
export declare const fileMapManagerSingleton: FileManager;