prompts.svelte.ts

Declarations
#

5 declarations

view source

Prompts
#

prompts.svelte.ts view source

inheritance

extends:
  • Cell<typeof PromptsJson>

items

type IndexedCollection<Prompt>

readonly

selected_id_last_non_null

type Uuid | null

selected

type Prompt | undefined

readonly

show_sort_controls

Controls visibility of sort controls in the prompts list.

type boolean

ordered_items

Ordered array of prompts derived from the manual_order index.

type Array<Prompt>

readonly

constructor

type new (options: PromptsOptions): Prompts

options

filter_by_part

type (part: PartUnion): Prompt[]

part
returns Prompt[]

add

type (json?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; ... 11 more ...; content?: string | undefined; } | { ...; })[] | undefined; } | undefined): Prompt

json?
type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; ... 11 more ...; content?: string | undefined; } | { ...; })[] | undefined; } | undefined
optional
returns Prompt

generate_unique_name

type (base_name?: string): string

base_name
type string
default 'new prompt'
returns string

add_many

type (prompts_json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; ... 11 more ...; content?: string | undefined; } | { ...; })[] | undefined; }[]): Prompt[]

prompts_json
type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; parts?: ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ... 10 more ...; content?: string | undefined; } | { ...; })[] | undefined; }[]
returns Prompt[]

remove

type (prompt: Prompt): void

prompt
type Prompt
returns void

remove_many

type (prompt_ids: (string & $brand<"Uuid">)[]): number

prompt_ids
type (string & $brand<"Uuid">)[]
returns number

select

type (prompt_id: (string & $brand<"Uuid">) | null): Promise<void>

prompt_id
type (string & $brand<"Uuid">) | null
returns Promise<void>

select_next

type (): Promise<void>

returns Promise<void>

navigate_to

type (prompt_id: (string & $brand<"Uuid">) | null, force?: boolean): Promise<void>

prompt_id
type (string & $brand<"Uuid">) | null
force
type boolean
default false
returns Promise<void>

reorder_prompts

type (from_index: number, to_index: number): void

from_index
type number
to_index
type number
returns void

remove_part

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

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

toggle_sort_controls

Toggles the visibility of sort controls in the prompts list.

type (value?: boolean): void

value
type boolean
default !this.show_sort_controls
returns void

PromptsJson
#

prompts.svelte.ts view source

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

PromptsJsonInput
#

prompts.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; parts?: ({ ...; } | { ...; })[] | undefined; }[] | undefined; selected_id?: string | ... 1 more ... | undefi...

PromptsOptions
#

PromptsSchema
#

Depends on
#

Imported by
#