import { Location } from './location.model'; export interface IUnreadCommentsMap { [annotationId: string]: number; } export type UnreadCommentsMap = IUnreadCommentsMap | null; export interface IUnreadCommentsCount { count: number; } export type UnreadCommentsCount = IUnreadCommentsCount | null; /** * Config for `commentElement.enableIdScopedAnchoring(config)` and * `` (which also accepts `true` / `false`). * * Use it when several documents are set (`setDocuments`) and only some of them should use * id-scoped anchoring, e.g. comments made on another page that can only be matched by element id. */ export interface IdScopedAnchoringConfig { /** * Client document ids (the ids passed to `setDocuments`) whose comment pins use id-scoped * anchoring. Pins of every other document resolve as they do with the feature off. * * - Omitted: every document (same as calling `enableIdScopedAnchoring()` with no config). * - `[]`: no document. * * Calling `enableIdScopedAnchoring` again replaces the list. */ documentIds?: string[]; } export interface TransformContext { containerSelector: string; transforms: { scale: number; transformOrigin: string; inverseScale?: number; }; } /** * Context data returned by the comment context provider. * This is a flexible object that can contain custom properties. */ export interface CommentContext { /** * Optional comment type. When set to 'manual', the comment will be treated as a manual comment * and the target element will be removed. */ commentType?: 'manual' | string; /** * Allow additional custom properties */ [key: string]: unknown; } export type CommentContextProviderResponse = CommentContext | null | undefined; /** * A function that provides custom context for comments. * Can return the context synchronously or asynchronously via a Promise. * * @param documentId - The ID of the document * @param location - Optional location information * @returns The comment context object or a Promise that resolves to it */ export type CommentContextProvider = (documentId: string, location?: Location) => CommentContextProviderResponse | Promise;