@displayduck/base
v0.1.0
Published
Widget framework types and backend placeholders for DisplayDuck plugins.
Readme
@displayduck/base
Type definitions and backend placeholders for DisplayDuck widget plugins.
Install
npm install -D @displayduck/basePurpose
This package is intentionally not the runtime implementation.
The real behavior for these APIs is provided by the DisplayDuck backend build/runtime pipeline:
signal(...)effect(...)createWidgetClass(...)
This package exists so plugin authors get:
- TypeScript types
- autocomplete
- stable imports for plugin source code
Exports
signaleffectcreateWidgetClasstype Signaltype WritableSignaltype WidgetContexttype WidgetPayload
Example
import { signal, type WidgetContext } from '@displayduck/base';
export class DisplayDuckWidget {
public title = signal('Example');
public constructor(private readonly ctx: WidgetContext) {}
public onInit(): void {
this.ctx.setLoading(false);
}
}If you execute these APIs outside the DisplayDuck backend pipeline, the placeholder implementation will throw by design.
