VirtualFileSystem
type VirtualFileSystem =
{
DirectoryExists: (string -> bool voption) voption
FileExists: (string -> bool voption) voption
GetAccessibleEntries: (string -> FileSystemEntries voption) voption
ReadFile: (string -> FileRead) voption
Realpath: (string -> string voption) voption
WriteFile: (string -> string -> unit) voption
}| Assembly | Xantham.TypeScript.Wire |
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.
Replies follow dist/api/fsCallbacks.js. Invalid reply shapes terminate the server.
ValueNone delegates to the server filesystem through a useOS reply. ReadFile distinguishes missing files from delegation through FileRead.
Fields
DirectoryExists: (string -> bool voption) voptionFileExists: (string -> bool voption) voptionGetAccessibleEntries: (string -> FileSystemEntries voption) voptionReadFile: (string -> FileRead) voptionWriteFile: (string -> string -> unit) voption
WriteFile: (string -> string -> unit) voptionTakes the path and content to write; successful return acknowledges completion.
Functions and values
callbacks (fs: VirtualFileSystem) : IDictionary<string,TsGoCallback>
callbacks (fs: VirtualFileSystem) : IDictionary<string,TsGoCallback>The callback table to hand to TscChannel or TscMailbox. Only the members that are set appear in it, and only those names reach --callbacks=.
Properties
static member Default: VirtualFileSystem
static member Default: VirtualFileSystemA filesystem that answers nothing, so every path falls back to the real one. Copy-update it with the members you mean to serve.