@univerjsuiindexinterfacesIbeforecloseservice

@univerjs/ui v0.5.4


Interface: IBeforeCloseService

Defined in: submodules/univer/packages/ui/src/services/before-close/before-close.service.ts:22

Methods

registerBeforeClose()

registerBeforeClose(callback): IDisposable

Defined in: submodules/univer/packages/ui/src/services/before-close/before-close.service.ts:30

Provide a callback to check if the web page could be closed safely.

Parameters

ParameterTypeDescription
callback() => undefined | stringThe 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

IDisposable


registerOnClose()

registerOnClose(callback): IDisposable

Defined in: submodules/univer/packages/ui/src/services/before-close/before-close.service.ts:37

Provide a callback to be called when the web page is closed.

Parameters

ParameterTypeDescription
callback() => voidThe callback to be called when the web page is closed.

Returns

IDisposable