/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
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<Smartfile>;
    static fromBuffer(filePath: string, contentBufferArg: Buffer, baseArg?: string): Promise<Smartfile>;
    static fromString(filePath: string, contentStringArg: string, encodingArg: 'utf8' | 'binary', baseArg?: string): Promise<Smartfile>;
    static fromFoldedJson(foldedJsonArg: string): Promise<Smartfile>;
    /**
     * creates a Smartfile from a ReadableStream
     * @param stream a readable stream that provides file content
     * @param filePath the file path to associate with the content
     * @param baseArg the base path to use for the file
     */
    static fromStream(stream: plugins.stream.Readable, filePath: string, baseArg?: string): Promise<Smartfile>;
    /**
     * 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<void>;
    /**
     * 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<void>;
    /**
     * writes the file to a directory combined with the relative path portion
     * @param dirPathArg
     * @returns
     */
    writeToDir(dirPathArg: string): Promise<string>;
    /**
     * read file from disk
     */
    read(): Promise<void>;
    /**
     * deletes the file from disk at its original location
     */
    delete(): Promise<void>;
    /**
     * 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<string>;
    updateFileName(fileNameArg: string): void;
    editContentAsString(editFuncArg: (fileStringArg: string) => Promise<string>): Promise<void>;
    /**
     * Returns a ReadableStream from the file's content buffer
     */
    getStream(): plugins.stream.Readable;
}
