import type { Detection, DetectionFrame } from "#types/detections"; export type DetectionId = string | number; export type EditableDetection = DeepMutable; export declare enum AnnotationFrameMutationKind { Add = "add", Remove = "remove", Replace = "replace", Transact = "transact", Update = "update" } export interface AnnotationFrameMutation { readonly kind: AnnotationFrameMutationKind; readonly detectionIds: readonly DetectionId[]; readonly previous: DetectionFrame; readonly current: DetectionFrame; } export type AnnotationFrameMutationListener = (mutation: AnnotationFrameMutation) => void; export interface EditableAnnotationFrameSession { getSnapshot(): DetectionFrame; add(detection: Detection, index?: number): DetectionFrame; update(id: DetectionId, update: Partial | ((current: Detection) => Detection)): DetectionFrame; remove(id: DetectionId): DetectionFrame; replace(frame: DetectionFrame): DetectionFrame; transact(mutate: (detections: EditableDetection[]) => void, detectionIds?: readonly DetectionId[]): DetectionFrame; subscribe(listener: AnnotationFrameMutationListener): () => void; destroy(): void; } export declare function createEditableAnnotationFrameSession(initialFrame: DetectionFrame): EditableAnnotationFrameSession; type DeepMutable = T extends (...args: never[]) => unknown ? T : T extends readonly [unknown, ...unknown[]] ? { -readonly [TKey in keyof T]: DeepMutable; } : T extends readonly (infer TValue)[] ? DeepMutable[] : T extends object ? { -readonly [TKey in keyof T]: DeepMutable; } : T; export {}; //# sourceMappingURL=editable-annotation-frame-session.d.ts.map