@mornya/cli-libs
Version:
The project of the utilities for CLI.
27 lines (26 loc) • 1.78 kB
TypeScript
type GlobPath = string | string[];
type GetConfig<T> = {
from: string;
data?: T;
};
export declare function dir(...names: string[]): string;
export declare function getGlob(globPath: GlobPath, callback?: ((item: string, index: number) => boolean | void) | undefined): string[];
export declare function getRealPath(): string;
export declare function resolvePath(...args: string[]): string;
export declare function rimraf(globPath: GlobPath): string[];
export declare function emptyDir(globPath: GlobPath): string[];
export declare function mkdirs(dirName: string): void;
export declare function move(srcGlobPath: GlobPath, destPath: string): string[];
export declare function copy(srcGlobPath: GlobPath, destPath: string, isSymlink?: boolean): string[];
export declare function copyDir(srcGlobPath: GlobPath, destPath: string, exceptFiles?: string[] | undefined): string[];
export declare function isExist(dirName: string): boolean;
export declare function isEmptyDir(dirName: string): boolean;
export declare function list(dirName: string): string[];
export declare function read(fileName: string): string;
export declare function readJSON<T = {}>(fileName: string): T;
export declare function write(fileName: string, value: string): void;
export declare function writePrettyJSON(fileName: string, value: {}, maxLineLength?: number | undefined): void;
export declare function getDirectoryFiles(dirName: string, executor: (isDir: boolean, relPath: string, currDir: string, file: string) => boolean | void): void;
export declare function getFilteredExistPaths(rootPath: string, targetPathList?: string[] | undefined, isOnly?: boolean | undefined): string[];
export declare function getConfig<T>(rootPath: string, name: string, filename?: string): GetConfig<T>;
export {};