@servantcdh/ez-planet-labeling 0.3.3 → 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,1440 +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
- columns: string[] | Array<{
840
- key: string;
841
- label: string;
842
- }>;
843
- rows: unknown[][] | Array<Record<string, unknown>>;
844
- };
845
- canRender?: boolean;
846
- segments?: Array<{
847
- id: string;
848
- start: number;
849
- end: number;
850
- color: string;
851
- opacity?: number;
852
- }>;
853
- }
854
-
855
- declare interface NumberLabelingTool {
856
- id: 'selection' | 'drag-segment';
857
- label: string;
858
- }
587
+ export declare function LabelingWorkspace({ extensions, }: LabelingWorkspaceProps): JSX_2.Element;
859
588
 
860
- declare interface NumberSegmentSelection {
861
- key: string;
862
- labelId: string | null;
863
- tempId: string | null;
864
- start: number;
865
- end: number;
866
- color?: string;
867
- opacity?: number;
589
+ export declare interface LabelingWorkspaceProps {
590
+ extensions?: LabelingExtension[];
868
591
  }
869
592
 
870
- declare interface NumberSegmentSelectionState {
871
- selectedSegment: NumberSegmentSelection | null;
872
- 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;
873
641
  }
874
642
 
875
- declare interface NumberToolState {
876
- tool: NumberLabelingTool | null;
877
- 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;
878
655
  }
879
656
 
880
- export declare type NumberToolType = 'selection' | 'drag-segment';
657
+ export declare type LabelType = "FILE" | "TABLE";
881
658
 
882
- declare interface OpacityState {
883
- opacity: number;
884
- setOpacity: (opacity: number) => void;
885
- }
659
+ export declare type LabelUnitType = "CONTENTSET" | "ELEMENT";
886
660
 
887
- declare interface PaletteState {
888
- colorCode: string;
889
- setColorCode: (colorCode: string) => void;
661
+ export declare interface LabelUpdateData extends LabelInsertData {
662
+ id: string;
890
663
  }
891
664
 
892
- export declare interface PolygonGeometry {
893
- type: 'polygon';
894
- /** Normalized vertex coordinates */
895
- points: Array<{
896
- x: number;
897
- y: number;
898
- }>;
899
- }
665
+ export declare type LabelValue = ClassificationValue | BoxValue | SegmentationResponseValue | SegmentationBase64Value | ChartValue | RecognitionValue | FileValue | unknown;
900
666
 
901
- export declare const polygonTool: () => LabelingTool;
667
+ /** A loading-state placeholder. */
668
+ export declare function loadingData<T>(): AsyncData<T>;
902
669
 
903
- export declare interface RecognitionGeometry {
904
- type: 'recognition';
905
- start: number;
906
- end: number;
907
- 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;
908
677
  }
909
678
 
910
- export declare type RecordStatus = 'unlabeled' | 'labeled' | 'validated' | 'issue';
911
-
912
- export declare const renderAllSafe: (targetCanvas?: FabricCanvas) => void;
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
+ };
913
709
 
914
- export declare interface SavePayload {
915
- viewMode: WorkspaceViewMode;
916
- inserts: LabelInsertData[];
917
- updates: LabelUpdateData[];
918
- deletes: LabelDeleteData[];
919
- canvasJSON?: object;
920
- imageSize?: {
921
- width: number;
922
- height: number;
923
- };
710
+ export declare interface PolicyClass {
711
+ name: string;
712
+ color: string;
713
+ opacity?: number;
714
+ index?: number;
715
+ attributes?: Attribute[] | null;
924
716
  }
925
717
 
926
- export declare interface SaveToRecordPayload {
927
- contentSetId: string;
928
- labels: LabelInsertData[];
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;
929
756
  }
930
757
 
931
- export declare interface SaveValidationPayload {
932
- result: boolean;
933
- reason?: string;
934
- labelIds: 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
- export declare const segmentAnythingTool: () => LabelingTool;
938
-
939
- export declare interface SegmentationGeometry {
940
- type: 'segmentation';
941
- /** Base64 PNG mask */
942
- mask: string;
943
- /** Fabric object vector for restoration (optional) */
944
- vector?: string;
945
- }
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;
946
774
 
947
- declare interface SelectedClassificationInfo {
948
- policyId?: string | null;
949
- classIndex?: number | null;
950
- className?: string | null;
951
- labelId?: string | null;
952
- tempId?: string | null;
953
- isCanvasFocused?: boolean;
775
+ export declare interface SchemaItemDTO {
776
+ baseInfo: BaseInfoDTO;
777
+ properties: Record<string, unknown>;
954
778
  }
955
779
 
956
- declare interface SelectedObjectsState {
957
- objects: LabeledFabricObject[];
958
- setObjects: (objects: LabeledFabricObject[]) => void;
780
+ declare interface SchemaStatus {
781
+ name?: string;
782
+ totalCount?: number;
783
+ elements?: ElementStatus[];
959
784
  }
960
785
 
961
- export declare const selectionTool: () => LabelingTool;
962
-
963
- export declare const setCanvasInstance: (instance: FabricCanvas | null) => void;
964
-
965
- export declare const setMagicBrushModule: (module: any) => void;
966
-
967
- export declare const setSuperpixelModules: (modules: {
968
- SLIC: any;
969
- MagicBrush: any;
970
- }) => void;
971
-
972
- export declare const subscribeLabelEvents: (listener: LabelEventListener) => () => void;
973
-
974
- export declare const superpixelTool: () => LabelingTool;
975
-
976
- declare interface TemporalHistoryState<T> {
977
- snapshot: T | null;
978
- setSnapshot: (snapshot: T) => void;
979
- reset: () => void;
786
+ declare interface Score {
787
+ className?: string;
788
+ score?: number;
789
+ [key: string]: unknown;
980
790
  }
981
791
 
982
- declare interface TextAutoHighlightState {
983
- english: boolean;
984
- number: boolean;
985
- special: boolean;
986
- setEnglish: (value: boolean) => void;
987
- setNumber: (value: boolean) => void;
988
- setSpecial: (value: boolean) => void;
989
- reset: () => void;
792
+ declare interface SearchOperatorFilter<TValue> {
793
+ operator: string;
794
+ value: TValue;
990
795
  }
991
796
 
992
- export declare interface TextContent {
993
- /** The text string to display. Use `text` or `value`. */
994
- text?: string;
995
- /** @deprecated Use `text` instead */
996
- value?: string;
997
- elementId?: string;
998
- segments?: Array<{
999
- id: string;
1000
- start: number;
1001
- end: number;
1002
- label?: string;
1003
- color: string;
1004
- opacity?: number;
1005
- }>;
1006
- }
1007
-
1008
- declare interface TextLabelingTool {
1009
- id: 'selection' | 'drag-segment';
1010
- 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;
1011
806
  }
1012
807
 
1013
- declare interface TextSegmentSelection {
1014
- key: string;
1015
- labelId: string | null;
1016
- tempId: string | null;
1017
- start: number;
1018
- end: number;
1019
- 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;
1020
818
  color?: string;
1021
819
  opacity?: number;
820
+ zindex?: number;
1022
821
  }
1023
822
 
1024
- declare interface TextSegmentSelectionState {
1025
- selectedSegment: TextSegmentSelection | null;
1026
- setSelectedSegment: (segment: TextSegmentSelection | null) => void;
1027
- }
823
+ /** Wrap an already-resolved value as AsyncData (no loading, no error). */
824
+ export declare function staticData<T>(data: T): AsyncData<T>;
1028
825
 
1029
- declare interface TextToolState {
1030
- tool: TextLabelingTool | null;
1031
- 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;
1032
829
  }
1033
830
 
1034
- export declare type TextToolType = 'selection' | 'drag-segment';
1035
-
1036
- export declare const toHex: (color: string) => {
1037
- hex: string;
1038
- alpha: string;
1039
- };
1040
-
1041
- export declare const TOOL_INFO_BOUNDED_BOX = "Bounded Box";
1042
-
1043
- export declare const TOOL_INFO_BRUSH = "Brush";
1044
-
1045
- export declare const TOOL_INFO_COMBINED_LABELS = "Combined Label";
1046
-
1047
- export declare const TOOL_INFO_ERASER = "Eraser";
831
+ export declare const useFilterStore: UseBoundStore<StoreApi<FilterState>>;
1048
832
 
1049
- export declare const TOOL_INFO_FILLED_BOX = "Filled Box";
833
+ export declare const useWorkspaceNavigationDetailSelectionStore: UseBoundStore<StoreApi<WorkspaceNavigationDetailSelectionState>>;
1050
834
 
1051
- export declare const TOOL_INFO_FILLED_POLYGON = "Filled Polygon";
1052
-
1053
- export declare const TOOL_INFO_MAGIC_BRUSH = "Magic Brush";
1054
-
1055
- export declare const TOOL_INFO_SUPERPIXEL = "Superpixel";
1056
-
1057
- export declare interface ToolbarButtonItem {
1058
- variant: 'button';
1059
- id?: string;
1060
- icon?: ReactNode;
1061
- title?: string;
1062
- tooltip?: string;
1063
- disabled?: boolean;
1064
- active?: boolean;
1065
- slim?: boolean;
1066
- onClick?: () => void;
1067
- subItems?: ToolbarItem[];
1068
- }
1069
-
1070
- declare interface ToolbarButtonItemMeta {
1071
- variant: 'button';
1072
- id?: string;
1073
- icon: ReactNode;
1074
- title: string;
1075
- tooltip?: string;
1076
- disabled?: boolean;
1077
- active?: boolean;
1078
- slim?: boolean;
1079
- onClick: () => void;
1080
- subItems?: ToolbarItemMeta[];
835
+ declare interface ValidResultBulkDeleteRequest {
836
+ validResultIds: string[];
1081
837
  }
1082
838
 
1083
- export declare interface ToolbarCheckboxItem {
1084
- variant: 'checkbox';
1085
- id: string;
1086
- icon?: ReactNode;
1087
- title?: string;
1088
- checked?: boolean;
1089
- disabled?: boolean;
1090
- onClick?: () => void;
1091
- }
1092
-
1093
- declare interface ToolbarCheckboxItemMeta {
1094
- variant: 'checkbox';
1095
- id: string;
1096
- icon?: ReactNode;
1097
- title: string;
1098
- checked: boolean;
1099
- disabled?: boolean;
1100
- onClick: () => void;
839
+ declare interface ValidResultBulkDeleteResponse {
840
+ deletedIds: string[];
841
+ failedIds: string[];
842
+ successCount: number;
843
+ failureCount: number;
844
+ totalCount: number;
1101
845
  }
1102
846
 
1103
- export declare interface ToolbarDividerItem {
1104
- variant: 'divider';
1105
- }
1106
-
1107
- declare interface ToolbarDividerItemMeta {
1108
- 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;
1109
858
  }
1110
859
 
1111
- export declare type ToolbarItem = ToolbarButtonItem | ToolbarRadioItem | ToolbarCheckboxItem | ToolbarDividerItem;
1112
-
1113
- declare type ToolbarItemMeta = ToolbarRadioItemMeta | ToolbarButtonItemMeta | ToolbarCheckboxItemMeta | ToolbarDividerItemMeta;
1114
-
1115
- export declare interface ToolbarRadioItem {
1116
- variant: 'radio';
860
+ export declare interface ValidResultResponse {
1117
861
  id: string;
1118
- name: string;
1119
- icon?: ReactNode;
1120
- title?: string;
1121
- disabled?: boolean;
1122
- checked?: boolean;
1123
- 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;
1124
900
  }
1125
901
 
1126
- declare interface ToolbarRadioItemMeta {
1127
- variant: 'radio';
902
+ export declare interface ValidResultUpdateVariables {
1128
903
  id: string;
1129
- name: string;
1130
- icon: ReactNode;
1131
- title: string;
1132
- checked: boolean;
1133
- disabled?: boolean;
1134
- isSlim?: boolean;
1135
- onClick: () => void;
1136
- subButtonItems?: ToolbarItemMeta[];
904
+ body: ValidResultUpdateRequest;
1137
905
  }
1138
906
 
1139
- export declare type ToolbarSection = 'tools' | 'brush' | 'palette' | 'zoom' | 'history' | 'layers' | 'viewMode' | 'validation' | 'navigation' | 'save';
1140
-
1141
- export declare interface ToolExtension extends LabelingExtension {
1142
- slot: 'tool';
1143
- icon: ReactNode;
1144
- label: string;
1145
- shortcut?: string;
1146
- canvasHandlers?: {
1147
- onMouseDown?: (e: CanvasPointerEvent) => void;
1148
- onMouseMove?: (e: CanvasPointerEvent) => void;
1149
- onMouseUp?: (e: CanvasPointerEvent) => void;
1150
- };
1151
- }
1152
-
1153
- declare interface ToolInitConfig {
1154
- colorCode: string;
1155
- brush: BrushOptions;
1156
- imageUrl?: string;
1157
- magicbrushConfig?: {
1158
- threshold: number;
1159
- radius: number;
1160
- };
1161
- superpixelConfig?: Record<string, number>;
1162
- segAnythingCallback?: (payload: any) => void;
1163
- previousTool?: LabelingTool | null;
1164
- }
907
+ export declare type ValidType = "CONTENTSET" | "ELEMENT" | "LABEL";
1165
908
 
1166
- declare interface ToolSelectionState {
1167
- tool: LabelingTool | null;
1168
- setTool: (tool: LabelingTool | null) => void;
1169
- overedUniques: string[];
1170
- setOveredUniques: (overedUniques: string[]) => void;
1171
- undoStack: string[];
1172
- redoStack: string[];
1173
- setUndoStack: (undoStack: string[]) => void;
1174
- 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;
1175
918
  }
1176
919
 
1177
- export declare type ToolType = 'selection' | 'brush' | 'blankRect' | 'filledRect' | 'polygon' | 'eraser' | 'magicbrush' | 'superpixel' | 'segAnything';
1178
-
1179
- export declare const toRgba: (hex: string, opacity: number) => string;
1180
-
1181
- export declare const toRgbaArray: (rgba: string) => number[];
1182
-
1183
- export declare const toRGBAHex: (rgba: string) => string;
1184
-
1185
- /**
1186
- * Set black pixels transparent and apply opacity to non-black pixels.
1187
- */
1188
- export declare const transparentBlackPixel: (imageData: ImageData, opacity: number) => ImageData;
1189
-
1190
- export declare const useBrushStore: UseBoundStore<StoreApi<BrushState>>;
1191
-
1192
- export declare const useCanvasObjectsStore: UseBoundStore<StoreApi<CanvasObjectsState>>;
1193
-
1194
- /**
1195
- * Manages extension lifecycle — provides the ExtensionContext
1196
- * and hooks up ToolExtension canvas handlers.
1197
- */
1198
- export declare function useExtensions(options: UseExtensionsOptions): {
1199
- context: ExtensionContext;
1200
- toolExtensions: ToolExtension[];
1201
- sidePanelExtensions: LabelingExtension[];
1202
- toolbarExtensions: LabelingExtension[];
1203
- activeToolExtension: ToolExtension | undefined;
1204
- };
1205
-
1206
- declare interface UseExtensionsOptions {
1207
- extensions: LabelingExtension[];
1208
- image: {
1209
- url: string;
1210
- width: number;
1211
- height: number;
1212
- };
1213
- annotations: Annotation[];
1214
- selectedIds: string[];
1215
- activeTool: string;
1216
- addAnnotations: (annotations: Annotation[]) => void;
1217
- updateAnnotation: (id: string, annotation: Partial<Annotation>) => void;
1218
- removeAnnotations: (ids: string[]) => void;
1219
- setTool: (tool: string) => void;
920
+ export declare interface VersionDTO {
921
+ version: string | null;
922
+ versionedDate: string;
923
+ versionRecords: string;
1220
924
  }
1221
925
 
1222
- export declare const useImageToolStore: UseBoundStore<StoreApi<ImageToolState>>;
1223
-
1224
- export declare const useIssuePanelStore: UseBoundStore<StoreApi<IssuePanelState>>;
1225
-
1226
- /**
1227
- * Registers keyboard shortcuts matching portal-iris-web.
1228
- * Shortcuts are view-mode-aware: Image mode has brush/eraser keys,
1229
- * Text mode has highlighting, etc.
1230
- */
1231
- export declare function useKeyboardShortcuts({ viewMode, isValidationMode, setTool, onUndo, onRedo, disabled, }: KeyboardShortcutsConfig): void;
1232
-
1233
- export declare const useLabelBatchStore: UseBoundStore<StoreApi<LabelBatchState>>;
1234
-
1235
- /**
1236
- * Level 3 headless hook — Direct canvas access.
1237
- *
1238
- * Provides low-level canvas operations: add/remove objects,
1239
- * export state, zoom control, etc.
1240
- */
1241
- export declare function useLabelingCanvas(): {
1242
- objects: LabeledFabricObject[];
1243
- zoom: number;
1244
- getAnnotations: (imageWidth: number, imageHeight: number) => Promise<Annotation[]>;
1245
- addAnnotation: (annotation: Annotation, imageWidth: number, imageHeight: number) => Promise<void>;
1246
- removeAnnotation: (annotationId: string) => void;
1247
- clearCanvas: () => void;
1248
- exportState: (imageWidth: number, imageHeight: number) => Promise<CanvasState_2>;
1249
- setZoomLevel: (level: number) => void;
1250
- };
1251
-
1252
- export declare function useLabelingContext(): LabelingContextValue;
1253
-
1254
- /**
1255
- * Level 3 headless hook — Canvas undo/redo history.
1256
- *
1257
- * Uses the tool store's undo/redo stacks (JSON snapshots).
1258
- */
1259
- export declare function useLabelingHistory(): {
1260
- canUndo: boolean;
1261
- canRedo: boolean;
1262
- undo: () => Promise<void>;
1263
- redo: () => Promise<void>;
1264
- pushSnapshot: () => void;
1265
- clear: () => void;
1266
- };
1267
-
1268
- /**
1269
- * Level 3 headless hook — Tool selection and palette state.
1270
- *
1271
- * Returns current tool, setTool, and palette/brush/opacity state with setters.
1272
- */
1273
- export declare function useLabelingTools(): {
1274
- activeToolId: string | null;
1275
- currentTool: LabelingTool | null;
1276
- setTool: (toolType: ToolType) => void;
1277
- clearTool: () => void;
1278
- colorCode: string;
1279
- setColorCode: (colorCode: string) => void;
1280
- opacity: number;
1281
- setOpacity: (opacity: number) => void;
1282
- brush: {
1283
- id: number;
1284
- lineCap: string;
1285
- lineWidth: number;
1286
- };
1287
- setBrush: (brush: {
1288
- id: number;
1289
- lineCap: string;
1290
- lineWidth: number;
1291
- }) => void;
1292
- };
1293
-
1294
- export declare function useLabelingUIMeta(viewMode: WorkspaceViewMode, isValidationMode: boolean): LabelingUIMetaResult;
1295
-
1296
- export declare const useLabelSelectionStore: UseBoundStore<StoreApi<LabelSelectionState>>;
1297
-
1298
- export declare const useLabelVisibilityStore: UseBoundStore<StoreApi<LabelVisibilityState>>;
1299
-
1300
- export declare const useLayerModeStore: UseBoundStore<StoreApi<LayerModeState>>;
1301
-
1302
- export declare const useNumberSegmentSelectionStore: UseBoundStore<StoreApi<NumberSegmentSelectionState>>;
1303
-
1304
- export declare const useNumberToolStore: UseBoundStore<StoreApi<NumberToolState>>;
1305
-
1306
- export declare const useOpacityStore: UseBoundStore<StoreApi<OpacityState>>;
1307
-
1308
- export declare const usePaletteStore: UseBoundStore<StoreApi<PaletteState>>;
926
+ export declare const VIRTUALIZED_RECORDS_ROW_META_SYMBOL: unique symbol;
1309
927
 
1310
- export declare const useSelectedObjectsStore: UseBoundStore<StoreApi<SelectedObjectsState>>;
1311
-
1312
- export declare const useTextAutoHighlightStore: UseBoundStore<StoreApi<TextAutoHighlightState>>;
1313
-
1314
- export declare const useTextSegmentSelectionStore: UseBoundStore<StoreApi<TextSegmentSelectionState>>;
1315
-
1316
- export declare const useTextToolStore: UseBoundStore<StoreApi<TextToolState>>;
1317
-
1318
- /**
1319
- * Manages tool lifecycle: calls tool.init(config) when the tool changes,
1320
- * and runs the cleanup function returned by init when unmounting or switching.
1321
- */
1322
- export declare function useToolInit(currentTool: LabelingTool | null, config: ToolInitConfig, canvasReady?: boolean): {
1323
- activeToolId: string | null;
928
+ declare type VirtualizedRecordsTableRow = Record<string, VirtualizedRowCellValue> & {
929
+ [VIRTUALIZED_RECORDS_ROW_META_SYMBOL]?: VirtualizedRowMeta;
1324
930
  };
1325
931
 
1326
- export declare const useToolSelectionStore: UseBoundStore<StoreApi<ToolSelectionState>>;
1327
-
1328
- export declare const useValidationModeStore: UseBoundStore<StoreApi<ValidationModeState>>;
1329
-
1330
- export declare const useViewModeStore: UseBoundStore<StoreApi<ViewModeState>>;
1331
-
1332
- export declare const useWorkspaceLayoutStore: UseBoundStore<StoreApi<WorkspaceLayoutState>>;
1333
-
1334
- export declare const useZoomStore: UseBoundStore<StoreApi<ZoomState>>;
1335
-
1336
- export declare interface ValidateEvent {
1337
- annotationIds: string[];
1338
- result: boolean;
1339
- reason?: string;
1340
- }
1341
-
1342
- export declare interface ValidationDeleteEvent {
1343
- ids: string[];
1344
- }
1345
-
1346
- declare interface ValidationModeState {
1347
- isValidationMode: boolean;
1348
- setValidationMode: (value: boolean) => void;
1349
- toggleValidationMode: () => void;
1350
- }
932
+ declare type VirtualizedRowCellValue = string | number;
1351
933
 
1352
- export declare interface ValidationResult {
1353
- id: string;
1354
- annotationId?: string;
1355
- result: boolean;
1356
- reason?: string;
1357
- validatedAt?: string;
934
+ declare interface VirtualizedRowMeta {
935
+ columnRefs: Record<string, unknown>;
936
+ rowRef?: unknown;
937
+ rowId?: string;
1358
938
  }
1359
939
 
1360
- export declare interface ValidationUpdateEvent {
1361
- id: string;
1362
- result?: boolean;
1363
- reason?: string;
1364
- }
940
+ declare const WORKSPACE_CHART_PIVOT_MODE: {
941
+ readonly ROW_AS_X: "ROW_AS_X";
942
+ readonly COLUMN_AS_X: "COLUMN_AS_X";
943
+ };
1365
944
 
1366
- declare interface ViewModeState {
1367
- mode: WorkspaceViewMode;
1368
- 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;
1369
950
  }
1370
951
 
1371
- export declare const WORKSPACE_VIEW_MODES: readonly ["Record", "Image", "Text", "Number", "File"];
1372
-
1373
- export declare interface WorkspaceIndicator {
1374
- title: string;
1375
- subtitle?: string;
1376
- detail?: string;
1377
- progress?: {
1378
- current: number;
1379
- 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[];
1380
966
  };
1381
967
  }
1382
968
 
1383
- export declare interface WorkspaceLayout {
1384
- navigation?: 'left' | 'bottom' | 'hidden';
1385
- toolbar?: 'top' | 'bottom';
1386
- }
1387
-
1388
- declare interface WorkspaceLayoutState {
1389
- direction: LayoutDirection;
1390
- active: boolean;
1391
- setDirection: (direction: LayoutDirection) => void;
1392
- setActive: (active: boolean) => void;
1393
- toggleActive: () => void;
969
+ declare interface WorkspaceNavigationChartAxisTick {
970
+ key: number | string;
971
+ label: string;
972
+ rowIndex?: number;
973
+ columnId?: string;
1394
974
  }
1395
975
 
1396
- export declare type WorkspaceMode = 'labeling' | 'validation' | 'readonly';
1397
-
1398
- export declare interface WorkspaceRecord {
976
+ declare interface WorkspaceNavigationChartSeries {
1399
977
  id: string;
1400
- title: string;
1401
- thumbnail?: string;
1402
- status?: RecordStatus;
1403
- children?: WorkspaceRecord[];
1404
- meta?: Record<string, unknown>;
1405
- /** Schema-based table mode */
1406
- summary?: Record<string, string>;
1407
- schemas?: NavigationSchema[];
1408
- accessories?: Record<string, NavigationCellAccessories>;
1409
- detail?: NavigationDetailData;
1410
- }
1411
-
1412
- export declare type WorkspaceViewMode = 'Record' | 'Image' | 'Text' | 'Number' | 'File';
1413
-
1414
- declare interface ZoomPayload {
1415
- direction: 1 | 0 | -1;
1416
- level: number;
1417
- point?: {
1418
- x: number;
1419
- y: number;
1420
- };
1421
- onChange: (payload: {
1422
- level: number;
1423
- width: number;
1424
- height: number;
1425
- }) => void;
1426
- }
1427
-
1428
- declare interface ZoomState {
1429
- level: number;
1430
- width: number;
1431
- height: number;
1432
- setZoom: (payload: {
1433
- level: number;
1434
- width: number;
1435
- 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[];
1436
1023
  }) => void;
1437
- 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;
1438
1029
  }
1439
1030
 
1440
1031
  export { }