@recogito/text-annotator 3.0.0-rc.45 → 3.0.0-rc.46

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,6 +1,7 @@
1
1
  import { Filter, User } from '@annotorious/core';
2
2
  import { TextAnnotatorState } from './state';
3
- export declare const SelectionHandler: (container: HTMLElement, state: TextAnnotatorState, annotatingEnabled: boolean, offsetReferenceSelector?: string) => {
3
+ import { TextAnnotation } from './model';
4
+ export declare const SelectionHandler: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, annotatingEnabled: boolean, offsetReferenceSelector?: string) => {
4
5
  destroy: () => void;
5
6
  setFilter: (filter?: Filter) => Filter;
6
7
  setUser: (user?: User) => User;
@@ -3,10 +3,10 @@ import { HighlightStyleExpression } from './highlight';
3
3
  import { TextAnnotatorState } from './state';
4
4
  import { TextAnnotation } from './model';
5
5
  import { TextAnnotatorOptions } from './TextAnnotatorOptions';
6
- export interface TextAnnotator<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends Annotator<TextAnnotation, E> {
6
+ export interface TextAnnotator<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends Annotator<I, E> {
7
7
  element: HTMLElement;
8
8
  setStyle(style: HighlightStyleExpression | undefined): void;
9
- scrollIntoView(annotation: I): boolean;
10
- state: TextAnnotatorState<I>;
9
+ scrollIntoView(annotationOrId: I | string): boolean;
10
+ state: TextAnnotatorState<I, E>;
11
11
  }
12
12
  export declare const createTextAnnotator: <E extends unknown = TextAnnotation>(container: HTMLElement, options?: TextAnnotatorOptions<TextAnnotation, E>) => TextAnnotator<TextAnnotation, E>;
@@ -7,7 +7,7 @@ export interface TextAnnotatorOptions<I extends TextAnnotation = TextAnnotation,
7
7
  annotatingEnabled?: boolean;
8
8
  renderer?: RendererType;
9
9
  offsetReferenceSelector?: string;
10
- userSelectAction?: UserSelectActionExpression<TextAnnotation>;
10
+ userSelectAction?: UserSelectActionExpression<E>;
11
11
  presence?: PresencePainterOptions;
12
12
  style?: HighlightStyleExpression;
13
13
  user?: User;
@@ -17,4 +17,4 @@ export interface Renderer {
17
17
  setPainter(painter?: HighlightPainter): void;
18
18
  setVisible(visible: boolean): void;
19
19
  }
20
- export declare const createBaseRenderer: <T extends TextAnnotatorState = TextAnnotatorState<import('..').TextAnnotation>>(container: HTMLElement, state: T, viewport: ViewportState, renderer: RendererImplementation) => Renderer;
20
+ export declare const createBaseRenderer: <T extends TextAnnotatorState = TextAnnotatorState<import('..').TextAnnotation, import('..').TextAnnotation>>(container: HTMLElement, state: T, viewport: ViewportState, renderer: RendererImplementation) => Renderer;
@@ -1,3 +1,4 @@
1
1
  import { ViewportState } from '@annotorious/core';
2
2
  import { TextAnnotatorState } from '../../state';
3
- export declare const createCanvasRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => import('../baseRenderer').Renderer;
3
+ import { TextAnnotation } from 'src/model';
4
+ export declare const createCanvasRenderer: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, viewport: ViewportState) => import('../baseRenderer').Renderer;
@@ -1,5 +1,6 @@
1
1
  import { ViewportState } from '@annotorious/core';
2
2
  import { TextAnnotatorState } from 'src/state';
3
3
  import { RendererImplementation } from '../baseRenderer';
4
+ import { TextAnnotation } from 'src/model';
4
5
  export declare const createRenderer: () => RendererImplementation;
5
- export declare const createHighlightsRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => import('../baseRenderer').Renderer;
6
+ export declare const createHighlightsRenderer: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, viewport: ViewportState) => import('../baseRenderer').Renderer;
@@ -1,3 +1,4 @@
1
1
  import { ViewportState } from '@annotorious/core';
2
2
  import { TextAnnotatorState } from '../../state';
3
- export declare const createSpansRenderer: <T extends TextAnnotatorState = TextAnnotatorState<import('../..').TextAnnotation>>(container: HTMLElement, state: T, viewport: ViewportState) => import('../baseRenderer').Renderer;
3
+ import { TextAnnotation } from 'src/model';
4
+ export declare const createSpansRenderer: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, viewport: ViewportState) => import('../baseRenderer').Renderer;
@@ -1,10 +1,10 @@
1
1
  import { ViewportState, UserSelectActionExpression, AnnotatorState, SelectionState, HoverState } from '@annotorious/core';
2
2
  import { TextAnnotation } from '../model';
3
3
  import { TextAnnotationStore } from './TextAnnotationStore';
4
- export interface TextAnnotatorState<T extends TextAnnotation = TextAnnotation> extends AnnotatorState<T> {
5
- store: TextAnnotationStore<T>;
6
- selection: SelectionState<T>;
7
- hover: HoverState<T>;
4
+ export interface TextAnnotatorState<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends AnnotatorState<I, E> {
5
+ store: TextAnnotationStore<I>;
6
+ selection: SelectionState<I, E>;
7
+ hover: HoverState<I>;
8
8
  viewport: ViewportState;
9
9
  }
10
- export declare const createTextAnnotatorState: <T extends TextAnnotation>(container: HTMLElement, defaultUserSelectAction?: UserSelectActionExpression<TextAnnotation>) => TextAnnotatorState<T>;
10
+ export declare const createTextAnnotatorState: <I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation>(container: HTMLElement, defaultUserSelectAction?: UserSelectActionExpression<E>) => TextAnnotatorState<I, E>;