import type { DialogItem } from '../types/component.types'; import type { FetchDialogsParams, FetchDialogsResult } from '../types/unified-chat-state.types'; export interface UseManagedDialogListArgs { /** Gates the AUTOMATIC first-page load only (every other operation is * caller-driven). The adapters pass their own `active` gate so an idle * transport does no network. */ autoLoad: boolean; /** Pages the active dialog list. Absent = the hook is inert. */ fetchDialogs?: (params: FetchDialogsParams) => Promise; /** Backend rename — absent = `renameDialog` is a no-op. */ renameDialog?: (id: string, title: string) => Promise; /** Backend archive — absent = `archiveDialog` is a no-op. */ archiveDialog?: (id: string) => Promise; /** Backend delete — absent = `deleteDialog` is a no-op. */ deleteDialog?: (id: string) => Promise; /** Page size sent as `limit`. */ pageSize: number; /** Server-side search term. `undefined` = no search support (the NATS * adapter never sets it, so its wire params stay `{cursor, limit}`); any * string change — including back to `''` — reloads page 1 with `search`. */ search?: string; /** Fires AFTER a row was removed locally by a successful archive/delete. * Read through a latest-ref so its identity never enters the mutation * callbacks' deps. */ onDialogRemoved?: (id: string, reason: 'archived' | 'deleted') => void; /** Console prefix for failure logs (`[useNatsChatAdapter]`, `[useSseChatAdapter]`). */ logTag: string; } export interface UseManagedDialogListResult { dialogs: DialogItem[]; dialogsNextCursor: string | null; /** Skeleton flag — true while a page request is in flight. */ isDialogsLoading: boolean; /** True when the FIRST page failed — a pagination failure keeps the loaded rows. */ dialogsError: boolean; hasMoreDialogs: boolean; /** Load a page: `undefined` cursor = (re)load the first page. */ loadDialogsPage: (cursor?: string) => Promise; /** Retry / refresh the first page. */ reloadDialogs: () => void; loadMoreDialogs: () => Promise; renameDialog: (id: string, title: string) => Promise; archiveDialog: (id: string) => Promise; deleteDialog: (id: string) => Promise; /** Prepend a row (dedupes by id) — a freshly created conversation. */ upsertDialogTop: (item: DialogItem) => void; /** Move an existing row to the head of the list with a fresh `timestamp` — * what a new turn does server-side (`last_message_at desc`). No-op for an * id the list doesn't hold. */ bumpDialogToTop: (id: string) => void; } export declare function useManagedDialogList({ autoLoad, fetchDialogs, renameDialog: renameDialogCallback, archiveDialog: archiveDialogCallback, deleteDialog: deleteDialogCallback, pageSize, search, onDialogRemoved, logTag, }: UseManagedDialogListArgs): UseManagedDialogListResult; //# sourceMappingURL=use-managed-dialog-list.d.ts.map