files#
Interfaces#
FileServer#
Defined in: files.ts:34
The file calls of a Server.
Extended by#
Methods#
listFolder()#
listFolder(
path):Promise<FolderListing>
Defined in: files.ts:42
The folder path lists: its folders, then its workspace, manifest and
table files, hidden names and links leading out of the root left out.
Rejects with a ServerError whose refusal is the server’s (no such folder, path outside the root, hidden files are not served,
permission denied).
Parameters#
path#
string
Returns#
Promise<FolderListing>
readFile()#
readFile(
path):Promise<Blob>
Defined in: files.ts:47
The bytes of the workspace, manifest or table file path. Rejects as
listFolder does, for no such file, and for a file of another kind.
Parameters#
path#
string
Returns#
Promise<Blob>
writeFile()#
writeFile(
path,content):Promise<WrittenFile>
Defined in: files.ts:53
Write content into the workspace file path, replacing it whole: a
string as its UTF-8 bytes, a Blob unchanged. Rejects as listFolder
does, and for a file that is no workspace file.
Parameters#
path#
string
content#
string | Blob
Returns#
Promise<WrittenFile>
FolderEntry#
Defined in: files.ts:16
One entry of a folder: a folder, or a file of a kind the editor opens.
Properties#
kind#
readonlykind:"folder"|"file"
Defined in: files.ts:18
name#
readonlyname:string
Defined in: files.ts:17
FolderListing#
Defined in: files.ts:22
A folder’s entries, folders first, then files, each group sorted by code point.
Properties#
entries#
readonlyentries: readonlyFolderEntry[]
Defined in: files.ts:24
path#
readonlypath:string
Defined in: files.ts:23
Transport#
Defined in: files.ts:57
What the file calls take of connect.
Properties#
headers#
readonlyheaders:Readonly<Record<string,string>>
Defined in: files.ts:59
The headers every request carries (the bearer token).
Methods#
malformed()#
malformed(
status,message,cause?):Error
Defined in: files.ts:63
The error for a 2xx answer of status that is not of its route’s form.
Parameters#
status#
number
message#
string
cause?#
unknown
Returns#
Error
request()#
request(
route,init,explained):Promise<Response>
Defined in: files.ts:61
The 2xx answer to the request of route below the server’s base URL; rejects otherwise.
Parameters#
route#
string
init#
RequestInit
explained#
boolean
Returns#
Promise<Response>
WrittenFile#
Defined in: files.ts:28
A file written: its path and its size in bytes.
Properties#
path#
readonlypath:string
Defined in: files.ts:29
size#
readonlysize:number
Defined in: files.ts:30
Functions#
fileCalls()#
fileCalls(
__namedParameters):FileServer
Defined in: files.ts:116
The three file calls over connect’s transport.