Skip to content

BaseTool

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:45

new BaseTool(): BaseTool

BaseTool

protected callbacks: ToolCallbacks | null

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:49


protected imageId: ImageId | null

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:48


protected overlay: ToolOverlay | null

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:47


protected shortcuts: KeyboardShortcutMap | null

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:50


abstract readonly type: ToolType | "select"

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:46

Tool identifier

AnnotationTool.type

activate(overlay, imageId, callbacks, shortcuts): void

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:51

Called when the tool becomes active

ToolOverlay

ImageId

ToolCallbacks

KeyboardShortcutMap

void

AnnotationTool.activate


abstract cancel(): void

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:57

Cancel the current drawing interaction

void

AnnotationTool.cancel


deactivate(): void

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:53

Called when the tool is deactivated

void

AnnotationTool.deactivate


onKeyDown(event): boolean

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:52

Handle key down - returns true if the key was consumed

KeyboardEvent

boolean

AnnotationTool.onKeyDown


abstract onPointerDown(event, imagePoint): void

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:54

Handle pointer down — start drawing

PointerEvent

Point

void

AnnotationTool.onPointerDown


abstract onPointerMove(event, imagePoint): void

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:55

Handle pointer move — update drawing preview

PointerEvent

Point

void

AnnotationTool.onPointerMove


abstract onPointerUp(event, imagePoint): void

Defined in: packages/fabric-annotations/dist/tools/base-tool.d.ts:56

Handle pointer up — commit the annotation

PointerEvent

Point

void

AnnotationTool.onPointerUp