Filesystem operations exposed over the Websocket.

list runs through the correlated fs:request protocol (see WispSocket.request); search uses the dedicated filesearch start/ filesearch results events.

Remarks

The new backend also serves plain file read/write/delete/rename over fs:request, but those op shapes haven't been captured yet. Until typed wrappers exist here, they're reachable via WispSocket.request, and the existing HTTP Filesystem API covers them too.

Constructors

Properties

Methods

Constructors

Properties

socket: WispSocket

Methods

  • Checks which of the given paths already exist / would conflict.

    Parameters

    • paths: string[]

      The paths to check

    • timeout: number = 10000

      In milliseconds, how long to wait before timing out

    Returns Promise<ConflictsResult>

  • Creates a directory named name under root.

    Parameters

    • root: string

      The parent directory the new directory is created in

    • name: string

      The name of the new directory

    • timeout: number = 10000

      In milliseconds, how long to wait before timing out

    Returns Promise<FsOkResult>

  • Lists the contents of a directory (paginated).

    Parameters

    • dir: string

      The directory to list

    • opts: ListOptions = {}

      Search, pagination, and sort options

    • timeout: number = 10000

      In milliseconds, how long to wait before timing out

    Returns Promise<ListResult>

  • Searches file contents under a root directory for the given query.

    Parameters

    • query: string

      The query string to search for

    • root: string = "/garrysmod"

      The directory to search under

    • timeout: number = 10000

      How long to wait (in ms) for results before timing out

    Returns Promise<FilesearchResults>

Generated using TypeDoc