Skip to content

Directory

ts
import { LoomFile } from './file.js';
import { List } from './list.js';
import { SourceAdapter } from '../definitions.js';
export declare class Directory {
    protected readonly _path: string;
    protected readonly _adapter: SourceAdapter;
    protected _strict: boolean;
    protected isRoot: boolean;
    constructor(adapter: SourceAdapter, path: string, ...paths: string[]);
    strict(strictMode?: boolean): this;
    get path(): string;
    get name(): string;
    get parent(): Directory | undefined;
    get adapter(): SourceAdapter<import("../definitions.js").FileStat>;
    exists(): Promise<boolean>;
    create(): Promise<void>;
    copyTo(target: Directory): Promise<void>;
    delete(recursive?: boolean): Promise<void>;
    subDir(name: string): Directory;
    list(): Promise<List>;
    /**
       * Returns the relative path to the given path or undefined if the given dir or file is parent or not related
       */
    relativePath(dir: Directory | LoomFile): string | undefined;
    file(name: string): LoomFile;
    protected filesRecursion(list: List): Promise<List<LoomFile>>;
    files(recursive?: boolean): Promise<List<LoomFile>>;
    [Symbol.toPrimitive](): string;
    get [Symbol.toStringTag](): string;
}