@univerjs/ui v0.4.2 • Docs
Interface: IBeforeCloseService
Methods
registerBeforeClose()
registerBeforeClose(callback): IDisposable
Provide a callback to check if the web page could be closed safely.
Parameters
Parameter | Type | Description |
---|---|---|
callback | () => undefined | string | The callback to check if the web page could be closed safely. It should return a string to show a message to the user. If the return value is undefined, the web page could be closed safely. |
Returns
Defined in
packages/ui/src/services/before-close/before-close.service.ts:30 (opens in a new tab)
registerOnClose()
registerOnClose(callback): IDisposable
Provide a callback to be called when the web page is closed.
Parameters
Parameter | Type | Description |
---|---|---|
callback | () => void | The callback to be called when the web page is closed. |
Returns
Defined in
packages/ui/src/services/before-close/before-close.service.ts:37 (opens in a new tab)