@@ -63,6 +63,7 @@ export type ClassDefinition = {
6363 name : string ;
6464 id : number ;
6565 color : string ;
66+ keybind ?: string ;
6667} ;
6768
6869export type SliderInfo = {
@@ -194,6 +195,7 @@ export class ULabel {
194195 valid_class_ids : number [ ] ;
195196 toolbox_order ?: number [ ] ;
196197 filter_distance_overlay ?: FilterDistanceOverlay ;
198+ resize_observers : ResizeObserver [ ] ;
197199 /**
198200 * @link https://github.com/SenteraLLC/ulabel/blob/main/api_spec.md#ulabel-constructor
199201 */
@@ -221,8 +223,15 @@ export class ULabel {
221223 public show_whole_image ( ) : void ;
222224 public swap_frame_image ( new_src : string , frame ?: number ) : string ;
223225 public swap_anno_bg_color ( new_bg_color : string ) : string ;
226+
227+ // Subtasks
224228 public get_current_subtask_key ( ) : string ;
225229 public get_current_subtask ( ) : ULabelSubtask ;
230+ public readjust_subtask_opacities ( ) : void ;
231+ public set_subtask ( st_key : string ) : void ;
232+ public switch_to_next_subtask ( ) : void ;
233+
234+ // Annotations
226235 public get_annotations ( subtask : ULabelSubtask ) : ULabelAnnotation [ ] ;
227236 public set_annotations ( annotations : ULabelAnnotation [ ] , subtask : ULabelSubtask ) ;
228237 public set_saved ( saved : boolean ) ;
@@ -245,14 +254,108 @@ export class ULabel {
245254 dist_prop : number ;
246255 } ,
247256 ) : void ;
248- public toggle_erase_mode ( mouse_event : JQuery . TriggeredEvent ) : void ;
249- public toggle_brush_mode ( mouse_event : JQuery . TriggeredEvent ) : void ;
257+
258+ // Brush
259+ // TODO (joshua-dean): should these actually be optional?
260+ public toggle_erase_mode ( mouse_event ?: JQuery . TriggeredEvent ) : void ;
261+ public toggle_brush_mode ( mouse_event ?: JQuery . TriggeredEvent ) : void ;
250262 public toggle_delete_class_id_in_toolbox ( ) : void ;
251263 public change_brush_size ( scale_factor : number ) : void ;
264+ public recolor_brush_circle ( ) : void ;
265+ public destroy_brush_circle ( ) : void ;
266+
267+ // Listeners
252268 public remove_listeners ( ) : void ;
253269 static get_allowed_toolbox_item_enum ( ) : AllowedToolboxItem ;
254270 static process_classes ( ulabel_obj : ULabel , arg1 : string , subtask_obj : ULabelSubtask ) ;
255271 static build_id_dialogs ( ulabel_obj : ULabel ) ;
272+
273+ // Annotation lifecycle
274+ // TODO (joshua-dean): type for redo_payload
275+ public begin_annotation ( mouse_event : JQuery . TriggeredEvent , redo_payload ?: object ) : void ;
276+ public create_annotation (
277+ spatial_type : ULabelSpatialType ,
278+ spatial_payload : ULabelSpatialPayload ,
279+ unique_id ?: string ,
280+ ) : void ;
281+ public create_nonspatial_annotation (
282+ redo_payload ?: object ,
283+ ) : void ;
284+ public delete_annotation (
285+ annotation_id : string ,
286+ redo_payload ?: object ,
287+ record_action ?: boolean ,
288+ ) : void ;
289+ public cancel_annotation ( redo_payload ?: object ) : void ;
290+ public get_active_class_id ( ) : number ;
291+ public get_active_class_id_idx ( ) : number ;
292+ public undo ( is_internal_undo ?: boolean ) : void ;
293+ public redo ( ) : void ;
294+
295+ // Mouse event handlers
296+ public handle_mouse_down ( mouse_event : JQuery . TriggeredEvent ) : void ;
297+ public handle_mouse_move ( mouse_event : JQuery . TriggeredEvent ) : void ;
298+ public handle_mouse_up ( mouse_event : JQuery . TriggeredEvent ) : void ;
299+ public handle_aux_click ( mouse_event : JQuery . TriggeredEvent ) : void ;
300+ public handle_wheel ( wheel_event : WheelEvent ) : void ;
301+ public start_drag (
302+ drag_key : string ,
303+ release_button : string ,
304+ mouse_event : JQuery . TriggeredEvent ,
305+ ) : void ;
306+ public end_drag ( mouse_event : JQuery . TriggeredEvent ) : void ;
307+ public drag_repan ( mouse_event : JQuery . TriggeredEvent ) : void ;
308+ public drag_rezoom ( mouse_event : JQuery . TriggeredEvent ) : void ;
309+
310+ // "Mouse event interpreters"
311+ public get_global_mouse_x ( mouse_event : JQuery . TriggeredEvent ) : number ;
312+ public get_global_mouse_y ( mouse_event : JQuery . TriggeredEvent ) : number ;
313+
314+ // Edit suggestions
315+ public suggest_edits (
316+ mouse_event ?: JQuery . TriggeredEvent ,
317+ nonspatial_id ?: string ,
318+ ) : void ;
319+ public show_global_edit_suggestion (
320+ annid : string ,
321+ offset ?: {
322+ diffX : number ;
323+ diffY : number ;
324+ diffZ ?: number ;
325+ } ,
326+ nonspatial_id ?: string ,
327+ ) : void ;
328+ public hide_global_edit_suggestion ( ) : void ;
329+
330+ // Drawing
331+ public rezoom (
332+ foc_x ?: number ,
333+ foc_y ?: number ,
334+ abs ?: boolean ,
335+ ) : void ;
336+ public reposition_dialogs ( ) : void ;
337+ public handle_toolbox_overflow ( ) : void ;
338+
339+ // ID Dialog
340+ public set_id_dialog_payload_nopin (
341+ class_ind : number ,
342+ dist_prop : number
343+ ) : void ;
344+ public update_id_dialog_display (
345+ front ?: boolean ,
346+ ) : void ;
347+ public handle_id_dialog_click (
348+ mouse_event : JQuery . TriggeredEvent ,
349+ annotation_id ?: string ,
350+ new_class_idx ?: number ,
351+ ) : void ;
352+ public show_id_dialog (
353+ gbx : number ,
354+ gby : number ,
355+ active_ann : string , // annotation id
356+ thumbnail ?: boolean ,
357+ nonspatial ?: boolean ,
358+ ) : void ;
256359}
257360
258361declare global {
0 commit comments