Wings Engine

Extension Built-in Properties

enabled

Whether this Extension is enabled.

1
enabled: boolean;

onEnable()

Called when this Extension is enabled.

1
onEnable(): void

onDisable()

Called when this Extension is disabled.

1
onDisable(): void

onPropertyChanged()

Called when a custom property changes.

1
2
3
4
5
/**
* Callback when the property value changes
* @param property Property name
*/
onPropertyChanged?(property: string);

element

The wdget mounted by this Extension.

1
readonly element: Element

Please refer to the Element class.

project

The project to which this Extension belongs.

1
readonly project: Project

Please refer to the Project Class.

iframe

When the Extension is mounted on an iframe widget, this object is used to communicate with the web page inside the iframe.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
* @since 4.2.0
*/
readonly iframe: IframeWrapper;

interface IframeWrapper {
/**
* Sends a message to the internal webpage of the iframe component
*/
postMessage(message: any, targetOrigin: string): void;
/**
* Receives messages sent from the internal webpage of the iframe component using postMessage
*/
onMessage(callback: (ev: {data: any, origin: string, source: MessageEventSource}) => void): void;
}