just-scripts
Version:
Just Stack Scripts
53 lines • 2.86 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;
/**
* Set to true if a copy or merge should be performed, false if a symlink should be created.
* If multiple source files are specified (i.e. a merge), this must be true or undefined.
* The default value of undefined is equivalent to true for a merge, false in all other cases.
*/
noSymlink?: boolean;
}
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, noSymlinks?: boolean): 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, noSymlink?: boolean): 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, noSymlinks?: boolean): 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, noSymlinks?: 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