UNPKG

@assistant-ui/react

Version:

React components for AI chat.

51 lines 2.32 kB
import { ThreadListMetadata, ThreadListRuntimeCore } from "../runtimes/core/ThreadListRuntimeCore"; import { Unsubscribe } from "../types"; import { ThreadListRuntimePath } from "./RuntimePathTypes"; import { ThreadListItemRuntime, ThreadListItemRuntimeImpl } from "./ThreadListItemRuntime"; export type ThreadListState = Readonly<{ threads: readonly ThreadListMetadata[]; archivedThreads: readonly ThreadListMetadata[]; }>; export type ThreadListRuntime = Readonly<{ path: ThreadListRuntimePath; getState(): ThreadListState; /** * @deprecated Use `getThreadListItemById(idx).rename(newTitle)` instead. This will be removed in 0.6.0. */ rename(threadId: string, newTitle: string): Promise<void>; /** * @deprecated Use `getThreadListItemById(idx).archive()` instead. This will be removed in 0.6.0. */ archive(threadId: string): Promise<void>; /** * @deprecated Use `getThreadListItemById(idx).unarchive()` instead. This will be removed in 0.6.0. */ unarchive(threadId: string): Promise<void>; /** * @deprecated Use `getThreadListItemById(idx).delete()` instead. This will be removed in 0.6.0. */ delete(threadId: string): Promise<void>; subscribe(callback: () => void): Unsubscribe; getThreadListItemById(threadId: string): ThreadListItemRuntime; getThreadListItemByIndex(idx: number): ThreadListItemRuntime; getThreadListArchivedItemByIndex(idx: number): ThreadListItemRuntime; }>; export type ThreadListRuntimeCoreBinding = ThreadListRuntimeCore; export declare class ThreadListRuntimeImpl implements ThreadListRuntime { private _core; get path(): { ref: string; }; private _getState; constructor(_core: ThreadListRuntimeCoreBinding); getState(): ThreadListState; rename(threadId: string, newTitle: string): Promise<void>; archive(threadId: string): Promise<void>; unarchive(threadId: string): Promise<void>; delete(threadId: string): Promise<void>; subscribe(callback: () => void): Unsubscribe; getThreadListItemByIndex(idx: number): ThreadListItemRuntimeImpl; getThreadListArchivedItemByIndex(idx: number): ThreadListItemRuntimeImpl; getThreadListItemById(threadId: string): ThreadListItemRuntimeImpl; } //# sourceMappingURL=ThreadListRuntime.d.ts.map