API Reference
@univerjs
@univerjs/ui
classes
Desktopbeforecloseservice

@univerjs/ui v0.4.2Docs


Class: DesktopBeforeCloseService

Implements

Constructors

new DesktopBeforeCloseService()

new DesktopBeforeCloseService(_notificationService): DesktopBeforeCloseService

Parameters

ParameterType
_notificationServiceINotificationService

Returns

DesktopBeforeCloseService

Defined in

packages/ui/src/services/before-close/before-close.service.ts:46 (opens in a new tab)

Methods

registerBeforeClose()

registerBeforeClose(callback): IDisposable

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

Implementation of

IBeforeCloseService.registerBeforeClose

Defined in

packages/ui/src/services/before-close/before-close.service.ts:50 (opens in a new tab)


registerOnClose()

registerOnClose(callback): IDisposable

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

Implementation of

IBeforeCloseService.registerOnClose

Defined in

packages/ui/src/services/before-close/before-close.service.ts:59 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.