page-active
Version:
Check and listen to all page visibility changes.
13 lines (12 loc) • 560 B
TypeScript
/**
* Listen to changes in page activation.
*
* @returns A callback used to remove the listener.
*/
export declare function listenToPageActivation(
/** If true, the callback will immediately be fired with whatever the current value is. */
fireImmediately: boolean,
/** This listener will be called any time the page activation changes. */
listener: (isPageActive: boolean) => void | Promise<void>): import("typed-event-target").RemoveListenerCallback;
/** Check if the current page is currently active. */
export declare function isPageActive(): boolean;