workspaces.svelte.ts view source
Collection of open workspaces.
Manages the set of directories the daemon is watching and serving. Each workspace has a unique path used as the index key.
inheritance
Cell<typeof WorkspacesJson>
items
type IndexedCollection<Workspace>
active_id
type Uuid | null
active
type Workspace | undefined
constructor
type new (options: WorkspacesOptions): Workspaces
options
add
Add a workspace. If a workspace with the same path already exists, returns it.
type (json: { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }): Workspace
json
{ path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }remove
type (id: string & $brand<"Uuid">): void
id
string & $brand<"Uuid">voidget_by_path
type (path: string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">): Workspace | undefined
path
string & $brand<"DiskfilePath"> & $brand<"DiskfileDirectoryPath">Workspace | undefinedactivate
type (id: string & $brand<"Uuid">): void
id
string & $brand<"Uuid">void