2023-02-07 01:22:56 +03:00
|
|
|
declare module 'page-lifecycle/dist/lifecycle.mjs' {
|
2024-02-24 19:46:14 +03:00
|
|
|
type PageLifecycleState = 'active' | 'passive' | 'hidden' | 'frozen' | 'terminated'
|
2023-02-07 01:22:56 +03:00
|
|
|
|
2024-02-24 19:46:14 +03:00
|
|
|
interface PageLifecycleEvent extends Event {
|
|
|
|
newState: PageLifecycleState
|
|
|
|
oldState: PageLifecycleState
|
|
|
|
}
|
|
|
|
interface PageLifecycle extends EventTarget {
|
|
|
|
get state(): PageLifecycleState
|
|
|
|
get pageWasDiscarded(): boolean
|
|
|
|
addUnsavedChanges: (id: symbol | any) => void
|
|
|
|
removeUnsavedChanges: (id: symbol | any) => void
|
|
|
|
addEventListener: (type: string, listener: (evt: PageLifecycleEvent) => void) => void
|
|
|
|
}
|
|
|
|
const lifecycle: PageLifecycle
|
|
|
|
export default lifecycle
|
2023-02-07 01:22:56 +03:00
|
|
|
}
|