chats.svelte.ts

Declarations
#

5 declarations

view source

Chats
#

chats.svelte.ts view source

inheritance

extends:
  • Cell<typeof ChatsJson>

items

type IndexedCollection<Chat>

readonly

selected_id_last_non_null

type Uuid | null

selected

type Chat | undefined

readonly

selected_id_error

type boolean

readonly

show_sort_controls

Controls visibility of sort controls in the chats list.

type boolean

ordered_items

Ordered array of chats derived from the manual_order index.

type Array<Chat>

readonly

items_by_name

readonly

constructor

type new (options: ChatsOptions): Chats

options

add

type (json?: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; } | undefined, select?: boolean | undefined): Chat

json?
type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; } | undefined
optional
select?
type boolean | undefined
optional
returns Chat

generate_unique_name

type (base_name?: string): string

base_name
type string
default 'new chat'
returns string

add_chat

type (chat: Chat, select?: boolean | undefined): Chat

chat
type Chat
select?
type boolean | undefined
optional
returns Chat

add_many

type (chats_json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; }[], select?: number | ... 1 more ... | undefined): Chat[]

chats_json
type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | undefined; selected_thread_id?: string | ... 1 more ... | undefined; }[]
select?
type number | boolean | undefined
optional
returns Chat[]

remove

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

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

remove_many

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

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

select

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

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

select_next

type (): Promise<void>

returns Promise<void>

navigate_to

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

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

reorder_chats

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

from_index
type number
to_index
type number
returns void

toggle_sort_controls

Toggles the visibility of sort controls in the chats list.

type (value?: boolean): void

value
type boolean
default !this.show_sort_controls
returns void

chat_templates

get_template_by_id

type (id: string): ChatTemplate | undefined

id
type string
returns ChatTemplate | undefined

get_default_template

type (): ChatTemplate

returns ChatTemplate

ChatsJson
#

chats.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime">>; ... 4 more ...; show_sort_controls: ZodDefault<...>; }, $strict>

ChatsJsonInput
#

chats.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; thread_ids?: string[] | undefined; main_input?: string | undefined; view_mode?: "simple" | ... 1 more ... | ...

ChatsOptions
#

ChatsSchema
#

Depends on
#

Imported by
#