|
1 | 1 | import "./viewer-element"; |
2 | | -import type { DivaEventMap, DivaLayoutMode, DivaOptions, DivaPage, DivaPageSelector, DivaRegion, DivaState, ZoomToRegionOptions } from "./public-api"; |
3 | | -export type { DivaEventMap, DivaImage, DivaLayoutMode, DivaOptions, DivaPage, DivaPageSelector, DivaPageTarget, DivaRegion, DivaSidebarPanel, DivaStaticImageCorsPolicy, DivaState, DivaViewingDirection, ZoomToRegionOptions } from "./public-api"; |
| 2 | +import type { DivaEventMap, DivaAnnotation, DivaLayoutMode, DivaOptions, DivaPage, DivaPageSelector, DivaRegion, DivaState, ZoomToRegionOptions } from "./public-api"; |
| 3 | +export type { DivaEventMap, DivaAnnotation, DivaImage, DivaLayoutMode, DivaOptions, DivaPage, DivaPageSelector, DivaPageTarget, DivaRegion, DivaSidebarPanel, DivaStaticImageCorsPolicy, DivaState, DivaViewingDirection, ZoomToRegionOptions } from "./public-api"; |
4 | 4 | /** |
5 | 5 | * A browser viewer for IIIF Presentation manifests and collections. |
6 | 6 | * |
@@ -64,6 +64,11 @@ export declare class Diva extends EventTarget { |
64 | 64 | private pages; |
65 | 65 | private readonly pagesByCanvasId; |
66 | 66 | private readonly pagesByLabel; |
| 67 | + private readonly manifestAnnotationsByCanvas; |
| 68 | + private readonly apiAnnotationsByCanvas; |
| 69 | + private readonly clearedAnnotationCanvases; |
| 70 | + private readonly annotationImageServicesByCanvas; |
| 71 | + private annotationResourceId; |
67 | 72 | private state; |
68 | 73 | private readyResolve; |
69 | 74 | private readyReject; |
@@ -110,6 +115,9 @@ export declare class Diva extends EventTarget { |
110 | 115 | private bindPorts; |
111 | 116 | private ensureMainViewer; |
112 | 117 | private copyPage; |
| 118 | + private effectiveAnnotationsForCanvas; |
| 119 | + private applyAnnotationsForCanvas; |
| 120 | + private findStoredAnnotation; |
113 | 121 | private rebuildPageIndexes; |
114 | 122 | private pageForSelector; |
115 | 123 | private copyState; |
@@ -160,6 +168,26 @@ export declare class Diva extends EventTarget { |
160 | 168 | * @returns Pages in zero-based display order. Auth tokens and resolved loading URLs are never included. |
161 | 169 | */ |
162 | 170 | getPages(): readonly DivaPage[]; |
| 171 | + /** Add or replace one API-supplied Web Annotation on a loaded Canvas. */ |
| 172 | + setAnnotation(annotation: DivaAnnotation): void; |
| 173 | + /** Replace the API-supplied annotation set for the loaded manifest. */ |
| 174 | + setAnnotations(annotations: readonly DivaAnnotation[]): void; |
| 175 | + /** Return defensive Web Annotation snapshots for one Canvas. */ |
| 176 | + getAnnotationsForCanvas(uri: string): readonly DivaAnnotation[]; |
| 177 | + /** Return defensive Web Annotation snapshots for the loaded manifest. */ |
| 178 | + getAllAnnotations(): readonly DivaAnnotation[]; |
| 179 | + /** Clear both manifest and API-supplied annotations for one Canvas. */ |
| 180 | + clearAnnotationsForCanvas(uri: string): void; |
| 181 | + /** Clear both manifest and API-supplied annotations for every Canvas. */ |
| 182 | + clearAllAnnotations(): void; |
| 183 | + /** |
| 184 | + * Return the IIIF Image API extract URL for an annotation, when available. |
| 185 | + * |
| 186 | + * @returns The extract URL, or `null` when the annotation is unknown or has no usable image region. |
| 187 | + */ |
| 188 | + getImageRegionForAnnotation(annotationId: string): string | null; |
| 189 | + /** Return an annotation body's textual or HTML value, if present. */ |
| 190 | + getAnnotationBody(annotationId: string): string | undefined; |
163 | 191 | /** |
164 | 192 | * Find a displayed page by Canvas identifier or localized display label. |
165 | 193 | * |
|
0 commit comments