workspaces.svelte.ts

Declarations
#

4 declarations

view source

Workspaces
#

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

extends:
  • Cell<typeof WorkspacesJson>

items

type IndexedCollection<Workspace>

readonly

active_id

type Uuid | null

active

type Workspace | undefined

readonly

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
type { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }
returns Workspace

remove

type (id: string & $brand<"Uuid">): void

id
type string & $brand<"Uuid">
returns void

get_by_path

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

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

activate

type (id: string & $brand<"Uuid">): void

id
type string & $brand<"Uuid">
returns void

WorkspacesJson
#

workspaces.svelte.ts view source

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

WorkspacesJsonInput
#

workspaces.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { path: string; id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; opened_at?: string | undefined; }[] | undefined; active_id?: string | ... 1 more ... | undefin...

WorkspacesOptions
#

Depends on
#

Imported by
#