import { Attachment, User } from './comment.types'; import { ToolType } from './annotation.types'; /** The kind of media being annotated. */ export type MediaType = 'image' | 'video'; /** Media source configuration. */ export interface MediaConfig { type: MediaType; /** URL of the image or video. */ src: string; /** Optional poster image for video. */ poster?: string; /** Frames-per-second hint for video frame-stepping (defaults to 30). */ fps?: number; /** Intrinsic width hint (px) — used before media loads if known. */ width?: number; /** Intrinsic height hint (px). */ height?: number; /** * CORS mode for the media element. Set to `'anonymous'` to allow the colour * eyedropper to read pixels from cross-origin media (the host must send * `Access-Control-Allow-Origin`); otherwise the sampling canvas is tainted. */ crossOrigin?: 'anonymous' | 'use-credentials'; } /** Which tools are available in the toolbar. */ export interface ToolsConfig { /** Allowed tools; omit to enable all. */ enabled?: ToolType[]; /** Tool selected on load. Defaults to `'select'`. */ defaultTool?: ToolType; /** Hide the measure-tools flyout (distance / font / eyedropper). */ hideMeasure?: boolean; /** Preset colors offered by the color picker. */ colors?: string[]; /** Stroke widths offered (px). */ strokeWidths?: number[]; /** * Initial drawing colour. Pass any CSS colour (e.g. `'#b8860b'`), or the * sentinel `'theme'` to adopt the resolved `--sfx-an-primary` token so the * default matches the active theme. The end user can still change it via the * colour picker. */ defaultColor?: string; } /** Top-level configuration for ``. */ export interface AnnotatorConfig { media: MediaConfig; /** Current user (author of new comments). */ currentUser?: User; /** * Grants the current user comment-moderation rights: resolving and deleting * **any** comment (not just their own), matching an Owner/Administrator role. * The widget does not know app roles — the host determines the role and sets * this to `true` for privileged users. Defaults to `false`, in which case a * user may edit/resolve only their own comments and cannot delete comments. */ canManageAllComments?: boolean; /** Tool / toolbar configuration. */ tools?: ToolsConfig; /** * Provider for @mention autocomplete data. Called with the current query (the * text after `@`, which may contain spaces once the menu is open, e.g. * `Sara L`); returns matching users. The menu closes when nothing matches. * Entries with `members` are groups (see `User.members`). Called with `''` * for the full roster used to resolve mentions. Consumer-supplied. */ getUsers?: (query: string) => User[] | Promise; /** * Max number of users listed in the @mention menu — the first N results of * `getUsers` are shown (the menu scrolls). Defaults to 100. */ mentionLimit?: number; /** Whether the comments panel is shown. Defaults to true. */ showComments?: boolean; /** Whether the toolbar is shown. Defaults to true. */ showToolbar?: boolean; /** * Whether the widget's built-in tooltips are shown. Defaults to true. Set to * `false` when the host provides its own tooltip styling/system (e.g. Hub). * Appearance can otherwise be themed via the `--sfx-an-tooltip-*` CSS vars. */ showTooltips?: boolean; /** Locale (BCP-47) for i18n. Defaults to 'en'. */ locale?: string; /** * Host-supplied string overrides for the given `locale`. Accepts (and may * mix) two key styles: * - **Native dot-keys** for full coverage of every rendered string * (e.g. `{ 'action.comment': 'Send' }`) — see `NATIVE_KEYS` for the list. * - **Legacy flat keys** from the old `react-filerobot-media-annotator` * (e.g. `{ annotatingFieldHint: '…' }`), remapped for back-compat. * Unknown legacy keys are ignored. */ translations?: Record; /** Whether the media is read-only (view comments, no drawing). */ readOnly?: boolean; /** * Upload handler for comment attachments. Receives the picked files and * returns the resulting attachment descriptors (sync or async). */ onAttach?: (files: File[]) => Attachment[] | Promise; } //# sourceMappingURL=config.types.d.ts.map