cs-label-tool 2.0.0-alpha.1

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.
Files changed (74) hide show
  1. package/README.md +824 -0
  2. package/dist/components/annotator-element.d.ts +14 -0
  3. package/dist/components/annotator-element.d.ts.map +1 -0
  4. package/dist/components/define.d.ts +6 -0
  5. package/dist/components/define.d.ts.map +1 -0
  6. package/dist/components/styles.d.ts +2 -0
  7. package/dist/components/styles.d.ts.map +1 -0
  8. package/dist/core/annotator.d.ts +8 -0
  9. package/dist/core/annotator.d.ts.map +1 -0
  10. package/dist/core/commands.d.ts +34 -0
  11. package/dist/core/commands.d.ts.map +1 -0
  12. package/dist/core/events.d.ts +25 -0
  13. package/dist/core/events.d.ts.map +1 -0
  14. package/dist/core/immutability.d.ts +4 -0
  15. package/dist/core/immutability.d.ts.map +1 -0
  16. package/dist/core/state.d.ts +42 -0
  17. package/dist/core/state.d.ts.map +1 -0
  18. package/dist/core/types.d.ts +64 -0
  19. package/dist/core/types.d.ts.map +1 -0
  20. package/dist/cs-label-tool.d.ts +247 -0
  21. package/dist/cs-label-tool.d.ts.map +1 -0
  22. package/dist/geometry/matrix.d.ts +5 -0
  23. package/dist/geometry/matrix.d.ts.map +1 -0
  24. package/dist/geometry/polygon.d.ts +10 -0
  25. package/dist/geometry/polygon.d.ts.map +1 -0
  26. package/dist/geometry/rect.d.ts +4 -0
  27. package/dist/geometry/rect.d.ts.map +1 -0
  28. package/dist/geometry/types.d.ts +19 -0
  29. package/dist/geometry/types.d.ts.map +1 -0
  30. package/dist/image/image-commands.d.ts +14 -0
  31. package/dist/image/image-commands.d.ts.map +1 -0
  32. package/dist/image/standard-source.d.ts +3 -0
  33. package/dist/image/standard-source.d.ts.map +1 -0
  34. package/dist/image/types.d.ts +12 -0
  35. package/dist/image/types.d.ts.map +1 -0
  36. package/dist/index.d.ts +25 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +2299 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/labels/labels.d.ts +6 -0
  41. package/dist/labels/labels.d.ts.map +1 -0
  42. package/dist/mask/rle.d.ts +13 -0
  43. package/dist/mask/rle.d.ts.map +1 -0
  44. package/dist/render/canvas-layers.d.ts +14 -0
  45. package/dist/render/canvas-layers.d.ts.map +1 -0
  46. package/dist/render/canvas-renderer.d.ts +10 -0
  47. package/dist/render/canvas-renderer.d.ts.map +1 -0
  48. package/dist/render/scheduler.d.ts +12 -0
  49. package/dist/render/scheduler.d.ts.map +1 -0
  50. package/dist/spatial/grid-index.d.ts +15 -0
  51. package/dist/spatial/grid-index.d.ts.map +1 -0
  52. package/dist/tools/api.d.ts +32 -0
  53. package/dist/tools/api.d.ts.map +1 -0
  54. package/dist/tools/brush-tool.d.ts +23 -0
  55. package/dist/tools/brush-tool.d.ts.map +1 -0
  56. package/dist/tools/controller.d.ts +9 -0
  57. package/dist/tools/controller.d.ts.map +1 -0
  58. package/dist/tools/eraser-tool.d.ts +8 -0
  59. package/dist/tools/eraser-tool.d.ts.map +1 -0
  60. package/dist/tools/index.d.ts +11 -0
  61. package/dist/tools/index.d.ts.map +1 -0
  62. package/dist/tools/polygon-tool.d.ts +33 -0
  63. package/dist/tools/polygon-tool.d.ts.map +1 -0
  64. package/dist/tools/rect-tool.d.ts +32 -0
  65. package/dist/tools/rect-tool.d.ts.map +1 -0
  66. package/dist/tools/registry.d.ts +4 -0
  67. package/dist/tools/registry.d.ts.map +1 -0
  68. package/dist/tools/select-tool.d.ts +15 -0
  69. package/dist/tools/select-tool.d.ts.map +1 -0
  70. package/dist/tools/types.d.ts +80 -0
  71. package/dist/tools/types.d.ts.map +1 -0
  72. package/dist/viewport/viewport.d.ts +20 -0
  73. package/dist/viewport/viewport.d.ts.map +1 -0
  74. package/package.json +38 -0
