@annotorious/annotorious 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  import { SvelteComponent } from 'svelte';
2
- import { Annotator } from '@annotorious/core';
2
+ import { Annotation, Annotator } from '@annotorious/core';
3
3
  import { DrawingTool } from './annotation/tools';
4
4
  import { DrawingToolOpts } from './annotation';
5
5
  import { ImageAnnotation, ShapeType } from './model';
6
6
  import { Theme, AnnotoriousOpts } from './AnnotoriousOpts';
7
- export interface ImageAnnotator<E extends unknown = ImageAnnotation> extends Annotator<ImageAnnotation, E> {
7
+ export interface ImageAnnotator<I extends Annotation = ImageAnnotation, E extends unknown = ImageAnnotation> extends Annotator<I, E> {
8
8
  element: HTMLDivElement;
9
9
  listDrawingTools(): string[];
10
10
  registerDrawingTool(name: string, tool: typeof SvelteComponent, opts?: DrawingToolOpts): void;
@@ -13,4 +13,4 @@ export interface ImageAnnotator<E extends unknown = ImageAnnotation> extends Ann
13
13
  setDrawingEnabled(enabled: boolean): void;
14
14
  setTheme(theme: Theme): void;
15
15
  }
16
- export declare const createImageAnnotator: <E extends unknown = ImageAnnotation>(image: string | HTMLImageElement | HTMLCanvasElement, options?: AnnotoriousOpts<ImageAnnotation, E>) => ImageAnnotator<E>;
16
+ export declare const createImageAnnotator: <I extends Annotation = ImageAnnotation, E extends unknown = ImageAnnotation>(image: string | HTMLImageElement | HTMLCanvasElement, options?: AnnotoriousOpts<I, E>) => ImageAnnotator<I, E>;
@@ -11,4 +11,4 @@ export interface AnnotoriousOpts<I extends Annotation = ImageAnnotation, E exten
11
11
  }
12
12
  export type DrawingMode = 'click' | 'drag';
13
13
  export type Theme = 'dark' | 'light' | 'auto';
14
- export declare const fillDefaults: <I extends ImageAnnotation = ImageAnnotation, E extends unknown = ImageAnnotation>(opts: AnnotoriousOpts<I, E>, defaults: AnnotoriousOpts<I, E>) => AnnotoriousOpts<I, E>;
14
+ export declare const fillDefaults: <I extends Annotation = ImageAnnotation, E extends unknown = ImageAnnotation>(opts: AnnotoriousOpts<I, E>, defaults: AnnotoriousOpts<I, E>) => AnnotoriousOpts<I, E>;
@@ -1,10 +1,10 @@
1
1
  import { SvelteImageAnnotationStore } from '../state';
2
- import { ImageAnnotation } from '../model';
3
- export interface SVGAnnotationLayerPointerEvent {
2
+ import { Annotation } from '@annotorious/core';
3
+ export interface SVGAnnotationLayerPointerEvent<T extends Annotation> {
4
4
  originalEvent: PointerEvent;
5
- annotation?: ImageAnnotation;
5
+ annotation?: T;
6
6
  }
7
- export declare const addEventListeners: (svg: SVGSVGElement, store: SvelteImageAnnotationStore) => {
7
+ export declare const addEventListeners: <T extends Annotation>(svg: SVGSVGElement, store: SvelteImageAnnotationStore<T>) => {
8
8
  onPointerDown: () => number;
9
9
  onPointerUp: (evt: PointerEvent) => void;
10
10
  };