Skip to content

@fabwcie/free-drawing / utils/widgets / getWidgetOptions

Function: getWidgetOptions() ​

getWidgetOptions<T>(widgets, id): T

Defined in: packages/free-drawing/src/utils/widgets.ts:46

Options of a widget from widgets option (empty with list form)

Type Parameters ​

T ​

T extends WidgetOptions = WidgetOptions

Parameters ​

widgets ​

WidgetsOptions

widgets option: list of names, or options by name

id ​

"pan" | "selection" | "brush" | "eraser" | "undo" | "redo" | "text" | "rect" | "circle" | "ellipse" | "square" | "arrow" | "line" | "star" | "triangle" | "polygon" | "diamond" | "heart" | "cloud" | "highlighter" | "laser" | "frame"

name of the widget

Returns ​

T

options given for the widget, empty object when none