Interface: WidgetDeclaration
Makaio Framework / contracts / WidgetDeclaration
Interface: WidgetDeclaration
Section titled “Interface: WidgetDeclaration”Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:130
Widget declaration contributed by a package.
Packages declare widgets they provide. These are collected into a global catalog that the UI system uses to populate focus contexts.
Example
Section titled “Example”const statusExtension: MakaioExtension = { name: 'status-panel', ui: { widgets: [ { id: 'status-summary', name: 'Status Summary', description: 'Shows current runtime status', scope: 'global', definition: { dataSource: 'runtime.getStatus', refreshOn: ['runtime.ready', 'extension.stateChanged'], sizes: ['small', 'medium', 'large'], defaultSize: 'medium', }, renderers: { react: () => import('./widgets/StatusSummary.js'), }, }, ], },};Properties
Section titled “Properties”definition
Section titled “definition”definition:
WidgetDefinition
Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:164
Serializable widget definition.
Describes the widget’s data needs and behavior without platform-specific details. Can be serialized and stored in user preferences.
description?
Section titled “description?”
optionaldescription?:string
Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:151
Optional description of widget purpose.
Provides additional context about what the widget displays and when to use it.
id:
string
Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:138
Unique widget identifier.
Must be unique across all packages. Use the package name as a prefix to avoid collisions.
Example
Section titled “Example”`'status-summary'`, `'session-activity'`name:
string
Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:144
Display name for the widget.
Human-readable name shown in UI when users browse available widgets.
renderers
Section titled “renderers”renderers:
WidgetRenderers
Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:171
Platform-specific renderers.
Maps platform names to lazy-loaded component modules. At minimum, the
'react' platform is required for the web UI.
scope?
Section titled “scope?”
optionalscope?:UiScope
Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:157
Widget scope identifier.
Defaults to 'global' when not specified.