Skip to content

Interface: WidgetDeclaration

Makaio Framework


Makaio Framework / contracts / 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.

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'),
},
},
],
},
};

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.


optional description?: 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.

`'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: 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.


optional scope?: UiScope

Defined in: ../../../packages/contracts/src/extension/contributions/widget-types.ts:157

Widget scope identifier.

Defaults to 'global' when not specified.