import { PropsWithChildren } from 'react'; import { CommentData, ThreadData } from '@liveblocks/client'; import { ID } from '@zeniai/client-epic-state'; import { CollaborationEntityType, ThreadMetadata } from './CollaborationTypes'; export declare const NEW_THREAD_SUFFIX = "_new_thread_"; export interface RequestToOpenThreadType { companyId: ID; entityType: CollaborationEntityType; threadId: ID; /** * Directs the request at one surface when several could consume it (e.g. * an EA row thread routed to the transaction detail panel while the list * row stays mounted underneath). */ consumerHint?: "transaction_detail"; /** Epoch ms when the request was created; consumers may expire stale requests. */ requestedAt?: number; threadMetadata?: ThreadMetadata; onThreadShownCallback?: () => void; } export declare const ThreadsContext: import('react').Context; export interface ThreadsContextType { isLoading: boolean; openThread: ID | null; requestToOpenThread: RequestToOpenThreadType | null; threads: ReadonlyMap>; addThread: (threadId: ID, thread: ThreadData) => void; removeComment: (comment: CommentData) => void; removeThread: (threadId: ID) => void; setOpenThread: (arg: ID | null) => void; setRequestToOpenThread: (data: RequestToOpenThreadType | null) => void; } /** * - `userThreads`: `useUserThreads_experimental` (cross-room user index). Required when there is no `RoomProvider` (e.g. cockpit). * - `roomThreads`: `useThreads` for the current room only. Used on the customer dashboard where we connect to `dashboard_${companyId}`. */ export type ThreadsIndexStrategy = "userThreads" | "roomThreads"; export declare const ThreadsProvider: ({ children, filter, threadsIndexStrategy, }: PropsWithChildren<{ filter: Partial; threadsIndexStrategy?: ThreadsIndexStrategy; }>) => import("react/jsx-runtime").JSX.Element; /** * Hooks */ export declare const useActiveThreadsContext: () => ThreadsContextType; export declare const useFilteredThreads: (filter: Partial, resolved?: boolean | "both", excludeNewThreads?: boolean) => { isLoading: boolean; threads: ThreadData[]; }; export declare const getFilteredThreads: (threads: ReadonlyMap>, filter: Partial, resolved?: boolean | "both", excludeNewThreads?: boolean) => ReadonlyMap>; export declare const sortThreads: (threads: ThreadData[]) => ThreadData[];