diskfiles.svelte.ts

Declarations
#

4 declarations

view source

Diskfiles
#

diskfiles.svelte.ts view source

inheritance

extends:
  • Cell<typeof DiskfilesJson>

items

type IndexedCollection<Diskfile>

readonly

selected_file_id

type Uuid | null

selected_file

type Diskfile | null

readonly

editor

The editor for managing diskfiles editing state.

type DiskfilesEditor

readonly

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
type { change: { type: "add" | "change" | "delete"; path: string & $brand<"DiskfilePath">; }; disknode: { id: string & $brand<"DiskfilePath">; source_dir: string & $brand<"DiskfilePath"> & $brand<...>; ... 4 more ...; dependencies: [...][]; }; }
returns void

add

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
type { 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
type boolean
default true
returns Diskfile

update

type (path: string & $brand<"DiskfilePath">, content: string): Promise<void>

path
type string & $brand<"DiskfilePath">
content
type string
returns Promise<void>

delete

type (path: string & $brand<"DiskfilePath">): Promise<void>

path
type string & $brand<"DiskfilePath">
returns Promise<void>

create_file

type (filename: string, content?: string): Promise<void>

filename
type string
content
type string
default ''
returns Promise<void>

create_directory

type (dirname: string): Promise<void>

dirname
type string
returns Promise<void>

get_by_path

type (path: string & $brand<"DiskfilePath">): Diskfile | undefined

path
type string & $brand<"DiskfilePath">
returns Diskfile | undefined

to_relative_path

The value undefined means uninitialized, null means loading, '' means none

type (path: string): string | null | undefined

path
type string
returns string | null | undefined

select

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
type (string & $brand<"Uuid">) | null | undefined
open_not_preview
type boolean
default false
returns void

select_next

type (): void

returns void

DiskfilesJson
#

diskfiles.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; updated: ZodDefault<...>; diskfiles: ZodDefault<...>; selected_file_id: ZodDefault<...>; }, $strict>

DiskfilesJsonInput
#

diskfiles.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; diskfiles?: { source_dir: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; path?: string | ... 1 more ... | undefined; content?: string | ... 1 more ... | undefined; dependents?: [...][]...

DiskfilesOptions
#

Depends on
#

Imported by
#