Skip to content

Commit bcd2f05

Browse files
authored
Merge pull request #9 from rssaini01/main
Fix type mismatch in mountPlugin
2 parents 52ce83a + fac4cbc commit bcd2f05

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/mountPlugin.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import type { SvelteComponent } from 'svelte';
2-
import { ShapeType, type ImageAnnotator } from '@annotorious/annotorious';
2+
import { ShapeType, type ImageAnnotator, type ImageAnnotation, type Annotation } from '@annotorious/annotorious';
33
import type { OpenSeadragonAnnotator } from '@annotorious/openseadragon';
44
import { EllipseEditor, RubberbandEllipse } from './ellipse';
55
import { LineEditor, RubberbandLine } from './line';
66
import { RubberbandPath, PathEditor } from './path';
77

8-
export const mountPlugin = (
9-
anno: ImageAnnotator | OpenSeadragonAnnotator
8+
export const mountPlugin = <
9+
I extends Annotation = ImageAnnotation,
10+
E extends unknown = ImageAnnotation,
11+
>(
12+
anno: ImageAnnotator<I, E> | OpenSeadragonAnnotator<I, E>
1013
) => {
1114
anno.registerDrawingTool('ellipse', RubberbandEllipse as typeof SvelteComponent);
1215
anno.registerShapeEditor(ShapeType.ELLIPSE, EllipseEditor as typeof SvelteComponent);

0 commit comments

Comments
 (0)