Theia API Documentation v1.65.0
    Preparing search index...

    Interface FileSystemProviderWithOpenReadWriteCloseCapability

    Subtype of FileSystemProvider that ensures that the optional functions, needed for providers that should be able to open,read, write or close files, are implemented.

    interface FileSystemProviderWithOpenReadWriteCloseCapability {
        capabilities: FileSystemProviderCapabilities;
        onDidChangeCapabilities: Event<void>;
        onDidChangeFile: Event<readonly FileChange[]>;
        onFileWatchError: Event<void>;
        access?(resource: URI, mode?: number): Promise<void>;
        close(fd: number): Promise<void>;
        copy?(from: URI, to: URI, opts: FileOverwriteOptions): Promise<void>;
        delete(resource: URI, opts: FileDeleteOptions): Promise<void>;
        fsPath?(resource: URI): Promise<string>;
        mkdir(resource: URI): Promise<void>;
        open(resource: URI, opts: FileOpenOptions): Promise<number>;
        read(
            fd: number,
            pos: number,
            data: Uint8Array,
            offset: number,
            length: number,
        ): Promise<number>;
        readdir(resource: URI): Promise<[string, FileType][]>;
        readFile?(resource: URI): Promise<Uint8Array>;
        readFileStream?(
            resource: URI,
            opts: FileReadStreamOptions,
            token: CancellationToken,
        ): ReadableStreamEvents<Uint8Array>;
        rename(from: URI, to: URI, opts: FileOverwriteOptions): Promise<void>;
        stat(resource: URI): Promise<Stat>;
        updateFile?(
            resource: URI,
            changes: TextDocumentContentChangeEvent[],
            opts: FileUpdateOptions,
        ): Promise<FileUpdateResult>;
        watch(resource: URI, opts: WatchOptions): Disposable;
        write(
            fd: number,
            pos: number,
            data: Uint8Array,
            offset: number,
            length: number,
        ): Promise<number>;
        writeFile?(
            resource: URI,
            content: Uint8Array,
            opts: FileWriteOptions,
        ): Promise<void>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    The FileSystemProviderCapabilities for this provider.

    onDidChangeCapabilities: Event<void>
    • Event that is fired if the capabilities of this provider have changed.
    onDidChangeFile: Event<readonly FileChange[]>

    Event that is fired if a (watched) file in the filesystem of this provider has changed.

    onFileWatchError: Event<void>

    Event that is fired if an error occurred when watching files in the filesystem of this provider.

    Methods

    • Read specified content from a given file descriptor into a data buffer.

      Parameters

      • fd: number

        The file descriptor referencing the file to read from.

      • pos: number

        The offset from the beginning of the file from which data should be read.

      • data: Uint8Array

        The buffer that the data will be written to.

      • offset: number

        The offset in the buffer at which to start writing.

      • length: number

        The number of bytes to read.

      Returns Promise<number>

      A promise of the number of bytes read.

    • Write specified content from the data buffer to the file referenced by the given file descriptor.

      Parameters

      • fd: number

        The file descriptor referencing the file to write to.

      • pos: number

        The offset from the beginning of the file where this data should be written.

      • data: Uint8Array
      • offset: number

        The part of the buffer to be read from.

      • length: number

        The number of bytes to write.

      Returns Promise<number>

      A promise of the number of bytes written.