@servantcdh/ez-planet-labeling 0.3.2 → 0.4.0

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/dist/index.d.ts CHANGED
@@ -1,1419 +1,1031 @@
1
- import { Canvas } from 'fabric';
2
- import { fabric } from 'fabric';
3
- import { FabricObject } from 'fabric';
1
+ import { ComponentProps } from 'react';
4
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
5
3
  import { ReactNode } from 'react';
4
+ import { RefObject } from 'react';
6
5
  import { StoreApi } from 'zustand';
7
- import { TemporalState } from 'zundo';
8
6
  import { UseBoundStore } from 'zustand';
9
7
 
10
- export declare interface Annotation {
11
- /** Host app assigns this freely (DB PK, UUID, temp ID, etc.) */
12
- id: string;
13
- type: AnnotationType;
14
- label: AnnotationLabel;
15
- style: AnnotationStyle;
16
- geometry: AnnotationGeometry | null;
17
- }
18
-
19
- export declare type AnnotationGeometry = BoxGeometry | SegmentationGeometry | PolygonGeometry | BrushGeometry | RecognitionGeometry;
20
-
21
- export declare interface AnnotationLabel {
22
- name: string;
23
- index: number;
24
- }
8
+ /**
9
+ * Add fabric objects to the canvas.
10
+ * Extensions call this to render results (polygons, boxes, etc.).
11
+ */
12
+ export declare function addCanvasObjects(objects: unknown[]): void;
25
13
 
