projex
Version:
A command line to manage the workflow
32 lines (31 loc) • 1.76 kB
TypeScript
import { Folders, IFile } from '../models';
export declare class DirectoryUtils {
private root;
private list;
constructor(list?: boolean | undefined);
chooseFolders: (folderList: IFile[], message: string, action: string) => Promise<Folders>;
getDirectories: (srcpath: string) => Promise<Array<string>>;
getFilesInDirectory: (extension: string | null | undefined) => Promise<IFile[]>;
promptSelectElements: (files: IFile[], message?: string, action?: string) => Promise<string[]>;
/**
* The function checks if a string ends with a specific suffix.
* @param {string} str - The `str` parameter is a string that represents the main string we want to
* check if it ends with a specific suffix.
* @param {string} suffix - The "suffix" parameter is a string that represents the ending portion of
* the "str" string. The function checks if the "str" string ends with the "suffix" string.
* @returns a boolean value. It returns true if the given string ends with the specified suffix, and
* false otherwise.
*/
endsWith(str: string, suffix: string): boolean;
getCurrentDirectory: () => string;
/**
* The function getCurrentDirectory returns an array containing an object with the name and path of
* the current directory.
* @returns An array containing an object with the name and path of the current directory.
*/
getCurrentDirectoryFormatted: () => IFile[];
getFolderDirectories: () => Promise<(IFile | undefined)[]>;
getSelectedElements(files: IFile[], selected: string[]): IFile[];
getFolders(): Promise<(IFile | undefined)[]>;
runCommandInFolders(folders: (IFile | undefined)[], method: (root: string) => Promise<void>): Promise<void>;
}