@fabwcie/free-drawing / utils/widgets
utils/widgets
Functions
getWidgetGroups()
getWidgetGroups(
groups,names):WidgetGroupOptions[]
Defined in: packages/free-drawing/src/utils/widgets.ts:41
Groups of widgets option with widgets of toolbar only (a widget in one group), groups without widgets ignored
Parameters
groups
widgetGroups option
names
Widgets of toolbar
Returns
copies of the groups with their valid widgets (a widget only in its first group)
getWidgetNames()
getWidgetNames(
widgets,known?):ToolbarWidgetName[]
Defined in: packages/free-drawing/src/utils/widgets.ts:16
Names of widgets option (list or object), in given order, unknown names are ignored
Parameters
widgets
widgets option: list of names, or options by name
known?
readonly ToolbarWidgetName[] = widgetNames
Names of existing widgets: of the library, and of plugins
Returns
known widget names (a warning for each unknown one)
getWidgetOptions()
getWidgetOptions<
T>(widgets,id):T
Defined in: packages/free-drawing/src/utils/widgets.ts:62
Options of a widget from widgets option (empty with list form)
Type Parameters
T
T extends WidgetOptions = WidgetOptions
Parameters
widgets
widgets option: list of names, or options by name
id
name of the widget
Returns
T
options given for the widget, empty object when none