diskfiles.svelte.ts view source
inheritance
Cell<typeof DiskfilesJson>
items
type IndexedCollection<Diskfile>
selected_file_id
type Uuid | null
selected_file
type Diskfile | null
editor
The editor for managing diskfiles editing state.
type DiskfilesEditor
constructor
type new (options: DiskfilesOptions): Diskfiles
options
handle_change
type (params: { change: { type: "add" | "change" | "delete"; path: string & $brand<"DiskfilePath">; }; disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<...> & $brand<...>; ... 4 more ...; dependencies: [...][]; }; }): void
params
{ change: { type: "add" | "change" | "delete"; path: string & $brand<"DiskfilePath">; }; disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<...>; ... 4 more ...; dependencies: [...][]; }; }voidadd
type (json: { source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | null | undefined; content?: string | null | undefined; dependents?: [...][] | ... 1 more ... | undefined; dependencies?: [...][] | ... 1 more ... | undefined; }, auto_select?: boolean): Diskfile
json
{ source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | null | undefined; content?: string | null | undefined; dependents?: [...][] | ... 1 more ... | undefined; dependencies?: [...][] | ... 1 more ... | undefined; }auto_select
booleantrueupdate
type (path: string & $brand<"DiskfilePath">, content: string): Promise<void>
path
string & $brand<"DiskfilePath">content
stringPromise<void>delete
type (path: string & $brand<"DiskfilePath">): Promise<void>
path
string & $brand<"DiskfilePath">Promise<void>create_file
type (filename: string, content?: string): Promise<void>
filename
stringcontent
string''Promise<void>create_directory
type (dirname: string): Promise<void>
dirname
stringPromise<void>get_by_path
type (path: string & $brand<"DiskfilePath">): Diskfile | undefined
path
string & $brand<"DiskfilePath">Diskfile | undefinedto_relative_path
The value undefined means uninitialized, null means loading, '' means none
type (path: string): string | null | undefined
path
stringstring | null | undefinedselect
Select a diskfile by id and also update the editor tabs.
Default to the first file if id is undefined.
If id is null, it selects no file.
If open_not_preview is true, opens as a permanent tab, otherwise previews.
type (id: (string & $brand<"Uuid">) | null | undefined, open_not_preview?: boolean): void
id
(string & $brand<"Uuid">) | null | undefinedopen_not_preview
booleanfalsevoidselect_next
type (): void
void