///
///
import * as plugins from './smartfile.plugins.js';
export interface ISmartfileConstructorOptions {
path: string;
contentBuffer: Buffer;
base: string;
}
/**
* class Smartfile
* -> is vinyl file compatible
*/
export declare class Smartfile extends plugins.smartjson.Smartjson {
/**
* creates a Smartfile from a filePath
* @param filePath
*/
static fromFilePath(filePath: string, baseArg?: string): Promise;
static fromBuffer(filePath: string, contentBufferArg: Buffer, baseArg?: string): Promise;
static fromString(filePath: string, contentStringArg: string, encodingArg: 'utf8' | 'binary', baseArg?: string): Promise;
static fromFoldedJson(foldedJsonArg: string): Promise;
/**
* the relative path of the file
*/
path: string;
/**
* a parsed path
*/
get parsedPath(): plugins.path.ParsedPath;
get absolutePath(): string;
get absoluteParsedPath(): plugins.path.ParsedPath;
/**
* the content of the file as Buffer
*/
contentBuffer: Buffer;
/**
* The current working directory of the file
* Note:this is similar to gulp and different from native node path base
*/
base: string;
/**
* sync the file with disk
*/
sync: boolean;
/**
* the constructor of Smartfile
* @param optionsArg
*/
constructor(optionsArg: ISmartfileConstructorOptions);
/**
* set contents from string
* @param contentString
*/
setContentsFromString(contentString: string, encodingArg?: 'utf8' | 'binary'): void;
/**
* write file to disk at its original location
* Behaviours:
* - no argument write to exactly where the file was picked up
*/
write(): Promise;
/**
* writes the file to path given as argument
* note: if the path is not absolute, takes process.cwd() as base
* @param filePathArg
*/
writeToDiskAtPath(filePathArg: string): Promise;
/**
* writes the file to a directory combined with the relative path portion
* @param dirPathArg
* @returns
*/
writeToDir(dirPathArg: string): Promise;
/**
* read file from disk
*/
read(): Promise;
/**
* deletes the file from disk at its original location
*/
delete(): Promise;
/**
* vinyl-compatibility: alias of this.contentBuffer
*/
get contents(): Buffer;
set contents(contentsArg: Buffer);
/**
* vinyl-compatibility
*/
get cwd(): string;
/**
* return relative path of file
*/
get relative(): string;
/**
* return truw when the file has content
*/
isNull(): boolean;
/**
* return true if contents are Buffer
*/
isBuffer(): boolean;
isDirectory(): boolean;
isStream(): boolean;
isSymbolic(): boolean;
getHash(typeArg?: 'path' | 'content' | 'all'): Promise;
updateFileName(fileNameArg: string): void;
editContentAsString(editFuncArg: (fileStringArg: string) => Promise): Promise;
}