mise API - v0.0.0
    Preparing search index...

    Interface VFSProvider

    Base contract that every Virtual File System Provider must implement.

    interface VFSProvider {
        prefix: string;
        cp(src: string, dest: string, options: CpOptions): Promise<VfsOutcome>;
        linkTarget_resolve?(path: string): Promise<Result<string>>;
        list(
            path: string,
            options?: { reverse?: boolean; sort?: "name" | "size" | "date" | "owner" },
        ): Promise<Result<VFSItem[]>>;
        mkdir?(path: string): Promise<VfsOutcome>;
        mkdirTree?(path: string): Promise<VfsOutcome>;
        read?(path: string): Promise<VfsOutcome<string>>;
        readBinary?(path: string): Promise<VfsOutcome<Buffer<ArrayBufferLike>>>;
        rename?(src: string, dest: string): Promise<VfsOutcome>;
        rm?(path: string): Promise<VfsOutcome>;
        rmdir?(path: string): Promise<VfsOutcome>;
        rmTree?(path: string): Promise<VfsOutcome>;
        subtree?(path: string): Promise<VFSSubtree | null>;
        write?(
            path: string,
            content: string | Buffer<ArrayBufferLike>,
        ): Promise<VfsOutcome>;
    }

    Implemented by

    Index
    prefix: string

    The path prefix this provider matches (e.g. '/net/pacs', '/bin'); empty for a fallback.

    • Copies files or folders from/to paths under this provider.

      Parameters

      • src: string

        The absolute source path.

      • dest: string

        The absolute destination path.

      • options: CpOptions

        Copy flags like recursive.

      Returns Promise<VfsOutcome>

      Done, or why not.

    • Resolves the target of a provider-defined lazy link when an operation actually follows it.

      Listings must not use this hook: providers may expose an unresolved link as structural metadata without paying for its target until navigation.

      Parameters

      • path: string

        Absolute virtual path naming the link.

      Returns Promise<Result<string>>

      The target path, or an error when the provider cannot resolve it.

    • Lists the contents of a directory matching this provider.

      Parameters

      • path: string

        The absolute virtual directory path.

      • Optionaloptions: { reverse?: boolean; sort?: "name" | "size" | "date" | "owner" }

        Optional sorting controls.

      Returns Promise<Result<VFSItem[]>>

      A Promise resolving to a Result containing VFSItems.

    • Makes one folder; its parent must exist. Absent, the mount makes none.

      Parameters

      • path: string

        The absolute path of the new folder.

      Returns Promise<VfsOutcome>

      Done, or why not (EEXIST, ENOENT for a missing parent, ...).

    • Makes a folder and any missing parents in one step, for a mount whose store can (mkdir -p). Absent, mkdir -p makes each missing parent in turn.

      Parameters

      • path: string

        The absolute path of the folder.

      Returns Promise<VfsOutcome>

      Done, or why not (EEXIST when something is already there).

    • Reads a file whole, as text.

      Parameters

      • path: string

        The absolute path of the file.

      Returns Promise<VfsOutcome<string>>

      Its content, or why not (ENOENT, EISDIR, ...).

    • Reads a file whole, as bytes.

      Parameters

      • path: string

        The absolute path of the file.

      Returns Promise<VfsOutcome<Buffer<ArrayBufferLike>>>

      Its bytes, or why not.

    • Renames an entry within this mount (mv).

      Parameters

      • src: string

        The absolute path now.

      • dest: string

        The absolute path it takes.

      Returns Promise<VfsOutcome>

      Done, or why not (ENOENT, EEXIST where the mount cannot replace, ...).

    • Removes a file or a link (rm); a folder is refused with EISDIR.

      Parameters

      • path: string

        The absolute path of the entry.

      Returns Promise<VfsOutcome>

      Done, or why not.

    • Removes an empty folder (rmdir).

      Parameters

      • path: string

        The absolute path of the folder.

      Returns Promise<VfsOutcome>

      Done, or why not (ENOENT, ENOTDIR, ENOTEMPTY, ...).

    • Removes a folder and everything under it in one step, for a mount whose store can (rm -r). Absent, rm -r removes what it holds one entry at a time.

      Parameters

      • path: string

        The absolute path of the folder.

      Returns Promise<VfsOutcome>

      Done, or why not.

    • Answers everything beneath a path at once, from what the mount already holds, so a walk (find) need not list it folder by folder. Null when the mount holds nothing it can answer from.

      Parameters

      • path: string

        The subtree's root.

      Returns Promise<VFSSubtree | null>

      The entries in walk order and what is left to walk, or null.

    • Writes a file whole: its content after the write is exactly what was given, whether or not it existed before. Absent, the mount holds no writable files.

      Parameters

      • path: string

        The absolute path of the file.

      • content: string | Buffer<ArrayBufferLike>

        The new content, whole.

      Returns Promise<VfsOutcome>

      Done, or why not (ENOENT for a missing folder, EISDIR, ...).