just-scripts
Version:
Just Stack Scripts
47 lines • 2.44 kB
TypeScript
export interface CopyInstruction {
/**
* The path+filename of the source files. If more than one file is provided, the files will be merged in order
* and output to a file in the destination path.
*/
sourceFilePath: string | string[];
/**
* The path+filename of the destination file.
*/
destinationFilePath: string;
}
export interface CopyConfig {
copyInstructions: CopyInstruction[];
}
/**
* Copies files into a destination directory with the same names.
* For example copyFilesToDestinationDirectory(['some/path/foo.js', 'bar.js'], 'dest/target') would result in the creation of
* files 'dest/target/foo.js' and 'dest/target/bar.js'.
*/
export declare function copyFilesToDestinationDirectory(sourceFilePaths: string | string[], destinationDirectory: string): CopyInstruction[];
/**
* Copies a file into a destination directory with a different name.
* For example copyFileToDestinationDirectoryWithRename('some/path/foo.js', 'bar.js', 'dest/target') would result in the creation of
* the file 'dest/target/bar.js'.
*/
export declare function copyFileToDestinationDirectoryWithRename(sourceFilePath: string, destinationName: string, destinationDirectory: string): CopyInstruction[];
/**
* Copies files into a destination directory with different names.
* For example copyFilesToDestinationDirectoryWithRename([{sourceFilePath:'some/path/foo.js', destinationName:'bar.js'}], 'dest/target')
* would result in the creation of the file 'dest/target/bar.js'.
*/
export declare function copyFilesToDestinationDirectoryWithRename(instrs: {
sourceFilePath: string;
destinationName: string;
}[], destinationDirectory: string): CopyInstruction[];
/**
* Copies all the files in a directory to the output folder.
* You can optionally provide a filter function that determines which files to copy.
*/
export declare function copyFilesInDirectory(sourceDirectoryPath: string, outputDirectoryPath: string, filterFunction?: (file: string) => boolean): CopyInstruction[];
/**
* Merges the contents of multiple files and places them in the output folder.
* This should only be used for text files and it should not be used for JavaScript
* files that we care about the sourcemap information since this does not merge sourcemaps.
*/
export declare function mergeFiles(sourceFilePaths: string[], destinationFilePath: string): CopyInstruction;
//# sourceMappingURL=CopyInstruction.d.ts.map