mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-19 07:19:58 +00:00
18 lines
717 B
TypeScript
18 lines
717 B
TypeScript
declare module 'page-lifecycle/dist/lifecycle.mjs' {
|
|
type PageLifecycleState = 'pageshow' | 'resume' | 'focus' | 'blur' | 'pagehide' | 'unload' | 'visibilitychange' | 'freeze'
|
|
|
|
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
|
|
}
|