terminal_presets.svelte.ts

view source

Declarations
#

5 declarations

TERMINAL_PRESETS_DEFAULT
#

terminal_presets.svelte.ts view source

readonly { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; command?: string | undefined; args?: string[] | undefined; cwd?: string | undefined; }[]

type readonly TerminalPresetJsonInput[]

import {TERMINAL_PRESETS_DEFAULT} from '@fuzdev/zzz/terminal_presets.svelte.js';

The presets a TerminalPresets starts with when constructed without items.

TerminalPresets
#

terminal_presets.svelte.ts view source

import {TerminalPresets} from '@fuzdev/zzz/terminal_presets.svelte.js';

App-level collection of saved terminal commands. Seeded once with TERMINAL_PRESETS_DEFAULT unless constructed with items.

TODO persist user-created presets — they last only as long as the page

inheritance

extends: Cell<typeof TerminalPresetsJson>

items

type IndexedCollection<TerminalPreset>

readonly

constructor

type new (options: TerminalPresetsOptions): TerminalPresets

options

add

type (json?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; command?: string | undefined; args?: string[] | undefined; cwd?: string | undefined; } | undefined): TerminalPreset

json?

optional

remove

Removes and disposes a preset.

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

id

type Uuid
returns boolean

whether the preset was found

clear

Removes and disposes every preset.

type (): void

returns void

dispose

type (): void

returns void

TerminalPresetsJson
#

terminal_presets.svelte.ts view source

value + type

{ id: string & $brand<"Uuid">; created: string & $brand<"Datetime">; updated: string & $brand<"Datetime">; items: { id: string & $brand<"Uuid">; ... 5 more ...; cwd?: string | undefined; }[]; } import {TerminalPresetsJson} from '@fuzdev/zzz/terminal_presets.svelte.js';

id

type string & $brand<"Uuid">

created

type string & $brand<"Datetime">

updated

Required and initially equal to created.

type string & $brand<"Datetime">

items

type TerminalPresetJson[]

TerminalPresetsJsonInput
#

terminal_presets.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; command?: string | undefined; args?: string[] | undefined; cwd?: string | undefined; }[] | undefined; } import type {TerminalPresetsJsonInput} from '@fuzdev/zzz/terminal_presets.svelte.js';

id?

type string

created?

type string

updated?

Required and initially equal to created.

type string

items?

type TerminalPresetJsonInput[]

TerminalPresetsOptions
#

terminal_presets.svelte.ts view source

TerminalPresetsOptions import type {TerminalPresetsOptions} from '@fuzdev/zzz/terminal_presets.svelte.js';

inheritance

extends: CellOptions<typeof TerminalPresetsJson>

Depends on
#

Imported by
#