io.iframesAPIinterface
IFrames API.
Properties (1)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| version⚓︎ | string | x | Version of the IFrames API. |
2 Methods
onCloseRequested()⚓︎
(callback: (instance: Instance, confirmClose: () => Promise<void>) => Promise<void>) => Unsubscribe
Notifies when an app that has been opened in an <iframe> element is about to be closed.
This method notifies about close requests only for <iframe> elements that have been created inside the current app instance.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (instance: Instance, confirmClose: () => Promise<void>) => Promise<void> | Callback function for handling the event. Receives as a first argument an object describing the app instance that is about to be closed.
Receives as a second argument a function that can be invoked to confirm to the io.Connect framework that the |
openApp()⚓︎
(config: OpenAppConfig) => Promise<Instance>
Opens an app instance in a newly created <iframe> element within the current app instance.
The app to open must be defined as an io.Connect app within the io.Connect framework.
It's also required to provide a container HTML element to which the newly created <iframe> will be appended as a child.
When the app is closed, you are responsible for removing the parent container element from the DOM if it's no longer needed.
You must not alter the id and name attributes of the created <iframe> element, as they are used by the IFrames API to identify the app instance.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| config⚓︎ | OpenAppConfig | Settings for opening the app in an |