26
- export declare interface AnnotationStyle {
27
- color: string;
28
- opacity: number;
29
- lineColor?: string;
30
- lineWidth?: number;
31
- zIndex?: number;
14
+ export declare interface ApiResponse<T> {
15
+ code?: number;
16
+ message?: string;
17
+ data: T;
32
18
  }
33
19
 
34
20
  /**
35
- * Convert an Annotation back to Fabric object options (for canvas loading).
36
- * This creates the configuration that can be used with Fabric's enlivenObjects.
21
+ * AsyncData<T> a lightweight wrapper that mirrors the surface of
22
+ * react-query's UseQueryResult so that consumer components need zero
23
+ * changes when we swap the data source from react-query to host-provided
24
+ * context.
37
25
  */
38
- export declare const annotationToFabricProps: (annotation: Annotation, imageWidth: number, imageHeight: number) => Record<string, unknown>;
39
-
40
- export declare type AnnotationType = 'box' | 'segmentation' | 'polygon' | 'brush' | 'classification' | 'recognition';
41
-
42
- export declare const basicBrushes: {
43
- id: number;
44
- lineCap: string;
45
- lineWidth: number;
46
- }[];
47
-
48
- export declare const basicColors: string[];
49
-
50
- export declare const blankRectTool: () => LabelingTool;
51
-
52
- export declare interface BoxGeometry {
53
- type: 'box';
54
- /** Normalized coordinates (0~1 ratio, image-size independent) */
55
- x: number;
56
- y: number;
57
- width: number;
58
- height: number;
26
+ export declare interface AsyncData<T> {
27
+ data: T | undefined;
28
+ isLoading: boolean;
29
+ isFetching: boolean;
30
+ isError: boolean;
31
+ error: unknown;
32
+ refetch: () => void;
33
+ dataUpdatedAt: number;
59
34
  }
60
35
 
61
- export declare interface BrushGeometry {
62
- type: 'brush';
63
- /** SVG path or fabric path data */
64
- path: string;
36
+ declare interface Attribute {
37
+ name: string;
38
+ attributeType: "SELECT" | "CHECKBOX" | "TEXT";
39
+ values: string[];
40
+ placeholder?: string;
65
41
  }
66
42
 
67
- declare interface BrushOptions {
68
- lineCap: string;
69
- lineWidth: number;
43
+ export declare interface AttributeValue {
44
+ attributeType?: LabelAttributeType;
45
+ name?: string;
46
+ values?: string[];
70
47
  }
71
48
 
72
- declare interface BrushState {
73
- brush: {
74
- id: number;
75
- lineCap: string;
76
- lineWidth: number;
77
- };
78
- setBrush: (brush: {
79
- id: number;
80
- lineCap: string;
81
- lineWidth: number;
82
- }) => void;
49
+ declare interface AutoLabelingInfo {
50
+ modelId?: string;
51
+ externalModelId?: string;
52
+ scores?: Score[];
53
+ transactionId?: string;
54
+ containerId?: string;
55
+ status?: string;
56
+ inferenceType?: string;
57
+ threshold?: number;
83
58
  }
84
59
 
85
- export declare const brushTool: () => LabelingTool;
60
+ declare function Badge({ title, size, style }: BagdeType): JSX_2.Element;
86
61
 
87
- export declare type CanvasAction = {
88
- type: 'add';
89
- annotation: Annotation;
90
- } | {
91
- type: 'update';
92
- annotation: Annotation;
93
- prev: Annotation;
94
- } | {
95
- type: 'delete';
96
- id: string;
97
- } | {
98
- type: 'batch';
99
- added: Annotation[];
100
- updated: Annotation[];
101
- deleted: string[];
102
- };
62
+ declare type BadgeStyle = ComponentProps<typeof Badge>["style"];
103
63
 
104
- export declare interface CanvasChangeEvent {
105
- annotations: Annotation[];
106
- action: CanvasAction;
64
+ declare interface BagdeType extends UIType {
65
+ title: string;
66
+ style?: "primary" | "secondary" | "accent" | "primary-light" | "secondary-light" | "accent-light" | "blue";
107
67
  }
108
68
 
109
- declare interface CanvasExportJSON {
110
- version: string;
111
- objects: Record<string, unknown>[];
69
+ declare interface BaseInfoDTO {
70
+ contentSize?: number;
71
+ contentType?: string;
72
+ fileFormat?: string[];
73
+ isRequired?: boolean;
74
+ isPreset?: boolean;
75
+ isVisible?: boolean;
76
+ schemaId?: string;
77
+ schemaName?: string;
112
78
  }
113
79
 
114
- declare interface CanvasJSON {
115
- version: string;
116
- objects: LabeledFabricObject[];
80
+ declare interface BatchUpdateSummary {
81
+ deletedCount?: number;
82
+ insertedCount?: number;
83
+ updatedCount?: number;
84
+ totalProcessed?: number;
117
85
  }
118
86
 
119
- declare interface CanvasObjectsState {
120
- objects: LabeledFabricObject[];
121
- setObjects: (objects: LabeledFabricObject[]) => void;
87
+ export declare interface BoxValue {
88
+ className?: string;
89
+ classIndex?: number;
90
+ coord?: number[];
91
+ color?: string;
92
+ lineColor?: string;
93
+ opacity?: number;
94
+ zindex?: number;
122
95
  }
123
96
 
124
- export declare interface CanvasPointerEvent {
125
- x: number;
126
- y: number;
127
- shiftKey: boolean;
128
- ctrlKey: boolean;
129
- altKey: boolean;
97
+ declare interface BulkLabelCreateRequest {
98
+ labels: LabelInsertData[];
130
99
  }
131
100
 
132
- declare interface CanvasState_2 {
133
- annotations: Annotation[];
134
- canvasJSON: object;
135
- image: {
136
- width: number;
137
- height: number;
138
- };
101
+ declare interface BulkLabelCreateResponse {
102
+ labelContextId: string;
103
+ createdLabels: LabelResponse[];
139
104
  }
140
- export { CanvasState_2 as CanvasState }
141
105
 
142
- /**
143
- * Convert all canvas objects to Annotations.
144
- */
145
- export declare const canvasToAnnotations: (objects: LabeledFabricObject[], imageWidth: number, imageHeight: number) => Promise<Annotation[]>;
106
+ declare type ChartPivotMode = (typeof WORKSPACE_CHART_PIVOT_MODE)[keyof typeof WORKSPACE_CHART_PIVOT_MODE];
146
107
 
147
- declare interface ClassificationLabelEntry {
148
- tempId: string;
149
- labelId: string | null;
150
- policyId: string;
151
- classIndex: number;
152
- className: string;
153
- labelValue: unknown;
154
- attributeValues?: Record<string, unknown>;
108
+ export declare interface ChartValue {
109
+ className?: string;
110
+ classIndex?: number;
111
+ columnName?: string;
155
112
  color?: string;
156
113
  opacity?: number;
114
+ zindex?: number;
157
115
  }
158
116
 
159
- /**
160
- * Create an HTMLImageElement from a URL.
161
- */
162
- export declare const createImage: (src: string) => Promise<HTMLImageElement>;
163
-
164
- export declare const createTemporalHistoryStore: <T>() => UseBoundStore<Omit<StoreApi<TemporalHistoryState<T>>, "temporal"> & {
165
- temporal: StoreApi<TemporalState< {
166
- snapshot: T | null;
167
- }>>;
168
- }>;
169
-
170
- /**
171
- * Crop image data to the bounding box of non-transparent pixels.
172
- */
173
- export declare const cropAlphaArea: (imgData: ImageData) => {
174
- canvas: HTMLCanvasElement;
175
- minX: number;
176
- minY: number;
177
- };
178
-
179
- export declare const emitLabelEvent: (action: LabelEventType, data?: LabelEventData) => void;
180
-
181
- export declare const ensureCanvas: () => FabricCanvas;
182
-
183
- export declare const eraserTool: () => LabelingTool;
184
-
185
- export declare const EXCEPTION_TOOLS: string[];
186
-
187
- export declare const EXPORT_PROPS: string[];
188
-
189
- export declare interface ExtensionContext {
190
- image: {
191
- url: string;
192
- width: number;
193
- height: number;
194
- };
195
- annotations: Annotation[];
196
- selectedIds: string[];
197
- activeTool: string;
198
- addAnnotations: (annotations: Annotation[]) => void;
199
- updateAnnotation: (id: string, annotation: Partial<Annotation>) => void;
200
- removeAnnotations: (ids: string[]) => void;
201
- setTool: (tool: string) => void;
202
- canvas: {
203
- toJSON: () => object;
204
- getImageDataURL: () => string;
205
- };
117
+ export declare interface ClassificationValue {
118
+ classIndex?: number;
119
+ className?: string;
206
120
  }
207
121
 
208
- declare type FabricCanvas = Canvas & {
209
- lowerCanvasEl?: HTMLCanvasElement | null;
210
- upperCanvasEl?: HTMLCanvasElement | null;
211
- };
212
-
213
- /**
214
- * Convert a Fabric object to an Annotation.
215
- */
216
- export declare const fabricObjectToAnnotation: (object: LabeledFabricObject, imageWidth: number, imageHeight: number) => Promise<Annotation | null>;
217
-
218
- export declare interface FileContent {
219
- endpointUrl?: string;
220
- fileName?: string;
221
- fileType?: string;
122
+ declare interface ContentDTO {
123
+ accountId?: string;
124
+ contents?: Record<string, Array<Record<string, unknown>>>;
125
+ contentSetId?: string;
126
+ createdBy?: string;
127
+ createdDate?: string;
128
+ createdId?: string;
129
+ datasetId?: string;
130
+ id?: string;
131
+ modifiedBy?: string;
132
+ modifiedDate?: string;
133
+ modifiedId?: string;
134
+ orgId?: string;
135
+ summary?: Record<string, number>;
136
+ transactionId?: string;
137
+ version?: string | null;
138
+ zoneId?: string;
222
139
  }
223
140
 
224
- export declare interface FileUploadPayload {
225
- file: File;
226
- policyId: string;
141
+ export declare interface ContentsetStatus {
227
142
  contentSetId: string;
228
- elementId?: string;
143
+ totalCount?: number;
144
+ contentSetStatus?: ContentsetStatusState[];
145
+ contentsetStatus?: "NONE" | ContentsetStatusState;
146
+ schemas?: SchemaStatus[];
147
+ elements?: ElementStatus[];
229
148
  }
230
149
 
231
- export declare const filledRectTool: () => LabelingTool;
232
-
233
- /**
234
- * Format a tool name with its shortcut key for display.
235
- * e.g. formatShortcutTitle("Selection", "v") → "Selection (V)"
236
- */
237
- export declare function formatShortcutTitle(title: string, shortcutKey: string): string;
238
-
239
- export declare const getActiveLabeledObjects: (targetCanvas?: FabricCanvas) => LabeledFabricObject[];
240
-
241
- export declare const getCanvasInstance: () => FabricCanvas;
242
-
243
- export declare const getCanvasJSON: (targetCanvas?: FabricCanvas) => CanvasJSON;
244
-
245
- export declare const getImageToolStore: () => ImageToolState;
246
-
247
- export declare const getLabeledObjects: (targetCanvas?: FabricCanvas) => LabeledFabricObject[];
248
-
249
- /**
250
- * Normalize keyboard event to a shortcut key string.
251
- * Handles special cases like backslash.
252
- */
253
- export declare function getLabelingShortcutKey(event: KeyboardEvent): string;
254
-
255
- export declare const getToolSelectionStore: () => ToolSelectionState;
256
-
257
- export declare const getViewModeStore: () => ViewModeState;
258
-
259
- declare type IconSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
260
-
261
- declare interface ImageToolState {
262
- tool: LabelingTool | null;
263
- setTool: (tool: LabelingTool | null) => void;
264
- overedUniques: string[];
265
- setOveredUniques: (overedUniques: string[]) => void;
266
- undoStack: string[];
267
- redoStack: string[];
268
- setUndoStack: (undoStack: string[]) => void;
269
- setRedoStack: (redoStack: string[]) => void;
270
- toolHistory: string[];
271
- }
272
-
273
- declare interface IssuePanelState {
274
- isOpen: boolean;
275
- open: () => void;
276
- close: () => void;
277
- toggle: () => void;
278
- }
279
-
280
- declare interface KeyboardShortcutsConfig {
281
- viewMode: WorkspaceViewMode;
282
- isValidationMode: boolean;
283
- setTool: (toolType: ToolType) => void;
284
- onUndo?: () => void;
285
- onRedo?: () => void;
286
- disabled?: boolean;
287
- }
288
-
289
- declare interface LabelBatchState {
290
- classificationLabels: ClassificationLabelEntry[];
291
- classificationDeletedIds: string[];
292
- inserts: LabelInsertData[];
293
- updates: LabelUpdateData[];
294
- deletes: LabelDeleteData[];
295
- labelDataRevision: number;
296
- addClassificationLabel: (label: ClassificationLabelEntry) => void;
297
- removeClassificationLabel: (tempId: string) => void;
298
- removeClassificationLabelById: (labelId: string) => void;
299
- clearTemporaryClassificationLabels: () => void;
300
- clearPendingChanges: () => void;
301
- hasPendingChanges: () => boolean;
302
- bumpLabelDataRevision: () => void;
303
- reset: () => void;
150
+ export declare interface ContentsetStatusResponse {
151
+ labelContextId: string;
152
+ datasetId: string;
153
+ contentSets: ContentsetStatus[];
304
154
  }
305
155
 
306
- export declare interface LabelDeleteData {
307
- id: string;
308
- }
156
+ export declare type ContentsetStatusState = "IN_LABELING" | "COMPLETED" | "VALIDATION_COMPLETED" | "VALIDATION_ERROR";
309
157
 
310
- declare interface LabeledFabricObject extends FabricObject {
311
- info?: string;
312
- unique?: string;
313
- hex?: string;
314
- alpha?: string;
315
- selected?: boolean;
316
- class?: string;
317
- added?: boolean;
318
- index?: number;
319
- seq?: number;
320
- copied?: boolean;
321
- combinded?: boolean;
322
- labeler?: string;
323
- undo?: boolean;
324
- redo?: boolean;
325
- passStack?: boolean;
326
- replaced?: boolean;
327
- removed?: boolean;
328
- trueLeft?: number;
329
- trueTop?: number;
330
- toHex?: string;
331
- eraser?: unknown;
332
- labelType?: string;
333
- labelPayload?: Record<string, unknown>;
334
- _objects?: LabeledFabricObject[];
335
- labelInsertData?: Record<string, unknown>;
336
- [key: string]: unknown;
158
+ declare interface CustomPageWrapper<TItem, TFilter = unknown> {
159
+ list: TItem[];
160
+ totalCount: number;
161
+ filter: TFilter;
337
162
  }
338
163
 
339
- declare interface LabelEventData {
340
- uniques?: string[];
341
- unique?: string;
342
- selected?: boolean;
343
- objects?: LabeledFabricObject[];
344
- info?: string;
345
- canvasJSON?: CanvasExportJSON;
346
- seq?: Array<{
347
- unique: string;
348
- seq: number;
349
- }>;
350
- callback?: (json: CanvasExportJSON | string) => void;
351
- direction?: ZoomPayload['direction'];
352
- level?: number;
353
- onChange?: ZoomPayload['onChange'];
354
- class?: string;
355
- hex?: string;
356
- opacity?: number;
357
- onDone?: () => void;
358
- imageWidth?: number;
359
- imageHeight?: number;
360
- action?: string;
361
- point?: {
362
- x: number;
363
- y: number;
364
- };
365
- labelInsertData?: Record<string, unknown>;
366
- [key: string]: unknown;
164
+ export declare interface DatasetApiResponse<T> {
165
+ code: number;
166
+ message: string;
167
+ data: T;
367
168
  }
368
169
 
369
- declare type LabelEventListener = (action: LabelEventType, data?: LabelEventData) => void | Promise<void>;
370
-
371
- declare type LabelEventType = 'load' | 'selected' | 'deleted' | 'zoom' | 'copy' | 'paste' | 'deleteSelected' | 'selectAll' | 'reset' | 'combine' | 'seq' | 'addClass' | 'deleteObjectsOfTool' | 'addObjects' | 'deselectAll' | 'undo' | 'redo' | 'changed' | 'blur' | 'focus' | 'init';
170
+ export declare type DatasetContentRecord = ContentDTO;
372
171
 
373
- /**
374
- * Keyboard shortcut definitions matching portal-iris-web.
375
- */
376
- export declare const LABELING_SHORTCUTS: {
377
- readonly common: {
378
- readonly selection: "v";
379
- readonly layerToggle: "\\";
380
- readonly navigationToggle: "g";
381
- };
382
- readonly image: {
383
- readonly boundingBox: "u";
384
- readonly pen: "p";
385
- readonly brush: "b";
386
- readonly magicBrush: "w";
387
- readonly superpixel: "x";
388
- readonly eraser: "e";
389
- };
390
- readonly text: {
391
- readonly highlighting: "h";
392
- readonly autoHighlight: "a";
393
- };
394
- readonly number: {
395
- readonly highlighting: "h";
396
- };
397
- readonly validation: {
398
- readonly rangeSelection: "s";
399
- readonly issue: "i";
400
- };
401
- };
172
+ export declare interface DatasetContentSearchResponse {
173
+ filter?: Record<string, unknown>;
174
+ list: DatasetContentRecord[];
175
+ totalCount: number;
176
+ }
402
177
 
403
- export declare function LabelingCanvas({ image, annotations, onChange, readOnly, width, height, }: LabelingCanvasProps): JSX_2.Element;
178
+ declare type DatasetContentType = "IMAGE" | "CSV" | "TABLE" | "PDF" | "WORD" | "TABULAR" | "CUSTOM" | (string & {});
404
179
 
405
- declare interface LabelingCanvasProps {
406
- image: string | {
407
- url: string;
408
- width: number;
409
- height: number;
410
- };
411
- annotations: Annotation[];
412
- onChange?: (event: CanvasChangeEvent) => void;
413
- readOnly?: boolean;
414
- width?: number;
415
- height?: number;
416
- }
180
+ declare type DatasetContentVersion = string | null | undefined;
417
181
 
418
- export declare interface LabelingClass {
182
+ export declare interface DatasetDTO {
419
183
  id: string;
184
+ orgId: string;
185
+ zoneId: string;
186
+ accountId: string;
187
+ exist: boolean;
420
188
  name: string;
421
- color: string;
422
- hotkey?: string;
423
- group?: string;
189
+ latestVersion: string;
190
+ currentVersion: string | null;
191
+ records: string;
192
+ versionList: VersionDTO[];
193
+ isLock: boolean;
194
+ isEditing: boolean;
195
+ isArchMode: boolean;
196
+ tags: string[];
197
+ schema?: SchemaItemDTO[];
198
+ importTransactionId?: string;
199
+ createdId: string;
200
+ createdBy: string;
201
+ createdDate: string;
202
+ modifiedId: string;
203
+ modifiedBy: string;
204
+ modifiedDate: string;
205
+ schemaTypes: DatasetContentType[];
206
+ }
207
+
208
+ declare interface DetailTableCellSelection {
209
+ rowIndex: number;
210
+ columnId: string;
211
+ }
212
+
213
+ declare interface DetailTableRow {
214
+ [key: string]: string | undefined;
215
+ elementId?: string;
424
216
  }
425
217
 
426
- export declare interface LabelingContextValue {
427
- image: string | {
428
- url: string;
429
- width: number;
430
- height: number;
431
- };
432
- annotations: Annotation[];
433
- onChange: (event: CanvasChangeEvent) => void;
434
- viewMode: WorkspaceViewMode;
435
- onViewModeChange: (mode: WorkspaceViewMode) => void;
436
- availableViewModes: WorkspaceViewMode[];
437
- textContent?: TextContent;
438
- numberContent?: NumberContent;
439
- fileContent?: FileContent;
440
- records: WorkspaceRecord[];
441
- activeRecordId: string;
442
- onRecordSelect: (record: WorkspaceRecord) => void;
443
- classes: LabelingClass[];
444
- policies: LabelingPolicy[];
445
- onClassSelect?: (cls: LabelingClass) => void;
446
- selectedClassId: string | null;
447
- setSelectedClassId: (id: string | null) => void;
448
- selectedAnnotationId: string | null;
449
- setSelectedAnnotationId: (id: string | null) => void;
450
- onSave: (payload: SavePayload) => void | Promise<void>;
451
- onSaveToRecord?: () => void;
452
- onFileUpload?: (file: File) => void;
453
- isSaving: boolean;
454
- onNavigateLeft?: () => void;
455
- onNavigateRight?: () => void;
456
- canNavigateLeft: boolean;
457
- canNavigateRight: boolean;
458
- mode: WorkspaceMode;
459
- onModeChange?: (mode: WorkspaceMode) => void;
460
- validationResults: ValidationResult[];
461
- indicator?: WorkspaceIndicator;
462
- extensions: LabelingExtension[];
463
- tools: ToolType[];
464
- theme?: Partial<LabelingTheme>;
465
- layout: WorkspaceLayout;
466
- navDirection: 'horizontal' | 'vertical';
467
- setNavDirection: (dir: 'horizontal' | 'vertical') => void;
468
- navVisible: boolean;
469
- setNavVisible: (visible: boolean) => void;
218
+ declare interface ElementStatus {
219
+ elementId?: string;
220
+ inLabeling?: boolean;
221
+ /**
222
+ * New spec (OAS): elementStatus 배열로 상태를 내려줌
223
+ * - IN_LABELING / VALIDATION_ERROR / VALIDATION_COMPLETED
224
+ */
225
+ elementStatus?: ContentsetStatusState[];
226
+ policyStatuses?: PolicyLabelStatus[];
470
227
  }
471
228
 
472
- export declare interface LabelingExtension {
473
- id: string;
474
- slot: 'tool' | 'sidePanel' | 'toolbar';
475
- render: (context: ExtensionContext) => ReactNode;
476
- }
229
+ /** An error-state placeholder. */
230
+ export declare function errorData<T>(error: unknown): AsyncData<T>;
477
231
 
478
232
  /**
479
- * File labeling section.
480
- * Shows file info when a file exists, or an upload area when empty.
233
+ * Context object passed to every extension render function, giving it
234
+ * access to the current workspace state and canvas interaction.
481
235
  */
482
- export declare function LabelingFileSection({ content, readOnly, onFileUpload, }: LabelingFileSectionProps): JSX_2.Element;
236
+ export declare interface ExtensionRenderContext {
237
+ /** Currently selected content-set ID (null when nothing is selected). */
238
+ contentSetId: string | null;
239
+ /** Active label context ID. */
240
+ labelContextId: string | null;
241
+ /** Policy IDs used in the current labeling context. */
242
+ policyIds: string[];
243
+ /** Dataset ID. */
244
+ datasetId: string;
245
+ /** Dataset version. */
246
+ datasetVersion: string;
247
+ /**
248
+ * Call this after a mutation succeeds so the host can invalidate /
249
+ * refetch the appropriate caches.
250
+ */
251
+ requestDataRefresh: (hint: MutationSuccessHint) => void;
252
+ /** Ref to the fabric.Canvas instance (null when no image is loaded). */
253
+ canvasRef: RefObject<unknown | null>;
254
+ /** Current image dimensions and URL (null when no image is loaded). */
255
+ imageInfo: WorkspaceImageInfo | null;
256
+ /** Add fabric objects to the canvas. */
257
+ addCanvasObjects: (objects: unknown[]) => void;
258
+ /** Remove fabric objects matching a predicate from the canvas. */
259
+ removeCanvasObjects: (predicate: (obj: unknown) => boolean) => void;
260
+ }
261
+
262
+ declare interface FileLabelUploadRequest {
263
+ file: File;
264
+ contentSetId?: string;
265
+ elementId?: string;
266
+ policyId: string;
267
+ schemaName?: string;
268
+ }
483
269
 
484
- declare interface LabelingFileSectionProps {
485
- content?: FileContent;
486
- readOnly?: boolean;
487
- onFileUpload?: (file: File) => void;
270
+ export declare interface FileLabelUploadVariables {
271
+ labelContextId?: string | null;
272
+ labelContextRequest?: LabelContextCreateRequest;
273
+ body: FileLabelUploadRequest;
488
274
  }
489
275
 
490
- export declare function LabelingFloatingToolbar({ items, show, verticalNav, children, }: LabelingFloatingToolbarProps): JSX_2.Element | null;
276
+ export declare interface FileValue {
277
+ bucket?: string;
278
+ objectName?: string;
279
+ endpoint?: string;
280
+ fileName?: string;
281
+ [key: string]: unknown;
282
+ }
491
283
 
492
- declare interface LabelingFloatingToolbarProps {
493
- items: ToolbarItem[];
494
- show?: boolean;
495
- verticalNav?: boolean;
496
- children?: ReactNode;
284
+ declare interface FilterState {
285
+ filter: Record<string, unknown>;
286
+ setFilter: (patch: Record<string, unknown>) => void;
287
+ resetFilter: () => void;
497
288
  }
498
289
 
499
- export declare function LabelingIcon({ iconType, size, className, style, }: LabelingIconProps): JSX_2.Element | null;
290
+ export declare const getCanvasInstance: () => any;
500
291
 
501
- export declare type LabelingIconName = 'icon-selection' | 'icon-borderd-rect' | 'icon-pen' | 'icon-brush' | 'icon-eraser' | 'icon-magic-wand' | 'icon-superpixel' | 'icon-seg-anything' | 'icon-undo' | 'icon-redo' | 'icon-save' | 'icon-down' | 'icon-all-layer' | 'icon-bottom-layer' | 'icon-top-layer' | 'icon-plus' | 'icon-minus' | 'icon-left' | 'icon-right' | 'icon-issue' | 'icon-labeling' | 'icon-validated' | 'icon-cancel' | 'icon-highlight';
292
+ /** Idle mutation state (not pending, no error). */
293
+ export declare const IDLE_MUTATION: MutationState;
502
294
 
503
- declare interface LabelingIconProps {
504
- iconType: LabelingIconName;
505
- size?: IconSize;
506
- className?: string;
507
- style?: React.CSSProperties;
295
+ declare interface InLabelingStatusResponse {
296
+ inLabeling: boolean;
508
297
  }
509
298
 
510
- export declare function LabelingIndicator({ indicator }: LabelingIndicatorProps): JSX_2.Element | null;
299
+ export declare type LabelAttributeType = "SELECT" | "CHECKBOX" | "TEXT";
511
300
 
512
- declare interface LabelingIndicatorProps {
513
- indicator?: WorkspaceIndicator;
301
+ export declare interface LabelBatchUpdateRequest {
302
+ deletes?: LabelDeleteData[];
303
+ inserts?: LabelInsertData[];
304
+ updates?: LabelUpdateData[];
514
305
  }
515
306
 
516
- export declare function LabelingInfoPanel({ classes, annotations, selectedAnnotationId, onClassSelect, onAnnotationSelect, onAnnotationDelete, disabled, }: LabelingInfoPanelProps): JSX_2.Element;
517
-
518
- declare interface LabelingInfoPanelProps {
519
- classes: LabelingClass[];
520
- annotations: Annotation[];
521
- selectedAnnotationId?: string | null;
522
- onClassSelect?: (cls: LabelingClass) => void;
523
- onAnnotationSelect?: (annotation: Annotation) => void;
524
- onAnnotationDelete?: (annotationId: string) => void;
525
- disabled?: boolean;
307
+ export declare interface LabelBatchUpdateResponse {
308
+ deletedIds?: string[];
309
+ insertedLabels?: LabelResponse[];
310
+ updatedLabels?: LabelResponse[];
311
+ summary?: BatchUpdateSummary;
526
312
  }
527
313
 
528
- export declare function LabelingIssuePanel({ annotations, validationResults, selectedAnnotationId, onAnnotationSelect, onValidate, onValidationUpdate: _onValidationUpdate, onValidationDelete, }: LabelingIssuePanelProps): JSX_2.Element;
529
-
530
- declare interface LabelingIssuePanelProps {
531
- annotations: Annotation[];
532
- validationResults: ValidationResult[];
533
- selectedAnnotationId?: string | null;
534
- onAnnotationSelect?: (annotation: Annotation) => void;
535
- onValidate?: (event: ValidateEvent) => void | Promise<void>;
536
- onValidationUpdate?: (event: ValidationUpdateEvent) => void | Promise<void>;
537
- onValidationDelete?: (event: ValidationDeleteEvent) => void | Promise<void>;
314
+ export declare interface LabelBatchUpdateVariables {
315
+ labelContextId?: string | null;
316
+ labelContextRequest?: LabelContextCreateRequest;
317
+ labelContextUpdateRequest?: LabelContextUpdateRequest;
318
+ body: LabelBatchUpdateRequest;
538
319
  }
539
320
 
540
- export declare function LabelingNavigation({ records, activeRecordId, onRecordSelect, direction, onDirectionChange, hidden, }: LabelingNavigationProps): JSX_2.Element;
541
-
542
- declare interface LabelingNavigationProps {
543
- records: WorkspaceRecord[];
544
- activeRecordId: string;
545
- onRecordSelect: (record: WorkspaceRecord) => void;
546
- direction?: 'horizontal' | 'vertical';
547
- onDirectionChange?: (direction: 'horizontal' | 'vertical') => void;
548
- hidden?: boolean;
321
+ export declare interface LabelBulkCreateVariables {
322
+ labelContextId: string;
323
+ body: BulkLabelCreateRequest;
549
324
  }
550
325
 
551
- /**
552
- * Number/chart labeling section.
553
- * Renders a data table from source data. Chart rendering is delegated to the host
554
- * app or a future extension (canvas-based chart is complex and library-dependent).
555
- */
556
- export declare function LabelingNumberSection({ content, readOnly, segments, }: LabelingNumberSectionProps): JSX_2.Element;
557
-
558
- declare interface LabelingNumberSectionProps {
559
- content?: NumberContent;
560
- readOnly?: boolean;
561
- segments?: Array<{
562
- id: string;
563
- start: number;
564
- end: number;
565
- color: string;
566
- opacity?: number;
567
- }>;
326
+ export declare interface LabelContextCreateRequest {
327
+ datasetId: string;
328
+ datasetVersion: string | number;
329
+ policyIds: string[];
568
330
  }
569
331
 
570
- export declare interface LabelingPolicy {
571
- id: string;
572
- name: string;
573
- classes: LabelingClass[];
332
+ declare interface LabelContextEnableResponse {
333
+ enable: boolean;
574
334
  }
575
335
 
576
- export declare function LabelingProvider({ image, annotations, onChange, viewMode: viewModeProp, onViewModeChange: onViewModeChangeProp, availableViewModes, textContent, numberContent, fileContent, records, activeRecordId, onRecordSelect, classes, policies, onClassSelect, onSave, onSaveToRecord, onFileUpload, isSaving, onNavigateLeft, onNavigateRight, canNavigateLeft, canNavigateRight, mode, onModeChange, validationResults, indicator, extensions, tools, theme, layout, children, }: LabelingProviderProps): JSX_2.Element;
577
-
578
- declare interface LabelingProviderProps {
579
- image: string | {
580
- url: string;
581
- width: number;
582
- height: number;
583
- };
584
- annotations: Annotation[];
585
- onChange: (event: CanvasChangeEvent) => void;
586
- viewMode?: WorkspaceViewMode;
587
- onViewModeChange?: (mode: WorkspaceViewMode) => void;
588
- availableViewModes?: WorkspaceViewMode[];
589
- textContent?: TextContent;
590
- numberContent?: NumberContent;
591
- fileContent?: FileContent;
592
- records: WorkspaceRecord[];
593
- activeRecordId: string;
594
- onRecordSelect: (record: WorkspaceRecord) => void;
595
- classes: LabelingClass[];
596
- policies?: LabelingPolicy[];
597
- onClassSelect?: (cls: LabelingClass) => void;
598
- onSave: (payload: SavePayload) => void | Promise<void>;
599
- onSaveToRecord?: () => void;
600
- onFileUpload?: (file: File) => void;
601
- isSaving?: boolean;
602
- onNavigateLeft?: () => void;
603
- onNavigateRight?: () => void;
604
- canNavigateLeft?: boolean;
605
- canNavigateRight?: boolean;
606
- mode?: WorkspaceMode;
607
- onModeChange?: (mode: WorkspaceMode) => void;
608
- validationResults?: ValidationResult[];
609
- indicator?: WorkspaceIndicator;
610
- extensions?: LabelingExtension[];
611
- tools?: ToolType[];
612
- theme?: Partial<LabelingTheme>;
613
- layout?: WorkspaceLayout;
614
- children: ReactNode;
615
- }
336
+ export declare interface LabelContextResponse {
337
+ id: string;
338
+ datasetId: string;
339
+ datasetVersion?: string | number;
340
+ policyIds: string[];
341
+ enable?: boolean;
342
+ organizationId?: string;
343
+ accountId?: string;
344
+ zoneId?: string;
345
+ userId?: string;
346
+ inLabeling?: boolean;
347
+ isLabeled?: boolean;
348
+ createdBy?: string;
349
+ createdDate?: string;
350
+ modifiedBy?: string;
351
+ modifiedDate?: string;
352
+ }
353
+
354
+ export declare interface LabelContextUpdateRequest {
355
+ policyIds?: string[];
356
+ inLabeling?: boolean;
357
+ enable?: boolean;
358
+ }
359
+
360
+ export declare interface LabelContextUpdateVariables {
361
+ labelContextId: string;
362
+ body: LabelContextUpdateRequest;
363
+ }
364
+
365
+ declare interface LabelCopyRequest {
366
+ copyType: LabelCopyType;
367
+ sourcePolicyId?: string;
368
+ targetPolicyId?: string;
369
+ targetLabelContextId?: string;
370
+ targetPolicyIds?: string[];
371
+ sourceDatasetId?: string;
372
+ sourceDatasetVersion?: string;
373
+ }
374
+
375
+ declare interface LabelCopyResponse {
376
+ copyType?: LabelCopyType;
377
+ copiedCount?: number;
378
+ skippedCount?: number;
379
+ totalProcessedCount?: number;
380
+ copiedLabelIds?: string[];
381
+ message?: string;
382
+ sourcePolicyId?: string;
383
+ targetPolicyId?: string;
384
+ targetLabelContextId?: string;
385
+ sourceDatasetId?: string;
386
+ sourceDatasetVersion?: string;
387
+ }
388
+
389
+ declare type LabelCopyType = "POLICY" | "DATASET";
616
390
 
617
- /**
618
- * Text labeling section — renders text content with highlighted segments.
619
- * Users can select text to create new segments via mouseup events.
620
- */
621
- export declare function LabelingTextSection({ content, readOnly, segments, }: LabelingTextSectionProps): JSX_2.Element;
622
-
623
- declare interface LabelingTextSectionProps {
624
- content?: TextContent;
625
- readOnly?: boolean;
626
- segments?: Array<{
627
- id: string;
628
- start: number;
629
- end: number;
630
- color: string;
631
- opacity?: number;
632
- }>;
633
- }
634
-
635
- export declare interface LabelingTheme {
636
- primary: string;
637
- background: string;
638
- surface: string;
639
- border: string;
640
- text: string;
641
- textSecondary: string;
642
- hover: string;
643
- primaryLight: string;
644
- fontFamily: string;
645
- radius: number;
646
- spacing: {
647
- sm: number;
648
- md: number;
649
- lg: number;
650
- };
391
+ export declare interface LabelDeleteData {
392
+ id: string;
651
393
  }
652
394
 
653
- declare interface LabelingTool {
395
+ export declare interface LabelDetailResponse {
654
396
  id: string;
655
- init: (...args: any[]) => Promise<(() => void) | void | undefined> | (() => void) | void;
397
+ labelContextId: string;
398
+ contentId?: string;
399
+ contentSetId?: string;
400
+ elementId?: string;
401
+ policyId: string;
402
+ schemaName?: string;
403
+ isLabeled?: boolean;
404
+ organizationId?: string;
405
+ accountId?: string;
406
+ zoneId?: string;
407
+ userId?: string;
408
+ autoLabelingInfo?: AutoLabelingInfo;
409
+ inferenceType?: LabelInferenceType;
410
+ labelType?: LabelType;
411
+ unitType?: LabelUnitType;
412
+ labelValue?: LabelValue;
413
+ attributeValues?: AttributeValue[];
414
+ modifiedBy?: string;
415
+ modifiedDate?: string;
416
+ createdBy?: string;
417
+ createdDate?: string;
418
+ }
419
+
420
+ export declare type LabelInferenceType = "CLASSIFICATION" | "OBJECT_DETECTION" | "SEGMENTATION" | "RECOGNITION";
421
+
422
+ declare const LABELING_RECORDS_CELL_ACCESSORIES_SYMBOL: unique symbol;
423
+
424
+ export declare interface LabelingApiHeaders {
425
+ orgId?: string;
426
+ zoneId?: string;
427
+ accountId?: string;
428
+ userId?: string;
429
+ userName?: string;
656
430
  }
657
431
 
658
432
  /**
659
- * Floating toolbar that renders view-mode-aware tools via useLabelingUIMeta.
660
- * Tool set, icons, and behavior all come from the UIMeta hooks.
433
+ * Data that the host feeds into the labeling workspace.
434
+ * Each field mirrors one of the former react-query hooks.
661
435
  */
662
- export declare function LabelingToolbar({ children }: LabelingToolbarInternalProps): JSX_2.Element;
663
-
664
- declare interface LabelingToolbarInternalProps {
665
- children?: ReactNode;
666
- }
667
-
668
- declare interface LabelingUIMetaResult {
669
- toolbar: ToolbarItemMeta[];
436
+ export declare interface LabelingDataContextValue {
437
+ policiesBatch: AsyncData<PolicyDetail[]>;
438
+ labelContext: AsyncData<LabelContextResponse>;
439
+ labelContextStatus: AsyncData<ContentsetStatusResponse>;
440
+ labelContextInLabeling: AsyncData<InLabelingStatusResponse>;
441
+ labelContextEnable: AsyncData<LabelContextEnableResponse>;
442
+ labelSearch: AsyncData<LabelSearchResult>;
443
+ previousLabelContexts: AsyncData<PreviousLabelContextWithLabelsResponse[]>;
444
+ validResultSearch: AsyncData<ValidResultSearchResult>;
445
+ }
446
+
447
+ export declare interface LabelingDatasetCellReference {
448
+ datasetId: string;
449
+ version: string;
450
+ contentSetId: string;
451
+ schemaNames: string[];
452
+ schemaLabel: string;
453
+ contentType: string;
454
+ isRequired: boolean;
455
+ maxItems: number | string | null;
456
+ showIntProps?: boolean;
670
457
  }
671
458
 
672
459
  /**
673
- * Level 1: All-in-one labeling workspace.
674
- * Renders WorkspaceControl + Navigation + WorkspaceSection + FloatingToolbar + InfoPanel.
460
+ * Dataset-related data the host feeds into the labeling workspace.
461
+ * Separated from LabelingDataContext because it changes at a different
462
+ * frequency (on record selection vs. on every label operation).
675
463
  */
676
- export declare function LabelingWorkspace(props: LabelingWorkspaceProps): JSX_2.Element;
677
-
678
- export declare function LabelingWorkspaceControl({ viewMode, onViewModeChange, availableViewModes, mode, onModeChange, onSave, onSaveToRecord, isSaving, onNavigateLeft, onNavigateRight, canNavigateLeft, canNavigateRight, }: LabelingWorkspaceControlProps): JSX_2.Element;
679
-
680
- declare interface LabelingWorkspaceControlProps {
681
- viewMode: WorkspaceViewMode;
682
- onViewModeChange?: (mode: WorkspaceViewMode) => void;
683
- availableViewModes?: WorkspaceViewMode[];
684
- mode?: WorkspaceMode;
685
- onModeChange?: (mode: WorkspaceMode) => void;
686
- onSave?: () => void;
687
- onSaveToRecord?: () => void;
688
- isSaving?: boolean;
689
- onNavigateLeft?: () => void;
690
- onNavigateRight?: () => void;
691
- canNavigateLeft?: boolean;
692
- canNavigateRight?: boolean;
693
- }
694
-
695
- export declare interface LabelingWorkspaceProps {
696
- image: string | {
697
- url: string;
698
- width: number;
699
- height: number;
700
- };
701
- annotations: Annotation[];
702
- onChange: (event: CanvasChangeEvent) => void;
703
- viewMode?: WorkspaceViewMode;
704
- onViewModeChange?: (mode: WorkspaceViewMode) => void;
705
- availableViewModes?: WorkspaceViewMode[];
706
- textContent?: TextContent;
707
- numberContent?: NumberContent;
708
- fileContent?: FileContent;
709
- records: WorkspaceRecord[];
710
- activeRecordId: string;
711
- onRecordSelect: (record: WorkspaceRecord) => void;
712
- onDetailExpand?: (record: WorkspaceRecord, schemaLabel: string) => void;
713
- totalRecords?: number;
714
- onPageChange?: (page: number) => void;
715
- classes: LabelingClass[];
716
- policies?: LabelingPolicy[];
717
- onClassSelect?: (cls: LabelingClass) => void;
718
- onSave: (payload: SavePayload) => void | Promise<void>;
719
- onSaveToRecord?: (payload: SaveToRecordPayload) => void | Promise<void>;
720
- onFileUpload?: (payload: FileUploadPayload) => void | Promise<void>;
721
- isSaving?: boolean;
722
- onNavigateLeft?: () => void;
723
- onNavigateRight?: () => void;
724
- canNavigateLeft?: boolean;
725
- canNavigateRight?: boolean;
726
- mode?: WorkspaceMode;
727
- onModeChange?: (mode: WorkspaceMode) => void;
728
- validationResults?: ValidationResult[];
729
- onValidate?: (event: ValidateEvent) => void | Promise<void>;
730
- onValidationUpdate?: (event: ValidationUpdateEvent) => void | Promise<void>;
731
- onValidationDelete?: (event: ValidationDeleteEvent) => void | Promise<void>;
732
- onSaveValidation?: (payload: SaveValidationPayload) => void | Promise<void>;
733
- indicator?: WorkspaceIndicator;
734
- extensions?: LabelingExtension[];
735
- tools?: ToolType[];
736
- theme?: Partial<LabelingTheme>;
737
- layout?: WorkspaceLayout;
738
- isDirty?: boolean;
739
- dirtyConfirmMessage?: string;
464
+ export declare interface LabelingDatasetContextValue {
465
+ datasetDetail: AsyncData<DatasetDTO>;
466
+ datasetContents: AsyncData<DatasetApiResponse<DatasetContentSearchResponse>>;
467
+ datasetContentDetail: AsyncData<DatasetContentRecord | null>;
740
468
  }
741
469
 
742
470
  /**
743
- * View-mode switching container.
744
- * Shows the appropriate content section based on the current view mode.
471
+ * A pluggable extension that the host registers to add optional
472
+ * features (e.g. SAM, Automated Labeling) to the labeling workspace.
473
+ *
474
+ * The library provides render slots only — the host owns all UI and logic.
745
475
  */
746
- export declare function LabelingWorkspaceSection({ viewMode, image, annotations, onChange, readOnly, textContent, numberContent, fileContent, onFileUpload, children, }: LabelingWorkspaceSectionProps): JSX_2.Element;
747
-
748
- declare interface LabelingWorkspaceSectionProps {
749
- viewMode: WorkspaceViewMode;
750
- image: string | {
751
- url: string;
752
- width: number;
753
- height: number;
754
- };
755
- annotations: Annotation[];
756
- onChange?: (event: CanvasChangeEvent) => void;
757
- readOnly?: boolean;
758
- textContent?: TextContent;
759
- numberContent?: NumberContent;
760
- fileContent?: FileContent;
761
- onFileUpload?: (file: File) => void;
762
- children?: ReactNode;
763
- }
764
-
765
- export declare interface LabelInsertData {
766
- policyId: string;
767
- classIndex: number;
768
- className: string;
769
- labelValue: unknown;
770
- attributeValues?: Record<string, unknown>;
771
- }
772
-
773
- declare interface LabelSelectionState {
774
- selectedClassificationId: string | null;
775
- selectedClassificationInfo: SelectedClassificationInfo | null;
776
- setSelectedClassificationId: (id: string | null, info?: SelectedClassificationInfo | null) => void;
777
- }
778
-
779
- export declare interface LabelUpdateData extends LabelInsertData {
476
+ export declare interface LabelingExtension {
477
+ /** Unique identifier for this extension. */
780
478
  id: string;
479
+ /** Human-readable name. */
480
+ name: string;
481
+ /** Set to false to disable the extension without removing it. */
482
+ enabled?: boolean;
483
+ /**
484
+ * Renders action buttons / sections inside the InfoPanel.
485
+ * The returned node is placed at the bottom of the InfoPanel, after the
486
+ * label lists and before the issue panel toggle.
487
+ */
488
+ renderInfoPanelAction?: (ctx: ExtensionRenderContext) => ReactNode;
489
+ /**
490
+ * Renders a floating overlay on top of the workspace (e.g. a modal).
491
+ * Rendered at the root level so it can use portals / z-index freely.
492
+ */
493
+ renderOverlay?: (ctx: ExtensionRenderContext) => ReactNode;
494
+ /**
495
+ * Renders an additional tool button in the floating toolbar.
496
+ * Use this for canvas-based tools (e.g. SAM point/box input).
497
+ */
498
+ renderToolbarAction?: (ctx: ExtensionRenderContext) => ReactNode;
499
+ }
500
+
501
+ export declare interface LabelingMutationContextValue {
502
+ batchUpdateLabels: (vars: LabelBatchUpdateVariables) => Promise<LabelBatchUpdateResponse>;
503
+ batchUpdateLabelsState: MutationState;
504
+ bulkCreateLabels: (vars: LabelBulkCreateVariables) => Promise<BulkLabelCreateResponse>;
505
+ bulkCreateLabelsState: MutationState;
506
+ createLabelContext: (body: LabelContextCreateRequest) => Promise<LabelContextResponse>;
507
+ createLabelContextState: MutationState;
508
+ updateLabelContext: (vars: LabelContextUpdateVariables) => Promise<LabelContextResponse>;
509
+ updateLabelContextState: MutationState;
510
+ createLabelStatus: (body: LabelStatusCreateRequest) => Promise<ApiResponse<LabelStatusResponse>>;
511
+ createLabelStatusState: MutationState;
512
+ uploadFileLabel: (vars: FileLabelUploadVariables) => Promise<LabelResponse>;
513
+ uploadFileLabelState: MutationState;
514
+ copyLabels: (body: LabelCopyRequest) => Promise<LabelCopyResponse>;
515
+ copyLabelsState: MutationState;
516
+ createValidResult: (body: ValidResultCreateRequest) => Promise<ValidResultResponse>;
517
+ createValidResultState: MutationState;
518
+ updateValidResult: (vars: ValidResultUpdateVariables) => Promise<ValidResultResponse>;
519
+ updateValidResultState: MutationState;
520
+ bulkDeleteValidResults: (body: ValidResultBulkDeleteRequest) => Promise<ValidResultBulkDeleteResponse>;
521
+ bulkDeleteValidResultsState: MutationState;
522
+ /**
523
+ * Called by the library after a successful mutation.
524
+ * The host should use the hint to invalidate / refetch the right caches.
525
+ */
526
+ onMutationSuccess: (hint: MutationSuccessHint) => void;
781
527
  }
782
528
 
783
- declare interface LabelVisibilityState {
784
- hiddenClassificationIds: Record<string, boolean>;
785
- setClassificationVisibility: (labelId: string, hidden: boolean) => void;
786
- reset: () => void;
787
- }
788
-
789
- export declare const LAYER_MODE: Record<string, LayerMode>;
790
-
791
- declare type LayerMode = [number, number] | [number];
529
+ /**
530
+ * Composite provider that wraps the three labeling contexts.
531
+ *
532
+ * Usage (host app):
533
+ * ```tsx
534
+ * <LabelingProviders data={dataCtx} mutations={mutationCtx} dataset={datasetCtx}>
535
+ * <LabelingWorkspace />
536
+ * </LabelingProviders>
537
+ * ```
538
+ */
539
+ export declare function LabelingProviders({ data, mutations, dataset, children, }: LabelingProvidersProps): JSX_2.Element;
792
540
 
793
- declare interface LayerModeState {
794
- mode: LayerMode;
795
- setMode: (mode: LayerMode) => void;
796
- cycleMode: () => void;
541
+ export declare interface LabelingProvidersProps {
542
+ data: LabelingDataContextValue;
543
+ mutations: LabelingMutationContextValue;
544
+ dataset: LabelingDatasetContextValue;
545
+ children: React.ReactNode;
797
546
  }
798
547
 
799
- declare type LayoutDirection = 'horizontal' | 'vertical';
800
-
801
- export declare const loadFabric: () => Promise<fabric>;
802
-
803
- export declare const magicbrushTool: () => LabelingTool;
804
-
805
- export declare interface NavigationCellAccessories {
806
- badges?: NavigationCellBadge[];
548
+ declare interface LabelingRecordsCellAccessories {
549
+ badges?: LabelingRecordsCellBadge[];
807
550
  hasIssue?: boolean;
808
551
  hasValidationCompleted?: boolean;
809
552
  }
810
553
 
811
- export declare interface NavigationCellBadge {
554
+ declare type LabelingRecordsCellAccessoriesMap = Record<string, LabelingRecordsCellAccessories>;
555
+
556
+ declare interface LabelingRecordsCellBadge {
812
557
  title: string;
813
- style: 'primary-light' | 'secondary-light';
558
+ style: BadgeStyle;
814
559
  }
815
560
 
816
- export declare interface NavigationDetailData {
817
- rows: Record<string, unknown>[];
818
- columns?: string[];
561
+ export declare interface LabelingRecordSelection {
562
+ datasetId: string | null;
563
+ record: DatasetContentRecord;
564
+ displayRow: LabelingRecordsTableRow;
565
+ schemaEntries: LabelingSchemaEntry[];
566
+ schemaNameToContentType: Record<string, string>;
567
+ accessories?: LabelingRecordsCellAccessoriesMap;
568
+ detailReference?: LabelingDatasetCellReference;
569
+ rowIndex: number;
570
+ rowId: string;
819
571
  }
820
572
 
821
- export declare interface NavigationSchema {
573
+ declare type LabelingRecordsTableRow = VirtualizedRecordsTableRow & {
574
+ [LABELING_RECORDS_CELL_ACCESSORIES_SYMBOL]?: LabelingRecordsCellAccessoriesMap;
575
+ };
576
+
577
+ export declare interface LabelingSchemaEntry {
822
578
  label: string;
579
+ summaryKeys: string[];
580
+ detailSchemaNames: string[];
823
581
  contentType: string;
824
582
  isRequired: boolean;
825
- maxItems?: number | null;
583
+ maxItems: number | string | null;
584
+ schema?: SchemaItemDTO;
826
585
  }
827
586
 
828
- export declare interface NumberContent {
829
- mode: 'line' | 'bar';
830
- xAxis: {
831
- label: string;
832
- ticks: unknown[];
833
- };
834
- yAxis: {
835
- label: string;
836
- series: unknown[];
837
- };
838
- source: {
839
- rows: unknown[];
840
- columns: unknown[];
841
- };
842
- canRender: boolean;
843
- }
844
-
845
- declare interface NumberLabelingTool {
846
- id: 'selection' | 'drag-segment';
847
- label: string;
848
- }
587
+ export declare function LabelingWorkspace({ extensions, }: LabelingWorkspaceProps): JSX_2.Element;
849
588
 
850
- declare interface NumberSegmentSelection {
851
- key: string;
852
- labelId: string | null;
853
- tempId: string | null;
854
- start: number;
855
- end: number;
856
- color?: string;
857
- opacity?: number;
589
+ export declare interface LabelingWorkspaceProps {
590
+ extensions?: LabelingExtension[];
858
591
  }
859
592
 
860
- declare interface NumberSegmentSelectionState {
861
- selectedSegment: NumberSegmentSelection | null;
862
- setSelectedSegment: (segment: NumberSegmentSelection | null) => void;
593
+ export declare interface LabelInsertData {
594
+ contentSetId?: string;
595
+ elementId?: string;
596
+ policyId: string;
597
+ schemaName?: string;
598
+ inferenceType?: LabelInferenceType;
599
+ /**
600
+ * labelType 설명
601
+ * inferenceType classification 전용
602
+ * 파일 업로드 기반 라벨 > FILE
603
+ * 차트(Number) 기반 라벨 > TABLE
604
+ * 그외 타입의 엘레멘트 단위 or 레코드 단위 라벨 > 사용 안함
605
+ */
606
+ labelType?: LabelType;
607
+ /**
608
+ * unitType 설명
609
+ * 엘레멘트 단위 > ELEMENT
610
+ * 레코드 단위 > CONTENTSET
611
+ */
612
+ unitType?: LabelUnitType;
613
+ labelValue?: LabelValue;
614
+ attributeValues?: AttributeValue[];
615
+ isLabeled?: boolean;
616
+ }
617
+
618
+ declare type LabelOrderDirection = "ASC" | "DESC" | "asc" | "desc";
619
+
620
+ export declare interface LabelResponse extends LabelDetailResponse {
621
+ version: DatasetContentVersion;
622
+ }
623
+
624
+ export declare interface LabelSearchRequest {
625
+ labelContextId: SearchOperatorFilter<string>;
626
+ contentSetId?: SearchOperatorFilter<string>;
627
+ elementId?: SearchOperatorFilter<string>;
628
+ unitType?: SearchOperatorFilter<LabelUnitType>;
629
+ orderBy?: Record<string, LabelOrderDirection>;
630
+ pageNumber?: number;
631
+ pageSize?: number;
632
+ }
633
+
634
+ export declare type LabelSearchResult = CustomPageWrapper<LabelDetailResponse, LabelSearchRequest>;
635
+
636
+ declare interface LabelStatusCreateRequest {
637
+ labelContextId: string;
638
+ contentSetId: string;
639
+ elementId: string;
640
+ isLabeling?: boolean;
863
641
  }
864
642
 
865
- declare interface NumberToolState {
866
- tool: NumberLabelingTool | null;
867
- setTool: (tool: NumberLabelingTool | null) => void;
643
+ declare interface LabelStatusResponse {
644
+ id: string;
645
+ labelContextId: string;
646
+ contentSetId: string;
647
+ elementId: string;
648
+ isLabeling?: boolean;
649
+ organizationId?: string;
650
+ accountId?: string;
651
+ zoneId?: string;
652
+ userId?: string;
653
+ createdBy?: string;
654
+ createdDate?: string;
868
655
  }
869
656
 
870
- export declare type NumberToolType = 'selection' | 'drag-segment';
657
+ export declare type LabelType = "FILE" | "TABLE";
871
658
 
872
- declare interface OpacityState {
873
- opacity: number;
874
- setOpacity: (opacity: number) => void;
875
- }
659
+ export declare type LabelUnitType = "CONTENTSET" | "ELEMENT";
876
660
 
877
- declare interface PaletteState {
878
- colorCode: string;
879
- setColorCode: (colorCode: string) => void;
661
+ export declare interface LabelUpdateData extends LabelInsertData {
662
+ id: string;
880
663
  }
881
664
 
882
- export declare interface PolygonGeometry {
883
- type: 'polygon';
884
- /** Normalized vertex coordinates */
885
- points: Array<{
886
- x: number;
887
- y: number;
888
- }>;
889
- }
665
+ export declare type LabelValue = ClassificationValue | BoxValue | SegmentationResponseValue | SegmentationBase64Value | ChartValue | RecognitionValue | FileValue | unknown;
890
666
 
891
- export declare const polygonTool: () => LabelingTool;
667
+ /** A loading-state placeholder. */
668
+ export declare function loadingData<T>(): AsyncData<T>;
892
669
 
893
- export declare interface RecognitionGeometry {
894
- type: 'recognition';
895
- start: number;
896
- end: number;
897
- text?: string;
670
+ /**
671
+ * Mutation state — tracks the status of a single mutation call.
672
+ */
673
+ export declare interface MutationState {
674
+ isPending: boolean;
675
+ isError: boolean;
676
+ error: unknown;
898
677
  }
899
678
 
900
- export declare type RecordStatus = 'unlabeled' | 'labeled' | 'validated' | 'issue';
901
-
902
- export declare const renderAllSafe: (targetCanvas?: FabricCanvas) => void;
903
-
904
- export declare interface SavePayload {
905
- viewMode: WorkspaceViewMode;
906
- inserts: LabelInsertData[];
907
- updates: LabelUpdateData[];
908
- deletes: LabelDeleteData[];
909
- canvasJSON?: object;
910
- imageSize?: {
911
- width: number;
912
- height: number;
913
- };
914
- }
679
+ /**
680
+ * Hint the library sends to the host after a successful mutation so
681
+ * the host can invalidate / refetch the appropriate caches.
682
+ */
683
+ export declare type MutationSuccessHint = {
684
+ type: "labels-saved";
685
+ labelContextId: string | null;
686
+ } | {
687
+ type: "labels-copied";
688
+ } | {
689
+ type: "labels-bulk-created";
690
+ labelContextId: string;
691
+ } | {
692
+ type: "label-context-created";
693
+ labelContextId: string;
694
+ } | {
695
+ type: "label-context-updated";
696
+ labelContextId: string;
697
+ } | {
698
+ type: "label-status-created";
699
+ } | {
700
+ type: "valid-result-created";
701
+ } | {
702
+ type: "valid-result-updated";
703
+ } | {
704
+ type: "valid-results-deleted";
705
+ } | {
706
+ type: "file-uploaded";
707
+ labelContextId: string;
708
+ };
915
709
 
916
- export declare interface SaveToRecordPayload {
917
- contentSetId: string;
918
- labels: LabelInsertData[];
710
+ export declare interface PolicyClass {
711
+ name: string;
712
+ color: string;
713
+ opacity?: number;
714
+ index?: number;
715
+ attributes?: Attribute[] | null;
919
716
  }
920
717
 
921
- export declare interface SaveValidationPayload {
922
- result: boolean;
923
- reason?: string;
924
- labelIds: string[];
718
+ export declare interface PolicyDetail {
719
+ id: string;
720
+ basePolicyId: string;
721
+ version: string;
722
+ baseVersion: string;
723
+ name: string;
724
+ exist: boolean;
725
+ classes: PolicyClass[];
726
+ elements?: string[];
727
+ tags?: string[];
728
+ versions: Version[];
729
+ zoneId: string;
730
+ organizationId: string;
731
+ accountId: string;
732
+ userId: string;
733
+ createdBy: string;
734
+ createdDate: string;
735
+ modifiedBy: string;
736
+ modifiedDate: string;
737
+ copyLabel?: boolean;
738
+ }
739
+
740
+ declare interface PolicyLabelStatus {
741
+ policyId?: string;
742
+ labelId?: string;
743
+ status?: ContentsetStatusState[];
744
+ hasValidationError?: boolean;
745
+ }
746
+
747
+ declare interface PreviousLabelContextWithLabelsResponse {
748
+ id: string;
749
+ datasetId: string;
750
+ datasetVersion: string;
751
+ policyIds: string[];
752
+ createdBy?: string;
753
+ createdDate?: string;
754
+ modifiedBy?: string;
755
+ modifiedDate?: string;
925
756
  }
926
757
 
927
- export declare const segmentAnythingTool: () => LabelingTool;
928
-
929
- export declare interface SegmentationGeometry {
930
- type: 'segmentation';
931
- /** Base64 PNG mask */
932
- mask: string;
933
- /** Fabric object vector for restoration (optional) */
934
- vector?: string;
758
+ export declare interface RecognitionValue {
759
+ className?: string;
760
+ classIndex?: number;
761
+ start?: number;
762
+ end?: number;
763
+ text?: string;
764
+ color?: string;
765
+ opacity?: number;
766
+ zindex?: number;
935
767
  }
936
768
 
937
- declare interface SelectedClassificationInfo {
938
- policyId?: string | null;
939
- classIndex?: number | null;
940
- className?: string | null;
941
- labelId?: string | null;
942
- tempId?: string | null;
943
- isCanvasFocused?: boolean;
944
- }
769
+ /**
770
+ * Remove fabric objects matching a predicate from the canvas.
771
+ * Extensions call this to clean up their objects.
772
+ */
773
+ export declare function removeCanvasObjects(predicate: (obj: unknown) => boolean): void;
945
774
 
946
- declare interface SelectedObjectsState {
947
- objects: LabeledFabricObject[];
948
- setObjects: (objects: LabeledFabricObject[]) => void;
775
+ export declare interface SchemaItemDTO {
776
+ baseInfo: BaseInfoDTO;
777
+ properties: Record<string, unknown>;
949
778
  }
950
779
 
951
- export declare const selectionTool: () => LabelingTool;
952
-
953
- export declare const setCanvasInstance: (instance: FabricCanvas | null) => void;
954
-
955
- export declare const setMagicBrushModule: (module: any) => void;
956
-
957
- export declare const setSuperpixelModules: (modules: {
958
- SLIC: any;
959
- MagicBrush: any;
960
- }) => void;
961
-
962
- export declare const subscribeLabelEvents: (listener: LabelEventListener) => () => void;
963
-
964
- export declare const superpixelTool: () => LabelingTool;
965
-
966
- declare interface TemporalHistoryState<T> {
967
- snapshot: T | null;
968
- setSnapshot: (snapshot: T) => void;
969
- reset: () => void;
780
+ declare interface SchemaStatus {
781
+ name?: string;
782
+ totalCount?: number;
783
+ elements?: ElementStatus[];
970
784
  }
971
785
 
972
- declare interface TextAutoHighlightState {
973
- english: boolean;
974
- number: boolean;
975
- special: boolean;
976
- setEnglish: (value: boolean) => void;
977
- setNumber: (value: boolean) => void;
978
- setSpecial: (value: boolean) => void;
979
- reset: () => void;
786
+ declare interface Score {
787
+ className?: string;
788
+ score?: number;
789
+ [key: string]: unknown;
980
790
  }
981
791
 
982
- export declare interface TextContent {
983
- value: string;
984
- elementId?: string;
792
+ declare interface SearchOperatorFilter<TValue> {
793
+ operator: string;
794
+ value: TValue;
985
795
  }
986
796
 
987
- declare interface TextLabelingTool {
988
- id: 'selection' | 'drag-segment';
989
- label: string;
797
+ export declare interface SegmentationBase64Value {
798
+ className?: string;
799
+ classIndex?: number;
800
+ segColor?: string;
801
+ segOrder?: number;
802
+ segOpacity?: number;
803
+ segBuffer: string;
804
+ segVector?: string;
805
+ segContentType?: string;
990
806
  }
991
807
 
992
- declare interface TextSegmentSelection {
993
- key: string;
994
- labelId: string | null;
995
- tempId: string | null;
996
- start: number;
997
- end: number;
998
- text: string;
808
+ export declare interface SegmentationResponseValue {
809
+ className?: string;
810
+ classIndex?: number;
811
+ bucket?: string;
812
+ objectName?: string;
813
+ endpoint?: string;
814
+ segVector?: string;
815
+ segColor?: string;
816
+ segOrder?: number;
817
+ segOpacity?: number;
999
818
  color?: string;
1000
819
  opacity?: number;
820
+ zindex?: number;
1001
821
  }
1002
822
 
1003
- declare interface TextSegmentSelectionState {
1004
- selectedSegment: TextSegmentSelection | null;
1005
- setSelectedSegment: (segment: TextSegmentSelection | null) => void;
1006
- }
823
+ /** Wrap an already-resolved value as AsyncData (no loading, no error). */
824
+ export declare function staticData<T>(data: T): AsyncData<T>;
1007
825
 
1008
- declare interface TextToolState {
1009
- tool: TextLabelingTool | null;
1010
- setTool: (tool: TextLabelingTool | null) => void;
826
+ declare interface UIType<TSize extends string = "xs" | "sm" | "md" | "lg" | "xl", TStyle extends string = string> {
827
+ size?: TSize;
828
+ style?: TStyle;
1011
829
  }
1012
830
 
1013
- export declare type TextToolType = 'selection' | 'drag-segment';
1014
-
1015
- export declare const toHex: (color: string) => {
1016
- hex: string;
1017
- alpha: string;
1018
- };
1019
-
1020
- export declare const TOOL_INFO_BOUNDED_BOX = "Bounded Box";
1021
-
1022
- export declare const TOOL_INFO_BRUSH = "Brush";
1023
-
1024
- export declare const TOOL_INFO_COMBINED_LABELS = "Combined Label";
1025
-
1026
- export declare const TOOL_INFO_ERASER = "Eraser";
831
+ export declare const useFilterStore: UseBoundStore<StoreApi<FilterState>>;
1027
832
 
1028
- export declare const TOOL_INFO_FILLED_BOX = "Filled Box";
833
+ export declare const useWorkspaceNavigationDetailSelectionStore: UseBoundStore<StoreApi<WorkspaceNavigationDetailSelectionState>>;
1029
834
 
1030
- export declare const TOOL_INFO_FILLED_POLYGON = "Filled Polygon";
1031
-
1032
- export declare const TOOL_INFO_MAGIC_BRUSH = "Magic Brush";
1033
-
1034
- export declare const TOOL_INFO_SUPERPIXEL = "Superpixel";
1035
-
1036
- export declare interface ToolbarButtonItem {
1037
- variant: 'button';
1038
- id?: string;
1039
- icon?: ReactNode;
1040
- title?: string;
1041
- tooltip?: string;
1042
- disabled?: boolean;
1043
- active?: boolean;
1044
- slim?: boolean;
1045
- onClick?: () => void;
1046
- subItems?: ToolbarItem[];
1047
- }
1048
-
1049
- declare interface ToolbarButtonItemMeta {
1050
- variant: 'button';
1051
- id?: string;
1052
- icon: ReactNode;
1053
- title: string;
1054
- tooltip?: string;
1055
- disabled?: boolean;
1056
- active?: boolean;
1057
- slim?: boolean;
1058
- onClick: () => void;
1059
- subItems?: ToolbarItemMeta[];
1060
- }
1061
-
1062
- export declare interface ToolbarCheckboxItem {
1063
- variant: 'checkbox';
1064
- id: string;
1065
- icon?: ReactNode;
1066
- title?: string;
1067
- checked?: boolean;
1068
- disabled?: boolean;
1069
- onClick?: () => void;
1070
- }
1071
-
1072
- declare interface ToolbarCheckboxItemMeta {
1073
- variant: 'checkbox';
1074
- id: string;
1075
- icon?: ReactNode;
1076
- title: string;
1077
- checked: boolean;
1078
- disabled?: boolean;
1079
- onClick: () => void;
835
+ declare interface ValidResultBulkDeleteRequest {
836
+ validResultIds: string[];
1080
837
  }
1081
838
 
1082
- export declare interface ToolbarDividerItem {
1083
- variant: 'divider';
839
+ declare interface ValidResultBulkDeleteResponse {
840
+ deletedIds: string[];
841
+ failedIds: string[];
842
+ successCount: number;
843
+ failureCount: number;
844
+ totalCount: number;
1084
845
  }
1085
846
 
1086
- declare interface ToolbarDividerItemMeta {
1087
- variant: 'divider';
847
+ export declare interface ValidResultCreateRequest {
848
+ labelContextId: string;
849
+ datasetId: string;
850
+ datasetVersion: string;
851
+ contentSetId: string;
852
+ elementId?: string;
853
+ policyId?: string;
854
+ labelId?: string;
855
+ result: boolean;
856
+ reason?: string;
857
+ validType: ValidType;
1088
858
  }
1089
859
 
1090
- export declare type ToolbarItem = ToolbarButtonItem | ToolbarRadioItem | ToolbarCheckboxItem | ToolbarDividerItem;
1091
-
1092
- declare type ToolbarItemMeta = ToolbarRadioItemMeta | ToolbarButtonItemMeta | ToolbarCheckboxItemMeta | ToolbarDividerItemMeta;
1093
-
1094
- export declare interface ToolbarRadioItem {
1095
- variant: 'radio';
860
+ export declare interface ValidResultResponse {
1096
861
  id: string;
1097
- name: string;
1098
- icon?: ReactNode;
1099
- title?: string;
1100
- disabled?: boolean;
1101
- checked?: boolean;
1102
- onClick?: () => void;
862
+ labelContextId: string;
863
+ datasetId: string;
864
+ datasetVersion: string;
865
+ contentSetId: string;
866
+ elementId?: string;
867
+ policyId?: string;
868
+ labelId?: string;
869
+ result: boolean;
870
+ reason?: string;
871
+ validType: ValidType;
872
+ validatedDate?: string;
873
+ organizationId?: string;
874
+ accountId?: string;
875
+ zoneId?: string;
876
+ userId?: string;
877
+ modifiedBy?: string;
878
+ modifiedDate?: string;
879
+ createdBy?: string;
880
+ createdDate?: string;
881
+ }
882
+
883
+ declare interface ValidResultSearchRequest {
884
+ orderBy?: Record<string, LabelOrderDirection>;
885
+ pageNumber?: number;
886
+ pageSize?: number;
887
+ labelContextId?: SearchOperatorFilter<string>;
888
+ contentSetId?: SearchOperatorFilter<string>;
889
+ elementId?: SearchOperatorFilter<string>;
890
+ policyId?: SearchOperatorFilter<string>;
891
+ validType?: SearchOperatorFilter<ValidType>;
892
+ }
893
+
894
+ declare type ValidResultSearchResult = CustomPageWrapper<ValidResultResponse, ValidResultSearchRequest>;
895
+
896
+ export declare interface ValidResultUpdateRequest {
897
+ result?: boolean;
898
+ reason?: string;
899
+ validType?: ValidType;
1103
900
  }
1104
901
 
1105
- declare interface ToolbarRadioItemMeta {
1106
- variant: 'radio';
902
+ export declare interface ValidResultUpdateVariables {
1107
903
  id: string;
1108
- name: string;
1109
- icon: ReactNode;
1110
- title: string;
1111
- checked: boolean;
1112
- disabled?: boolean;
1113
- isSlim?: boolean;
1114
- onClick: () => void;
1115
- subButtonItems?: ToolbarItemMeta[];
1116
- }
1117
-
1118
- export declare type ToolbarSection = 'tools' | 'brush' | 'palette' | 'zoom' | 'history' | 'layers' | 'viewMode' | 'validation' | 'navigation' | 'save';
1119
-
1120
- export declare interface ToolExtension extends LabelingExtension {
1121
- slot: 'tool';
1122
- icon: ReactNode;
1123
- label: string;
1124
- shortcut?: string;
1125
- canvasHandlers?: {
1126
- onMouseDown?: (e: CanvasPointerEvent) => void;
1127
- onMouseMove?: (e: CanvasPointerEvent) => void;
1128
- onMouseUp?: (e: CanvasPointerEvent) => void;
1129
- };
904
+ body: ValidResultUpdateRequest;
1130
905
  }
1131
906
 
1132
- declare interface ToolInitConfig {
1133
- colorCode: string;
1134
- brush: BrushOptions;
1135
- imageUrl?: string;
1136
- magicbrushConfig?: {
1137
- threshold: number;
1138
- radius: number;
1139
- };
1140
- superpixelConfig?: Record<string, number>;
1141
- segAnythingCallback?: (payload: any) => void;
1142
- previousTool?: LabelingTool | null;
1143
- }
907
+ export declare type ValidType = "CONTENTSET" | "ELEMENT" | "LABEL";
1144
908
 
1145
- declare interface ToolSelectionState {
1146
- tool: LabelingTool | null;
1147
- setTool: (tool: LabelingTool | null) => void;
1148
- overedUniques: string[];
1149
- setOveredUniques: (overedUniques: string[]) => void;
1150
- undoStack: string[];
1151
- redoStack: string[];
1152
- setUndoStack: (undoStack: string[]) => void;
1153
- setRedoStack: (redoStack: string[]) => void;
909
+ declare interface Version {
910
+ id: string;
911
+ version: string;
912
+ classCount: number;
913
+ elementCount: number;
914
+ createdBy?: string;
915
+ createdDate?: string;
916
+ modifiedBy?: string;
917
+ modifiedDate?: string;
1154
918
  }
1155
919
 
1156
- export declare type ToolType = 'selection' | 'brush' | 'blankRect' | 'filledRect' | 'polygon' | 'eraser' | 'magicbrush' | 'superpixel' | 'segAnything';
1157
-
1158
- export declare const toRgba: (hex: string, opacity: number) => string;
1159
-
1160
- export declare const toRgbaArray: (rgba: string) => number[];
1161
-
1162
- export declare const toRGBAHex: (rgba: string) => string;
1163
-
1164
- /**
1165
- * Set black pixels transparent and apply opacity to non-black pixels.
1166
- */
1167
- export declare const transparentBlackPixel: (imageData: ImageData, opacity: number) => ImageData;
1168
-
1169
- export declare const useBrushStore: UseBoundStore<StoreApi<BrushState>>;
1170
-
1171
- export declare const useCanvasObjectsStore: UseBoundStore<StoreApi<CanvasObjectsState>>;
1172
-
1173
- /**
1174
- * Manages extension lifecycle — provides the ExtensionContext
1175
- * and hooks up ToolExtension canvas handlers.
1176
- */
1177
- export declare function useExtensions(options: UseExtensionsOptions): {
1178
- context: ExtensionContext;
1179
- toolExtensions: ToolExtension[];
1180
- sidePanelExtensions: LabelingExtension[];
1181
- toolbarExtensions: LabelingExtension[];
1182
- activeToolExtension: ToolExtension | undefined;
1183
- };
1184
-
1185
- declare interface UseExtensionsOptions {
1186
- extensions: LabelingExtension[];
1187
- image: {
1188
- url: string;
1189
- width: number;
1190
- height: number;
1191
- };
1192
- annotations: Annotation[];
1193
- selectedIds: string[];
1194
- activeTool: string;
1195
- addAnnotations: (annotations: Annotation[]) => void;
1196
- updateAnnotation: (id: string, annotation: Partial<Annotation>) => void;
1197
- removeAnnotations: (ids: string[]) => void;
1198
- setTool: (tool: string) => void;
920
+ export declare interface VersionDTO {
921
+ version: string | null;
922
+ versionedDate: string;
923
+ versionRecords: string;
1199
924
  }
1200
925
 
1201
- export declare const useImageToolStore: UseBoundStore<StoreApi<ImageToolState>>;
1202
-
1203
- export declare const useIssuePanelStore: UseBoundStore<StoreApi<IssuePanelState>>;
1204
-
1205
- /**
1206
- * Registers keyboard shortcuts matching portal-iris-web.
1207
- * Shortcuts are view-mode-aware: Image mode has brush/eraser keys,
1208
- * Text mode has highlighting, etc.
1209
- */
1210
- export declare function useKeyboardShortcuts({ viewMode, isValidationMode, setTool, onUndo, onRedo, disabled, }: KeyboardShortcutsConfig): void;
1211
-
1212
- export declare const useLabelBatchStore: UseBoundStore<StoreApi<LabelBatchState>>;
1213
-
1214
- /**
1215
- * Level 3 headless hook — Direct canvas access.
1216
- *
1217
- * Provides low-level canvas operations: add/remove objects,
1218
- * export state, zoom control, etc.
1219
- */
1220
- export declare function useLabelingCanvas(): {
1221
- objects: LabeledFabricObject[];
1222
- zoom: number;
1223
- getAnnotations: (imageWidth: number, imageHeight: number) => Promise<Annotation[]>;
1224
- addAnnotation: (annotation: Annotation, imageWidth: number, imageHeight: number) => Promise<void>;
1225
- removeAnnotation: (annotationId: string) => void;
1226
- clearCanvas: () => void;
1227
- exportState: (imageWidth: number, imageHeight: number) => Promise<CanvasState_2>;
1228
- setZoomLevel: (level: number) => void;
1229
- };
1230
-
1231
- export declare function useLabelingContext(): LabelingContextValue;
1232
-
1233
- /**
1234
- * Level 3 headless hook — Canvas undo/redo history.
1235
- *
1236
- * Uses the tool store's undo/redo stacks (JSON snapshots).
1237
- */
1238
- export declare function useLabelingHistory(): {
1239
- canUndo: boolean;
1240
- canRedo: boolean;
1241
- undo: () => Promise<void>;
1242
- redo: () => Promise<void>;
1243
- pushSnapshot: () => void;
1244
- clear: () => void;
1245
- };
1246
-
1247
- /**
1248
- * Level 3 headless hook — Tool selection and palette state.
1249
- *
1250
- * Returns current tool, setTool, and palette/brush/opacity state with setters.
1251
- */
1252
- export declare function useLabelingTools(): {
1253
- activeToolId: string | null;
1254
- currentTool: LabelingTool | null;
1255
- setTool: (toolType: ToolType) => void;
1256
- clearTool: () => void;
1257
- colorCode: string;
1258
- setColorCode: (colorCode: string) => void;
1259
- opacity: number;
1260
- setOpacity: (opacity: number) => void;
1261
- brush: {
1262
- id: number;
1263
- lineCap: string;
1264
- lineWidth: number;
1265
- };
1266
- setBrush: (brush: {
1267
- id: number;
1268
- lineCap: string;
1269
- lineWidth: number;
1270
- }) => void;
1271
- };
1272
-
1273
- export declare function useLabelingUIMeta(viewMode: WorkspaceViewMode, isValidationMode: boolean): LabelingUIMetaResult;
1274
-
1275
- export declare const useLabelSelectionStore: UseBoundStore<StoreApi<LabelSelectionState>>;
1276
-
1277
- export declare const useLabelVisibilityStore: UseBoundStore<StoreApi<LabelVisibilityState>>;
1278
-
1279
- export declare const useLayerModeStore: UseBoundStore<StoreApi<LayerModeState>>;
1280
-
1281
- export declare const useNumberSegmentSelectionStore: UseBoundStore<StoreApi<NumberSegmentSelectionState>>;
1282
-
1283
- export declare const useNumberToolStore: UseBoundStore<StoreApi<NumberToolState>>;
1284
-
1285
- export declare const useOpacityStore: UseBoundStore<StoreApi<OpacityState>>;
1286
-
1287
- export declare const usePaletteStore: UseBoundStore<StoreApi<PaletteState>>;
1288
-
1289
- export declare const useSelectedObjectsStore: UseBoundStore<StoreApi<SelectedObjectsState>>;
1290
-
1291
- export declare const useTextAutoHighlightStore: UseBoundStore<StoreApi<TextAutoHighlightState>>;
926
+ export declare const VIRTUALIZED_RECORDS_ROW_META_SYMBOL: unique symbol;
1292
927
 
1293
- export declare const useTextSegmentSelectionStore: UseBoundStore<StoreApi<TextSegmentSelectionState>>;
1294
-
1295
- export declare const useTextToolStore: UseBoundStore<StoreApi<TextToolState>>;
1296
-
1297
- /**
1298
- * Manages tool lifecycle: calls tool.init(config) when the tool changes,
1299
- * and runs the cleanup function returned by init when unmounting or switching.
1300
- */
1301
- export declare function useToolInit(currentTool: LabelingTool | null, config: ToolInitConfig, canvasReady?: boolean): {
1302
- activeToolId: string | null;
928
+ declare type VirtualizedRecordsTableRow = Record<string, VirtualizedRowCellValue> & {
929
+ [VIRTUALIZED_RECORDS_ROW_META_SYMBOL]?: VirtualizedRowMeta;
1303
930
  };
1304
931
 
1305
- export declare const useToolSelectionStore: UseBoundStore<StoreApi<ToolSelectionState>>;
1306
-
1307
- export declare const useValidationModeStore: UseBoundStore<StoreApi<ValidationModeState>>;
1308
-
1309
- export declare const useViewModeStore: UseBoundStore<StoreApi<ViewModeState>>;
1310
-
1311
- export declare const useWorkspaceLayoutStore: UseBoundStore<StoreApi<WorkspaceLayoutState>>;
1312
-
1313
- export declare const useZoomStore: UseBoundStore<StoreApi<ZoomState>>;
1314
-
1315
- export declare interface ValidateEvent {
1316
- annotationIds: string[];
1317
- result: boolean;
1318
- reason?: string;
1319
- }
1320
-
1321
- export declare interface ValidationDeleteEvent {
1322
- ids: string[];
1323
- }
1324
-
1325
- declare interface ValidationModeState {
1326
- isValidationMode: boolean;
1327
- setValidationMode: (value: boolean) => void;
1328
- toggleValidationMode: () => void;
1329
- }
932
+ declare type VirtualizedRowCellValue = string | number;
1330
933
 
1331
- export declare interface ValidationResult {
1332
- id: string;
1333
- annotationId?: string;
1334
- result: boolean;
1335
- reason?: string;
1336
- validatedAt?: string;
934
+ declare interface VirtualizedRowMeta {
935
+ columnRefs: Record<string, unknown>;
936
+ rowRef?: unknown;
937
+ rowId?: string;
1337
938
  }
1338
939
 
1339
- export declare interface ValidationUpdateEvent {
1340
- id: string;
1341
- result?: boolean;
1342
- reason?: string;
1343
- }
940
+ declare const WORKSPACE_CHART_PIVOT_MODE: {
941
+ readonly ROW_AS_X: "ROW_AS_X";
942
+ readonly COLUMN_AS_X: "COLUMN_AS_X";
943
+ };
1344
944
 
1345
- declare interface ViewModeState {
1346
- mode: WorkspaceViewMode;
1347
- setMode: (mode: WorkspaceViewMode) => void;
945
+ /** Information about the currently displayed image in the workspace. */
946
+ export declare interface WorkspaceImageInfo {
947
+ url: string;
948
+ width: number;
949
+ height: number;
1348
950
  }
1349
951
 
1350
- export declare const WORKSPACE_VIEW_MODES: readonly ["Record", "Image", "Text", "Number", "File"];
1351
-
1352
- export declare interface WorkspaceIndicator {
1353
- title: string;
1354
- subtitle?: string;
1355
- detail?: string;
1356
- progress?: {
1357
- current: number;
1358
- total: number;
952
+ declare interface WorkspaceNavigationChartAxisSnapshot {
953
+ mode: ChartPivotMode;
954
+ canRender: boolean;
955
+ xAxis: {
956
+ label: string;
957
+ ticks: WorkspaceNavigationChartAxisTick[];
958
+ };
959
+ yAxis: {
960
+ label: string;
961
+ series: WorkspaceNavigationChartSeries[];
962
+ };
963
+ source: {
964
+ rows: number[];
965
+ columns: string[];
1359
966
  };
1360
967
  }
1361
968
 
1362
- export declare interface WorkspaceLayout {
1363
- navigation?: 'left' | 'bottom' | 'hidden';
1364
- toolbar?: 'top' | 'bottom';
1365
- }
1366
-
1367
- declare interface WorkspaceLayoutState {
1368
- direction: LayoutDirection;
1369
- active: boolean;
1370
- setDirection: (direction: LayoutDirection) => void;
1371
- setActive: (active: boolean) => void;
1372
- toggleActive: () => void;
969
+ declare interface WorkspaceNavigationChartAxisTick {
970
+ key: number | string;
971
+ label: string;
972
+ rowIndex?: number;
973
+ columnId?: string;
1373
974
  }
1374
975
 
1375
- export declare type WorkspaceMode = 'labeling' | 'validation' | 'readonly';
1376
-
1377
- export declare interface WorkspaceRecord {
976
+ declare interface WorkspaceNavigationChartSeries {
1378
977
  id: string;
1379
- title: string;
1380
- thumbnail?: string;
1381
- status?: RecordStatus;
1382
- children?: WorkspaceRecord[];
1383
- meta?: Record<string, unknown>;
1384
- /** Schema-based table mode */
1385
- summary?: Record<string, string>;
1386
- schemas?: NavigationSchema[];
1387
- accessories?: Record<string, NavigationCellAccessories>;
1388
- detail?: NavigationDetailData;
1389
- }
1390
-
1391
- export declare type WorkspaceViewMode = 'Record' | 'Image' | 'Text' | 'Number' | 'File';
1392
-
1393
- declare interface ZoomPayload {
1394
- direction: 1 | 0 | -1;
1395
- level: number;
1396
- point?: {
1397
- x: number;
1398
- y: number;
1399
- };
1400
- onChange: (payload: {
1401
- level: number;
1402
- width: number;
1403
- height: number;
1404
- }) => void;
1405
- }
1406
-
1407
- declare interface ZoomState {
1408
- level: number;
1409
- width: number;
1410
- height: number;
1411
- setZoom: (payload: {
1412
- level: number;
1413
- width: number;
1414
- height: number;
978
+ label: string;
979
+ values: Array<number | null>;
980
+ points: WorkspaceNavigationChartSeriesPoint[];
981
+ }
982
+
983
+ declare interface WorkspaceNavigationChartSeriesPoint {
984
+ axisKey: number | string;
985
+ rowIndex: number;
986
+ columnId: string;
987
+ elementId: string | null;
988
+ value: number | null;
989
+ rawValue: string | null;
990
+ }
991
+
992
+ declare interface WorkspaceNavigationDetailContext {
993
+ columns: string[];
994
+ rows: DetailTableRow[];
995
+ recordName: string | null;
996
+ columnName: string | null;
997
+ contentType: string | null;
998
+ contentSetId: string | null;
999
+ schemaName: string | null;
1000
+ /**
1001
+ * @deprecated Use contentSetId.
1002
+ */
1003
+ contentsetId?: string | null;
1004
+ elementId: string | null;
1005
+ }
1006
+
1007
+ declare interface WorkspaceNavigationDetailSelectionState extends WorkspaceNavigationDetailContext {
1008
+ activeRowId: string | null;
1009
+ selectedRows: number[];
1010
+ selectedColumns: string[];
1011
+ selectedCells: DetailTableCellSelection[];
1012
+ chartPivotMode: ChartPivotMode;
1013
+ chartAxisSnapshot: WorkspaceNavigationChartAxisSnapshot;
1014
+ detailContextResetKey: number;
1015
+ setChartPivotMode: (mode: ChartPivotMode) => void;
1016
+ toggleChartPivotMode: () => void;
1017
+ setContext: (context: WorkspaceNavigationDetailContext | null) => void;
1018
+ setActiveRowId: (rowId: string | null) => void;
1019
+ setSelectionSnapshot: (payload: Partial<WorkspaceNavigationDetailContext> & {
1020
+ selectedRows?: number[];
1021
+ selectedColumns?: string[];
1022
+ selectedCells?: DetailTableCellSelection[];
1415
1023
  }) => void;
1416
- reset: () => void;
1024
+ incrementDetailContextKey: () => void;
1025
+ toggleRowSelection: (rowIndex: number) => void;
1026
+ toggleColumnSelection: (columnId: string) => void;
1027
+ toggleCellSelection: (rowIndex: number, columnId: string) => void;
1028
+ clearSelection: () => void;
1417
1029
  }
1418
1030
 
1419
1031
  export { }