@claspo/document-connector
SDK connection layer for managing Claspo widget layouts, positioning, events, and resource loading in host documents
@claspo/document-connector / DocumentConnectorEventType
DocumentConnectorEventType
default
Enumeration Members
@claspo/document-connector / DocumentConnectorEvents.interface
DocumentConnectorEvents.interface
DocumentConnectorEventName
type DocumentConnectorEventName =
| default
| SysActionTypes
| SysEventTypes
| SysRouterEvent;@claspo/document-connector / StaticDocumentConnector
StaticDocumentConnector
default
Document connector for static (runtime) widget rendering. Handles the connection between the widget and the host document, managing component registration, resolution, and Google Fonts loading.
Extends
default
Constructors
Constructor
new default(params): default;Creates a new StaticDocumentConnector instance. Initializes the component register, resolver, and entry module for static rendering.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | WidgetInitConfigI | Widget initialization configuration. See WidgetInitConfigI at @claspo/common |
Returns
Overrides
BaseDocumentConnector.constructorMethods
connect()
connect(containerElement): Promise<any>;Connects the widget to the specified container element. Loads Google Fonts (unless disabled) and initializes the renderer.
Parameters
| Parameter | Type | Description |
|---|---|---|
containerElement | HTMLElement | The HTML element to render the widget into |
Returns
Promise<any>
Promise that resolves when the widget is connected and rendered
disconnect()
disconnect(): void;Disconnects the widget from the document. Cleans up controllers, entry module, and Google Fonts loader.
Returns
void
Overrides
BaseDocumentConnector.disconnecton()
on(eventName, listener): {
off: () => void;
};Subscribes to widget events with typed event names.
Parameters
| Parameter | Type | Description |
|---|---|---|
eventName | | DocumentConnectorEventName | "*" | The event name to listen for, or * to listen for all events |
listener | (value, eventName, params?) => void | Callback function invoked when the event is emitted |
Returns
{
off: () => void;
}An object with an off method to unsubscribe
| Name | Type |
|---|---|
off() | () => void |
Overrides
BaseDocumentConnector.onProperties
Updated 3 days ago
