UNPKG

piral-cli

Version:

The standard CLI for creating and building a Piral instance or a Pilet.

43 lines (42 loc) 2.99 kB
import { ForceOverwrite } from './enums'; export interface Destination { outDir: string; outFile: string; } export declare function getDestination(entryFiles: string, target: string): Destination; export declare function removeAny(target: string): Promise<void>; export declare function removeDirectory(targetDir: string): Promise<boolean>; export declare function createDirectory(targetDir: string): Promise<boolean>; export declare function getEntryFiles(content: string, basePath: string): Promise<string[]>; export declare function makeTempDir(prefix: string): Promise<string>; export declare function checkExists(target: string): Promise<boolean>; export declare function checkExistingDirectory(target: string): Promise<boolean>; export declare function checkIsDirectory(target: string): Promise<boolean>; export declare function getFileNames(target: string): Promise<string[]>; export declare function findFile(topDir: string, fileName: string | Array<string>, stopDir?: string): Promise<string>; export declare function matchAnyPilet(baseDir: string, patterns: Array<string>): Promise<string[]>; export declare function matchFiles(baseDir: string, pattern: string): Promise<string[]>; export declare function createFileIfNotExists(targetDir: string, fileName: string, content: Buffer | string, forceOverwrite?: ForceOverwrite): Promise<void>; export declare function updateExistingFile(targetDir: string, fileName: string, content: string): Promise<void>; export declare function getHash(targetFile: string): Promise<string>; export declare function mergeWithJson<T>(targetDir: string, fileName: string, newContent: T): Promise<any>; export declare function readJson<T = any>(targetDir: string, fileName: string, defaultValue?: {}): Promise<T>; export declare function readBinary(targetDir: string, fileName: string): Promise<Buffer<ArrayBufferLike>>; export declare function readText(targetDir: string, fileName: string): Promise<string>; export declare function writeJson<T = any>(targetDir: string, fileName: string, data: T, beautify?: boolean): Promise<void>; export declare function writeText(targetDir: string, fileName: string, content: string): Promise<void>; export declare function writeBinary(targetDir: string, fileName: string, data: Buffer): Promise<void>; export declare function updateExistingJson<T>(targetDir: string, fileName: string, newContent: T): Promise<void>; export declare function copy(source: string, target: string, forceOverwrite?: ForceOverwrite): Promise<boolean>; /** * @deprecated Will be removed with v1. Please use "removeFile". */ export declare function remove(target: string): Promise<void>; export declare function removeFile(target: string): Promise<void>; export declare function move(source: string, target: string, forceOverwrite?: ForceOverwrite): Promise<string>; export declare function getSourceFiles(entry: string): Promise<{ path: string; directory: string; name: string; read(): Promise<string>; }[]>;