@annotorious/core 3.0.0-pre-alpha-53 → 3.0.0-pre-alpha-54

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/core",
3
- "version": "3.0.0-pre-alpha-53",
3
+ "version": "3.0.0-pre-alpha-54",
4
4
  "description": "Annotorious core types and functions",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -3,8 +3,8 @@ import type { User } from './User';
3
3
  import type { PresenceProvider } from '../presence';
4
4
  import { Origin, type HoverState, type SelectionState, type Store, type ViewportState } from '../state';
5
5
  import type { LifecycleEvents } from '../lifecycle';
6
- import type { Formatter } from './Formatter';
7
6
  import { parseAll, type FormatAdapter } from './FormatAdapter';
7
+ import type { DrawingStyle } from './DrawingStyle';
8
8
 
9
9
  /**
10
10
  * Base annotator interface.
@@ -13,6 +13,8 @@ import { parseAll, type FormatAdapter } from './FormatAdapter';
13
13
  */
14
14
  export interface Annotator<I extends Annotation = Annotation, E extends unknown = Annotation> {
15
15
 
16
+ style: DrawingStyle | ((annotation: I) => DrawingStyle) | undefined;
17
+
16
18
  addAnnotation(annotation: E): void;
17
19
 
18
20
  clearAnnotations(): void;
@@ -31,8 +33,6 @@ export interface Annotator<I extends Annotation = Annotation, E extends unknown
31
33
 
32
34
  setAnnotations(annotations: E[]): void;
33
35
 
34
- setFormatter(formatter: Formatter): void;
35
-
36
36
  setPresenceProvider?(provider: PresenceProvider): void;
37
37
 
38
38
  setSelected(arg?: string | string[]): void;
@@ -1,5 +1,3 @@
1
- import type { Annotation } from './Annotation';
2
-
3
1
  type RGB = `rgb(${number}, ${number}, ${number})`;
4
2
 
5
3
  type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
@@ -14,6 +12,4 @@ export interface DrawingStyle {
14
12
 
15
13
  fillOpacity?: number;
16
14
 
17
- }
18
-
19
- export type Formatter = <T extends Annotation = Annotation>(annotation: T, isSelected?: boolean) => DrawingStyle;
15
+ }
@@ -1,6 +1,6 @@
1
1
  export * from './Annotation';
2
2
  export * from './Annotator';
3
+ export * from './DrawingStyle';
3
4
  export * from './FormatAdapter';
4
- export * from './Formatter';
5
5
  export * from './User';
6
6
  export * from './W3CAnnotation';