@@ -0,0 +1,14 @@
1
+ import type { Annotator, AnnotatorOptions } from '../core/types.js';
2
+ type HTMLElementConstructor = new () => HTMLElement;
3
+ declare const HTMLElementBase: HTMLElementConstructor;
4
+ export type ComponentAnnotatorOptions = Omit<AnnotatorOptions, 'container'>;
5
+ export declare class CSAnnotatorElement extends HTMLElementBase {
6
+ #private;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ configure(options?: ComponentAnnotatorOptions): Annotator;
10
+ get annotator(): Annotator | null;
11
+ destroy(): void;
12
+ }
13
+ export {};
14
+ //# sourceMappingURL=annotator-element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotator-element.d.ts","sourceRoot":"","sources":["../../src/components/annotator-element.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAUnE,KAAK,sBAAsB,GAAG,UAAU,WAAW,CAAA;AACnD,QAAA,MAAM,eAAe,EAEhB,sBAAsB,CAAA;AAE3B,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAA;AAE3E,qBAAa,kBAAmB,SAAQ,eAAe;;IAQrD,iBAAiB,IAAI,IAAI,CAoCxB;IAED,oBAAoB,IAAI,IAAI,CAE3B;IAED,SAAS,CAAC,OAAO,GAAE,yBAA8B,GAAG,SAAS,CAoB5D;IAED,IAAI,SAAS,IAAI,SAAS,GAAG,IAAI,CAEhC;IAED,OAAO,IAAI,IAAI,CASd;CAyFF"}
@@ -0,0 +1,6 @@
1
+ import type { Annotator } from '../core/types.js';
2
+ import { type ComponentAnnotatorOptions } from './annotator-element.js';
3
+ export declare function defineAnnotatorElements(): void;
4
+ export declare function mountAnnotator(target: string | Element, options?: ComponentAnnotatorOptions): Annotator;
5
+ export declare function unmountAnnotator(target: string | Element): void;
6
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/components/define.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAA;AAE/B,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C;AAYD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,OAAO,GAAE,yBAA8B,GACtC,SAAS,CAMX;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAU/D"}
@@ -0,0 +1,2 @@
1
+ export declare const annotatorStyles = "\n :host {\n --cs-annotator-background: #101318;\n --cs-annotator-border: #2a3039;\n --cs-annotator-control: #1a2029;\n --cs-annotator-control-active: #2563eb;\n --cs-annotator-foreground: #f8fafc;\n display: block;\n width: 100%;\n height: 100%;\n color: var(--cs-annotator-foreground);\n font: 14px/1.4 system-ui, sans-serif;\n }\n\n [part=\"shell\"] {\n display: grid;\n grid-template-rows: auto minmax(0, 1fr);\n width: 100%;\n height: 100%;\n overflow: hidden;\n background: var(--cs-annotator-background);\n }\n\n [part=\"toolbar\"] {\n display: flex;\n gap: 6px;\n align-items: center;\n padding: 8px;\n border-bottom: 1px solid var(--cs-annotator-border);\n }\n\n button {\n min-height: 32px;\n padding: 5px 10px;\n color: inherit;\n background: var(--cs-annotator-control);\n border: 1px solid var(--cs-annotator-border);\n border-radius: 6px;\n cursor: pointer;\n }\n\n button[aria-pressed=\"true\"] {\n background: var(--cs-annotator-control-active);\n border-color: #93c5fd;\n outline: 2px solid #ffffff;\n outline-offset: -4px;\n }\n\n button:focus-visible {\n outline: 2px solid #93c5fd;\n outline-offset: 2px;\n }\n\n button:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n }\n\n [part=\"workspace\"] {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 180px;\n min-height: 0;\n }\n\n [part=\"viewport\"] {\n position: relative;\n min-width: 0;\n min-height: 0;\n background: #090b0f;\n }\n\n [part=\"labels\"] {\n overflow: auto;\n padding: 8px;\n border-left: 1px solid var(--cs-annotator-border);\n }\n\n [part=\"labels\"] button {\n display: block;\n width: 100%;\n margin-bottom: 6px;\n text-align: left;\n }\n";
2
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/components/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,0xDAmF3B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { type InternalState } from './state.js';
2
+ import { type AnnotationSnapshot, type Annotator, type AnnotatorOptions } from './types.js';
3
+ /** 通过不透明句柄读取内部状态,同时统一拦截已销毁实例。 */
4
+ export declare function getInternalState(annotator: Annotator): InternalState;
5
+ export declare function createAnnotator(options: AnnotatorOptions): Annotator;
6
+ export declare function destroyAnnotator(annotator: Annotator): void;
7
+ export declare function getSnapshot(annotator: Annotator): AnnotationSnapshot;
8
+ //# sourceMappingURL=annotator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotator.d.ts","sourceRoot":"","sources":["../../src/core/annotator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAA;AAKnB,iCAAiC;AACjC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa,CASpE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAIpE;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAqB3D;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,kBAAkB,CAWpE"}
@@ -0,0 +1,34 @@
1
+ import type { Bounds, Point } from '../geometry/types.js';
2
+ import { type ChangeKind } from './events.js';
3
+ import type { InternalState } from './state.js';
4
+ import type { Annotation, Annotator, MaskGeometry, PolygonGeometry, RectGeometry } from './types.js';
5
+ export interface AddRectInput extends Omit<RectGeometry, 'type'> {
6
+ readonly labelId: string;
7
+ }
8
+ export interface AddPolygonInput {
9
+ readonly labelId: string;
10
+ readonly points: readonly Point[];
11
+ }
12
+ /**
13
+ * 所有领域修改的统一入口:先执行 redo,再记录可撤销操作并发送 change 事件。
14
+ * UI 和工具不应直接修改 InternalState。
15
+ */
16
+ export declare function commitDomainCommand(annotator: Annotator, kind: ChangeKind, redo: (state: InternalState) => void, undo: (state: InternalState) => void): void;
17
+ export declare function addRect(annotator: Annotator, input: AddRectInput): string;
18
+ export declare function addPolygon(annotator: Annotator, input: AddPolygonInput): string;
19
+ export interface AddMaskInput {
20
+ readonly labelId: string;
21
+ readonly width: number;
22
+ readonly height: number;
23
+ readonly rle: readonly number[];
24
+ }
25
+ export declare function addMask(annotator: Annotator, input: AddMaskInput): string;
26
+ export declare function updateAnnotation(annotator: Annotator, id: string, geometry: RectGeometry | PolygonGeometry | MaskGeometry): void;
27
+ export declare function updateAnnotationLabel(annotator: Annotator, id: string, labelId: string): void;
28
+ export declare function removeAnnotation(annotator: Annotator, id: string): boolean;
29
+ export declare function canUndo(annotator: Annotator): boolean;
30
+ export declare function canRedo(annotator: Annotator): boolean;
31
+ export declare function undo(annotator: Annotator): boolean;
32
+ export declare function redo(annotator: Annotator): boolean;
33
+ export declare function queryAnnotations(annotator: Annotator, bounds: Bounds): Annotation[];
34
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/core/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAUzD,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAEzD,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,YAAY,CAAA;AAE7D,OAAO,KAAK,EACV,UAAU,EAEV,SAAS,EACT,YAAY,EACZ,eAAe,EAC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,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAmB1E;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAErD;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAErD;AAED,wBAAgB,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAWlD;AAED,wBAAgB,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAWlD;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,UAAU,EAAE,CAMd"}
@@ -0,0 +1,25 @@
1
+ import type { Annotator } from './types.js';
2
+ export type ChangeKind = 'annotation:add' | 'annotation:remove' | 'annotation:update' | 'history:redo' | 'history:undo' | 'image:clear' | 'image:load' | 'label:activate' | 'label:add' | 'label:update' | 'selection:update';
3
+ export interface ChangeEvent {
4
+ readonly type: 'change';
5
+ readonly kind: ChangeKind;
6
+ readonly revision: number;
7
+ }
8
+ export interface AnnotatorErrorEvent {
9
+ readonly type: 'error';
10
+ readonly code: 'SUBSCRIBER_ERROR';
11
+ readonly error: unknown;
12
+ }
13
+ export interface AnnotatorEventMap {
14
+ readonly change: ChangeEvent;
15
+ readonly error: AnnotatorErrorEvent;
16
+ }
17
+ export type AnnotatorEventName = keyof AnnotatorEventMap;
18
+ export type AnnotatorEventListener<K extends AnnotatorEventName> = (event: AnnotatorEventMap[K]) => void;
19
+ export interface EventListeners {
20
+ readonly change: Set<AnnotatorEventListener<'change'>>;
21
+ readonly error: Set<AnnotatorEventListener<'error'>>;
22
+ }
23
+ export declare function emitChange(annotator: Annotator, kind: ChangeKind): void;
24
+ export declare function subscribe<K extends AnnotatorEventName>(annotator: Annotator, type: K, listener: AnnotatorEventListener<K>): () => void;
25
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sour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AE,SAAS,EACpB,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAClC,MAAM,IAAI,CAaZ"}
@@ -0,0 +1,4 @@
1
+ import type { Annotation, MaskGeometry, PolygonGeometry, RectGeometry } from './types.js';
2
+ export declare function cloneGeometry(geometry: RectGeometry | PolygonGeometry | MaskGeometry): RectGeometry | PolygonGeometry | MaskGeometry;
3
+ export declare function cloneAnnotation(annotation: Annotation): Annotation;
4
+ //# sourceMappingURL=immutability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"immutability.d.ts","sourceRoot":"","sources":["../../src/core/immutability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAA;AAcnB,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,YAAY,GACtD,YAAY,GAAG,eAAe,GAAG,YAAY,CAmB/C;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAOlE"}
@@ -0,0 +1,42 @@
1
+ import type { Annotation, AnnotatorOptions, LabelDefinition } from './types.js';
2
+ import type { EventListeners } from './events.js';
3
+ import { type GridIndex } from '../spatial/grid-index.js';
4
+ import type { ImageSource, LoadedImage } from '../image/types.js';
5
+ import type { CanvasRenderer } from '../render/canvas-renderer.js';
6
+ import type { ViewportState } from '../viewport/viewport.js';
7
+ import type { ToolController, InteractionDraft, ToolRegistry } from '../tools/types.js';
8
+ export interface HistoryEntry {
9
+ /** 同一条历史记录必须同时描述正向执行和反向恢复。 */
10
+ readonly undo: (state: InternalState) => void;
11
+ readonly redo: (state: InternalState) => void;
12
+ }
13
+ /**
14
+ * 标注器的唯一可变状态。对外只暴露不透明 Annotator 句柄,所有读写都经过命令层。
15
+ * 这样可以保证数组、ID 索引、空间索引、历史记录和渲染通知始终一起更新。
16
+ */
17
+ export interface InternalState {
18
+ readonly container: HTMLElement;
19
+ readonly historyLimit: number;
20
+ destroyed: boolean;
21
+ revision: number;
22
+ annotations: Annotation[];
23
+ labels: LabelDefinition[];
24
+ activeLabelId: string | null;
25
+ spatialIndex: GridIndex;
26
+ annotationsById: Map<string, Annotation>;
27
+ undoStack: HistoryEntry[];
28
+ redoStack: HistoryEntry[];
29
+ readonly listeners: EventListeners;
30
+ imageSource: ImageSource | null;
31
+ image: LoadedImage | null;
32
+ imageAbortController: AbortController | null;
33
+ renderer: CanvasRenderer | null;
34
+ viewport: ViewportState | null;
35
+ toolController: ToolController | null;
36
+ activeToolId: string | null;
37
+ interactionDraft: InteractionDraft | null;
38
+ selectedIds: string[];
39
+ readonly toolRegistry: ToolRegistry;
40
+ }
41
+ export declare function createInternalState(options: AnnotatorOptions): InternalState;
42
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGvF,MAAM,WAAW,YAAY;IAC3B,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IAC7C,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAA;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,YAAY,EAAE,SAAS,CAAA;IACvB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACxC,SAAS,EAAE,YAAY,EAAE,CAAA;IACzB,SAAS,EAAE,YAAY,EAAE,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;IAClC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IAC/B,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;IACzB,oBAAoB,EAAE,eAAe,GAAG,IAAI,CAAA;IAC5C,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IAC/B,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,cAAc,EAAE,cAAc,GAAG,IAAI,CAAA;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACzC,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAA;CACpC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CA4B5E"}
@@ -0,0 +1,64 @@
1
+ declare const annotatorBrand: unique symbol;
2
+ export interface Annotator {
3
+ readonly [annotatorBrand]: true;
4
+ }
5
+ export interface AnnotatorOptions {
6
+ readonly container: HTMLElement;
7
+ readonly historyLimit?: number;
8
+ }
9
+ export interface LabelDefinition {
10
+ readonly id: string;
11
+ readonly name: string;
12
+ readonly color: string;
13
+ }
14
+ export interface AnnotationBase {
15
+ readonly id: string;
16
+ readonly labelId: string;
17
+ readonly source: 'manual' | 'ai';
18
+ readonly status: 'suggested' | 'accepted' | 'rejected' | 'modified';
19
+ readonly revision: number;
20
+ readonly createdAt: number;
21
+ readonly updatedAt: number;
22
+ readonly metadata: Readonly<Record<string, unknown>>;
23
+ }
24
+ export interface RectGeometry {
25
+ readonly type: 'rect';
26
+ readonly x: number;
27
+ readonly y: number;
28
+ readonly width: number;
29
+ readonly height: number;
30
+ }
31
+ export interface PolygonGeometry {
32
+ readonly type: 'polygon';
33
+ readonly points: readonly (readonly [number, number])[];
34
+ }
35
+ export interface MaskGeometry {
36
+ readonly type: 'mask';
37
+ readonly width: number;
38
+ readonly height: number;
39
+ readonly rle: readonly number[];
40
+ }
41
+ export interface RectAnnotation extends AnnotationBase {
42
+ readonly geometry: RectGeometry;
43
+ }
44
+ export interface PolygonAnnotation extends AnnotationBase {
45
+ readonly geometry: PolygonGeometry;
46
+ }
47
+ export interface MaskAnnotation extends AnnotationBase {
48
+ readonly geometry: MaskGeometry;
49
+ }
50
+ export type Annotation = RectAnnotation | PolygonAnnotation | MaskAnnotation;
51
+ export interface AnnotationSnapshot {
52
+ readonly schemaVersion: 1;
53
+ readonly revision: number;
54
+ readonly annotations: readonly Annotation[];
55
+ readonly labels: readonly LabelDefinition[];
56
+ }
57
+ export type AnnotatorErrorCode = 'ANNOTATOR_DESTROYED' | 'ANNOTATION_NOT_FOUND' | 'DUPLICATE_LABEL' | 'INVALID_GEOMETRY' | 'UNKNOWN_LABEL';
58
+ export declare class AnnotatorError extends Error {
59
+ readonly code: AnnotatorErrorCode;
60
+ constructor(code: AnnotatorErrorCode, message: string);
61
+ }
62
+ export declare function createAnnotatorHandle(): Annotator;
63
+ export {};
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","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otator.js';
2
+ import * as Commands from './core/commands.js';
3
+ import * as Events from './core/events.js';
4
+ import * as Types from './core/types.js';
5
+ import * as Rect from './geometry/rect.js';
6
+ import * as Polygon from './geometry/polygon.js';
7
+ import * as GeometryTypes from './geometry/types.js';
8
+ import * as Viewport from './viewport/viewport.js';
9
+ import * as Labels from './labels/labels.js';
10
+ import * as Spatial from './spatial/grid-index.js';
11
+ import * as ImageCommands from './image/image-commands.js';
12
+ import * as ImageSource from './image/standard-source.js';
13
+ import * as ImageTypes from './image/types.js';
14
+ import * as Tools from './tools/index.js';
15
+ import * as RectTool from './tools/rect-tool.js';
16
+ import * as PolygonTool from './tools/polygon-tool.js';
17
+ import * as SelectTool from './tools/select-tool.js';
18
+ import * as BrushTool from './tools/brush-tool.js';
19
+ import * as EraserTool from './tools/eraser-tool.js';
20
+ import * as Components from './components/define.js';
21
+ import type { Tool, ToolCategory, LabelDefinition, Annotator } from './index.js';
22
+ export type { Annotation, AnnotationBase, AnnotationSnapshot, Annotator, AnnotatorErrorCode, AnnotatorOptions, LabelDefinition, PolygonAnnotation, PolygonGeometry, RectAnnotation, RectGeometry, AnnotatorError, } from './core/types.js';
23
+ export type { AddPolygonInput, AddRectInput, AddMaskInput, } from './core/commands.js';
24
+ export type { AnnotatorErrorEvent, AnnotatorEventListener, AnnotatorEventMap, AnnotatorEventName, ChangeEvent, ChangeKind, } from './core/events.js';
25
+ export type { Bounds, Matrix2D, Point, Size, } from './geometry/types.js';
26
+ export type { PolygonValidation, } from './geometry/polygon.js';
27
+ export type { ViewportOptions, ViewportState, } from './viewport/viewport.js';
28
+ export type { GridIndex, } from './spatial/grid-index.js';
29
+ export type { ImageSource, LoadedImage, StandardImageInput, } from './image/types.js';
30
+ export type { Tool, ToolCategory, ToolContext, ToolController, ToolRegistry, KeyboardShortcut, InteractionDraft, NormalizedPointerInput, } from './tools/types.js';
31
+ export type { AnnotationToolApi } from './tools/api.js';
32
+ export type { RectToolInput, RectToolOptions, RectToolResult, RectToolState, } from './tools/rect-tool.js';
33
+ export type { PolygonToolInput, PolygonToolOptions, PolygonToolResult, PolygonToolState, } from './tools/polygon-tool.js';
34
+ export type { BrushToolOptions, } from './tools/brush-tool.js';
35
+ export type { EraserToolOptions, } from './tools/eraser-tool.js';
36
+ export type { RectHandle, } from './tools/select-tool.js';
37
+ export type { CSAnnotatorElement, ComponentAnnotatorOptions, } from './components/annotator-element.js';
38
+ declare const API: {
39
+ create: typeof Core.createAnnotator;
40
+ destroy: typeof Core.destroyAnnotator;
41
+ snapshot: typeof Core.getSnapshot;
42
+ addRect: typeof Commands.addRect;
43
+ addPolygon: typeof Commands.addPolygon;
44
+ addMask: typeof Commands.addMask;
45
+ updateAnnotation: typeof Commands.updateAnnotation;
46
+ removeAnnotation: typeof Commands.removeAnnotation;
47
+ queryAnnotations: typeof Commands.queryAnnotations;
48
+ updateAnnotationLabel: typeof Commands.updateAnnotationLabel;
49
+ undo: typeof Commands.undo;
50
+ redo: typeof Commands.redo;
51
+ canUndo: typeof Commands.canUndo;
52
+ canRedo: typeof Commands.canRedo;
53
+ subscribe: typeof Events.subscribe;
54
+ addLabel: typeof Labels.addLabel;
55
+ getActiveLabel: typeof Labels.getActiveLabel;
56
+ setActiveLabel: typeof Labels.setActiveLabel;
57
+ updateLabel: typeof Labels.updateLabel;
58
+ setImage: typeof ImageCommands.setImageSource;
59
+ fitToScreen: typeof ImageCommands.fitToScreen;
60
+ zoomTo: typeof ImageCommands.zoomTo;
61
+ zoomBy: typeof ImageCommands.zoomBy;
62
+ panBy: typeof ImageCommands.panBy;
63
+ getZoom: typeof ImageCommands.getZoom;
64
+ hasImage: typeof ImageCommands.hasImage;
65
+ resizeViewport: typeof ImageCommands.resizeViewport;
66
+ clientToImage: typeof ImageCommands.clientToImage;
67
+ imageToClient: typeof ImageCommands.imageToClient;
68
+ createImageSource: typeof ImageSource.createStandardImageSource;
69
+ useSelect: typeof SelectTool.useSelect;
70
+ useRect: typeof RectTool.useRect;
71
+ usePolygon: typeof PolygonTool.usePolygon;
72
+ useBrush: typeof BrushTool.useBrush;
73
+ useEraser: typeof EraserTool.useEraser;
74
+ activateTool: typeof Tools.activateTool;
75
+ activateToolById: typeof Tools.activateToolById;
76
+ registerTool: typeof Tools.registerTool;
77
+ unregisterTool: typeof Tools.unregisterTool;
78
+ getTool: typeof Tools.getTool;
79
+ listTools: typeof Tools.listTools;
80
+ listToolsByCategory: typeof Tools.listToolsByCategory;
81
+ cancelGesture: typeof Tools.cancelActiveGesture;
82
+ createToolApi: typeof Tools.createToolApi;
83
+ getActiveToolId: typeof Tools.getActiveToolId;
84
+ deleteSelectedAnnotations: typeof Tools.deleteSelectedAnnotations;
85
+ updateSelectedAnnotationsLabel: typeof Tools.updateSelectedAnnotationsLabel;
86
+ selectAnnotation: typeof SelectTool.selectAnnotation;
87
+ clearSelection: typeof SelectTool.clearSelection;
88
+ getSelection: typeof SelectTool.getSelection;
89
+ mount: typeof Components.mountAnnotator;
90
+ unmount: typeof Components.unmountAnnotator;
91
+ defineElements: typeof Components.defineAnnotatorElements;
92
+ normalizeRect: typeof Rect.normalizeRect;
93
+ pointInRect: typeof Rect.pointInRect;
94
+ pointInPolygon: typeof Polygon.pointInPolygon;
95
+ validatePolygon: typeof Polygon.validatePolygon;
96
+ createGridIndex: typeof Spatial.createGridIndex;
97
+ insertSpatialItem: typeof Spatial.insertSpatialItem;
98
+ updateSpatialItem: typeof Spatial.updateSpatialItem;
99
+ removeSpatialItem: typeof Spatial.removeSpatialItem;
100
+ querySpatialBounds: typeof Spatial.querySpatialBounds;
101
+ createViewport: typeof Viewport.createViewport;
102
+ fitViewport: typeof Viewport.fitViewport;
103
+ imageToScreen: typeof Viewport.imageToScreen;
104
+ screenToImage: typeof Viewport.screenToImage;
105
+ zoomAt: typeof Viewport.zoomAt;
106
+ panViewport: typeof Viewport.panViewport;
107
+ createSelectTool: typeof SelectTool.createSelectTool;
108
+ createRectTool: typeof RectTool.createRectTool;
109
+ createPolygonTool: typeof PolygonTool.createPolygonTool;
110
+ createBrushTool: typeof BrushTool.createBrushTool;
111
+ createEraserTool: typeof EraserTool.createEraserTool;
112
+ moveRect: typeof SelectTool.moveRect;
113
+ resizeRect: typeof SelectTool.resizeRect;
114
+ movePolygonVertex: typeof SelectTool.movePolygonVertex;
115
+ removePolygonVertex: typeof SelectTool.removePolygonVertex;
116
+ AnnotatorError: typeof Types.AnnotatorError;
117
+ };
118
+ export interface AnnotatorInstance {
119
+ annotator: Annotator;
120
+ readonly tools: Tools.AnnotationToolApi;
121
+ addRect(input: Omit<Commands.AddRectInput, 'type'>): string;
122
+ addPolygon(input: Commands.AddPolygonInput): string;
123
+ addMask(input: Commands.AddMaskInput): string;
124
+ updateAnnotation(id: string, geometry: Types.RectGeometry | Types.PolygonGeometry | Types.MaskGeometry): void;
125
+ updateAnnotationLabel(id: string, labelId: string): void;
126
+ removeAnnotation(id: string): boolean;
127
+ queryAnnotations(bounds: GeometryTypes.Bounds): readonly Types.Annotation[];
128
+ undo(): boolean;
129
+ redo(): boolean;
130
+ canUndo(): boolean;
131
+ canRedo(): boolean;
132
+ addLabel(label: LabelDefinition): void;
133
+ getActiveLabel(): string | null;
134
+ setActiveLabel(labelId: string): void;
135
+ updateLabel(labelId: string, updates: Partial<Pick<LabelDefinition, 'name' | 'color'>>): void;
136
+ setImage(source: ImageTypes.ImageSource): Promise<void>;
137
+ fitToScreen(): void;
138
+ zoomTo(scale: number, anchor?: GeometryTypes.Point): void;
139
+ zoomBy(factor: number): void;
140
+ panBy(delta: GeometryTypes.Point): void;
141
+ getZoom(): number;
142
+ hasImage(): boolean;
143
+ resizeViewport(): void;
144
+ useSelect(): void;
145
+ useRect(options?: Partial<RectTool.RectToolOptions>): void;
146
+ usePolygon(options?: Partial<PolygonTool.PolygonToolOptions>): void;
147
+ useBrush(options?: Partial<BrushTool.BrushToolOptions>): void;
148
+ useEraser(options?: Partial<EraserTool.EraserToolOptions>): void;
149
+ activateTool(tool: Tool): void;
150
+ activateToolById(toolId: string): void;
151
+ registerTool(tool: Tool): void;
152
+ unregisterTool(toolId: string): void;
153
+ getTool(toolId: string): Tool | undefined;
154
+ listTools(): readonly Tool[];
155
+ listToolsByCategory(category: ToolCategory): readonly Tool[];
156
+ cancelGesture(): void;
157
+ selectAnnotation(id: string): void;
158
+ clearSelection(): void;
159
+ getSelection(): readonly string[];
160
+ subscribe<K extends Events.AnnotatorEventName>(type: K, listener: Events.AnnotatorEventListener<K>): () => void;
161
+ snapshot(): Types.AnnotationSnapshot;
162
+ destroy(): void;
163
+ }
164
+ export declare function create(config: Types.AnnotatorOptions): AnnotatorInstance;
165
+ export declare function mount(container: string | HTMLElement, options?: Partial<Types.AnnotatorOptions>): AnnotatorInstance;
166
+ export { API as default };
167
+ export declare const csLabelTool: {
168
+ create: typeof Core.createAnnotator;
169
+ destroy: typeof Core.destroyAnnotator;
170
+ snapshot: typeof Core.getSnapshot;
171
+ addRect: typeof Commands.addRect;
172
+ addPolygon: typeof Commands.addPolygon;
173
+ addMask: typeof Commands.addMask;
174
+ updateAnnotation: typeof Commands.updateAnnotation;
175
+ removeAnnotation: typeof Commands.removeAnnotation;
176
+ queryAnnotations: typeof Commands.queryAnnotations;
177
+ updateAnnotationLabel: typeof Commands.updateAnnotationLabel;
178
+ undo: typeof Commands.undo;
179
+ redo: typeof Commands.redo;
180
+ canUndo: typeof Commands.canUndo;
181
+ canRedo: typeof Commands.canRedo;
182
+ subscribe: typeof Events.subscribe;
183
+ addLabel: typeof Labels.addLabel;
184
+ getActiveLabel: typeof Labels.getActiveLabel;
185
+ setActiveLabel: typeof Labels.setActiveLabel;
186
+ updateLabel: typeof Labels.updateLabel;
187
+ setImage: typeof ImageCommands.setImageSource;
188
+ fitToScreen: typeof ImageCommands.fitToScreen;
189
+ zoomTo: typeof ImageCommands.zoomTo;
190
+ zoomBy: typeof ImageCommands.zoomBy;
191
+ panBy: typeof ImageCommands.panBy;
192
+ getZoom: typeof ImageCommands.getZoom;
193
+ hasImage: typeof ImageCommands.hasImage;
194
+ resizeViewport: typeof ImageCommands.resizeViewport;
195
+ clientToImage: typeof ImageCommands.clientToImage;
196
+ imageToClient: typeof ImageCommands.imageToClient;
197
+ createImageSource: typeof ImageSource.createStandardImageSource;
198
+ useSelect: typeof SelectTool.useSelect;
199
+ useRect: typeof RectTool.useRect;
200
+ usePolygon: typeof PolygonTool.usePolygon;
201
+ useBrush: typeof BrushTool.useBrush;
202
+ useEraser: typeof EraserTool.useEraser;
203
+ activateTool: typeof Tools.activateTool;
204
+ activateToolById: typeof Tools.activateToolById;
205
+ registerTool: typeof Tools.registerTool;
206
+ unregisterTool: typeof Tools.unregisterTool;
207
+ getTool: typeof Tools.getTool;
208
+ listTools: typeof Tools.listTools;
209
+ listToolsByCategory: typeof Tools.listToolsByCategory;
210
+ cancelGesture: typeof Tools.cancelActiveGesture;
211
+ createToolApi: typeof Tools.createToolApi;
212
+ getActiveToolId: typeof Tools.getActiveToolId;
213
+ deleteSelectedAnnotations: typeof Tools.deleteSelectedAnnotations;
214
+ updateSelectedAnnotationsLabel: typeof Tools.updateSelectedAnnotationsLabel;
215
+ selectAnnotation: typeof SelectTool.selectAnnotation;
216
+ clearSelection: typeof SelectTool.clearSelection;
217
+ getSelection: typeof SelectTool.getSelection;
218
+ mount: typeof Components.mountAnnotator;
219
+ unmount: typeof Components.unmountAnnotator;
220
+ defineElements: typeof Components.defineAnnotatorElements;
221
+ normalizeRect: typeof Rect.normalizeRect;
222
+ pointInRect: typeof Rect.pointInRect;
223
+ pointInPolygon: typeof Polygon.pointInPolygon;
224
+ validatePolygon: typeof Polygon.validatePolygon;
225
+ createGridIndex: typeof Spatial.createGridIndex;
226
+ insertSpatialItem: typeof Spatial.insertSpatialItem;
227
+ updateSpatialItem: typeof Spatial.updateSpatialItem;
228
+ removeSpatialItem: typeof Spatial.removeSpatialItem;
229
+ querySpatialBounds: typeof Spatial.querySpatialBounds;
230
+ createViewport: typeof Viewport.createViewport;
231
+ fitViewport: typeof Viewport.fitViewport;
232
+ imageToScreen: typeof Viewport.imageToScreen;
233
+ screenToImage: typeof Viewport.screenToImage;
234
+ zoomAt: typeof Viewport.zoomAt;
235
+ panViewport: typeof Viewport.panViewport;
236
+ createSelectTool: typeof SelectTool.createSelectTool;
237
+ createRectTool: typeof RectTool.createRectTool;
238
+ createPolygonTool: typeof PolygonTool.createPolygonTool;
239
+ createBrushTool: typeof BrushTool.createBrushTool;
240
+ createEraserTool: typeof EraserTool.createEraserTool;
241
+ moveRect: typeof SelectTool.moveRect;
242
+ resizeRect: typeof SelectTool.resizeRect;
243
+ movePolygonVertex: typeof SelectTool.movePolygonVertex;
244
+ removePolygonVertex: typeof SelectTool.removePolygonVertex;
245
+ AnnotatorError: typeof Types.AnnotatorError;
246
+ };
247
+ //# sourceMappingURL=cs-label-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cs-label-tool.d.ts","sourceRoot":"","sources":["../src/cs-label-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AACxC,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC1C,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAA;AAClD,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AACzC,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AC,QAAQ,EAAE,YAAY,GAAG,SAAS,IAAI,EAAE,CAAA;IAC5D,aAAa,IAAI,IAAI,CAAA;IAErB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,cAAc,IAAI,IAAI,CAAA;IACtB,YAAY,IAAI,SAAS,MAAM,EAAE,CAAA;IAEjC,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,kBAAkB,EAC3C,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,GACzC,MAAM,IAAI,CAAA;IAEb,QAAQ,IAAI,KAAK,CAAC,kBAAkB,CAAA;IACpC,OAAO,IAAI,IAAI,CAAA;CAChB;AAiLD,wBAAgB,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,gBAAgB,GAAG,iBAAiB,CAGxE;AAED,wBAAgB,KAAK,CACnB,SAAS,EAAE,MAAM,GAAG,WAAW,EAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,GACxC,iBAAiB,CAGnB;AAED,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,CAAA;AAEzB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAM,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { Matrix2D, Point } from './types.js';
2
+ export declare function createScaleTranslateMatrix(scale: number, offsetX: number, offsetY: number): Matrix2D;
3
+ export declare function invertMatrix(matrix: Matrix2D): Matrix2D;
4
+ export declare function transformPoint(matrix: Matrix2D, point: Point): Point;
5
+ //# sourceMappingURL=matrix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../src/geometry/matrix.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEjD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,QAAQ,CAQV;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAcvD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAKpE"}
@@ -0,0 +1,10 @@
1
+ import type { Point } from './types.js';
2
+ export type PolygonValidation = {
3
+ readonly valid: true;
4
+ } | {
5
+ readonly valid: false;
6
+ readonly reason: 'NON_FINITE_POINT' | 'SELF_INTERSECTION' | 'TOO_FEW_POINTS' | 'ZERO_AREA';
7
+ };
8
+ export declare function pointInPolygon(point: Point, polygon: readonly Point[]): boolean;
9
+ export declare function validatePolygon(polygon: readonly Point[]): PolygonValidation;
10
+ //# sourceMappingURL=polygon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../src/geometry/polygon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GACxB;IACE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,MAAM,EACX,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,CAAA;CAChB,CAAA;AAsDL,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,OAAO,CA6B/E;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,KAAK,EAAE,GACxB,iBAAiB,CA+CnB"}
@@ -0,0 +1,4 @@
1
+ import type { Bounds, Point } from './types.js';
2
+ export declare function normalizeRect(start: Point, end: Point): Bounds;
3
+ export declare function pointInRect(point: Point, rect: Bounds): boolean;
4
+ //# sourceMappingURL=rect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../src/geometry/rect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAW/C,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,MAAM,CAY9D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQ/D"}
@@ -0,0 +1,19 @@
1
+ export interface Point {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ }
5
+ export interface Size {
6
+ readonly width: number;
7
+ readonly height: number;
8
+ }
9
+ export interface Bounds extends Point, Size {
10
+ }
11
+ export interface Matrix2D {
12
+ readonly a: number;
13
+ readonly b: number;
14
+ readonly c: number;
15
+ readonly d: number;
16
+ readonly e: number;
17
+ readonly f: number;
18
+ }
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/geometry/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,MAAO,SAAQ,KAAK,EAAE,IAAI;CAAG;AAE9C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB"}
@@ -0,0 +1,14 @@
1
+ import type { Annotator } from '../core/types.js';
2
+ import type { Point } from '../geometry/types.js';
3
+ import type { ImageSource } from './types.js';
4
+ export declare function setImageSource(annotator: Annotator, source: ImageSource): Promise<void>;
5
+ export declare function hasImage(annotator: Annotator): boolean;
6
+ export declare function getZoom(annotator: Annotator): number;
7
+ export declare function resizeViewport(annotator: Annotator): void;
8
+ export declare function fitToScreen(annotator: Annotator): void;
9
+ export declare function zoomTo(annotator: Annotator, scale: number, anchor?: Point): void;
10
+ export declare function zoomBy(annotator: Annotator, factor: number, anchor?: Point): void;
11
+ export declare function panBy(annotator: Annotator, delta: Point): void;
12
+ export declare function imageToClient(annotator: Annotator, point: Point): Point;
13
+ export declare function clientToImage(annotator: Annotator, point: Point): Point;
14
+ //# sourceMappingURL=image-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-commands.d.ts","sourceRoot":"","sources":["../../src/image/image-commands.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,sBAAsB,CAAA;AAUvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAkB7C,wBAAsB,cAAc,CAClC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAyCf;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEtD;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAEpD;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAKzD;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAStD;AAED,wBAAgB,MAAM,CACpB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,KAAK,GACb,IAAI,CAUN;AAED,wBAAgB,MAAM,CACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,KAAK,GACb,IAAI,CAGN;AAED,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAM9D;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAMvE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAQvE"}
@@ -0,0 +1,3 @@
1
+ import type { ImageSource, StandardImageInput } from './types.js';
2
+ export declare function createStandardImageSource(input: StandardImageInput): ImageSource;
3
+ //# sourceMappingURL=standard-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-source.d.ts","sourceRoot":"","sources":["../../src/image/standard-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EAEX,kBAAkB,EACnB,MAAM,YAAY,CAAA;AAsCnB,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,kBAAkB,GACxB,WAAW,CAkFb"}
@@ -0,0 +1,12 @@
1
+ export interface LoadedImage {
2
+ readonly source: CanvasImageSource;
3
+ readonly width: number;
4
+ readonly height: number;
5
+ }
6
+ export interface ImageSource {
7
+ readonly id: string;
8
+ readonly load: (signal: AbortSignal) => Promise<LoadedImage>;
9
+ readonly dispose: () => void;
10
+ }
11
+ export type StandardImageInput = string | Blob | ImageBitmap;
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/image/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAC7B;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,IAAI,GAAG,WAAW,CAAA"}