Logo Xantham

VirtualFileSystem Type

The virtual filesystem the server delegates to when the process is started with --callbacks=, mirroring dist/api/fs.d.ts. Every member is optional, and one left unset is not registered at all, so the server never asks about it.

This exists because the raw TsGoCallback surface is unforgiving: each callback has its own reply shape, the shapes appear nowhere in the schema, and a wrong one is not an error but a Go panic that kills the process mid-request. The encoding is applied here once, transcribed from dist/api/sync/client.js:35-56.

ValueNone from a member means "not answered" - the empty reply the server reads as "fall back to the real filesystem" - which is why ReadFile has its own three-way type rather than returning an option.

Record fields

Record Field Description

DirectoryExists

Full Usage: DirectoryExists

Field type: (string -> bool voption) voption
Field type: (string -> bool voption) voption

FileExists

Full Usage: FileExists

Field type: (string -> bool voption) voption
Field type: (string -> bool voption) voption

GetAccessibleEntries

Full Usage: GetAccessibleEntries

Field type: (string -> FileSystemEntries voption) voption
Field type: (string -> FileSystemEntries voption) voption

ReadFile

Full Usage: ReadFile

Field type: (string -> FileRead) voption
Field type: (string -> FileRead) voption

Realpath

Full Usage: Realpath

Field type: (string -> string voption) voption
Field type: (string -> string voption) voption

WriteFile

Full Usage: WriteFile

Field type: (string -> string -> unit) voption

Takes the path and then the content to write. The server expects no answer.

Field type: (string -> string -> unit) voption

Static members

Static member Description

VirtualFileSystem.Default

Full Usage: VirtualFileSystem.Default

Returns: VirtualFileSystem

A filesystem that answers nothing, so every path falls back to the real one. Copy-update it with the members you mean to serve.

Returns: VirtualFileSystem

Type something to start searching.