Skip to main content

WidgetDescriptor

Provides metadata about the widget (such as name, description, available events and properties) without having to instantiate it. Used for command palettes, AI, etc

Constructors

new WidgetDescriptor()

new WidgetDescriptor(dart): WidgetDescriptor

Creates a widget descriptors from the Dart instance. Do not call directly.

Parameters

ParameterType
dartany

Returns

WidgetDescriptor

Source

src/viewer.ts:35

Properties

PropertyType
_props?Property[]
dartany

Accessors

description

get description(): string

Widget description

Returns

string

Source

src/viewer.ts:52


name

get name(): string

Widget name. Save as Viewer.type

Returns

string

Source

src/viewer.ts:46


properties

get properties(): Property[]

Widget properties

Returns

Property[]

Source

src/viewer.ts:55


synonyms

get synonyms(): string[]

Widget synonyms (mostly used for AI)

Returns

string[]

Source

src/viewer.ts:49

Methods

createIcon()

createIcon(): Element

Creates an icon for that widget.

Returns

Element

Source

src/viewer.ts:58


getByName()

static getByName(name): null | WidgetDescriptor

Returns the descriptor with the specified name.

Parameters

ParameterType
namestring

Returns

null | WidgetDescriptor

Source

src/viewer.ts:43


getDescriptors()

static getDescriptors(): WidgetDescriptor[]

Returns all registered widget descriptors.

Returns

WidgetDescriptor[]

Source

src/viewer.ts:40