import { type ReactiveController, type ReactiveControllerHost } from 'lit'; import { LogDispatcher } from '../logger/LogDispatcher'; import { DisposalBin } from '../utils/events'; /** * The current page state. Important to note we only account for a subset of page states, as * the rest aren't valuable to the player at the moment. * * - **active:** A page is in the active state if it is visible and has input focus. * - **passive:** A page is in the passive state if it is visible and does not have input focus. * - **hidden:** A page is in the hidden state if it is not visible. * * @see https://developers.google.com/web/updates/2018/07/page-lifecycle-api#states */ export declare type PageState = 'active' | 'passive' | 'hidden'; /** * The current page visibility state. * * - **visible:** The page content may be at least partially visible. In practice, this means that * the page is the foreground tab of a non-minimized window. * - **hidden:** The page content is not visible to the user. In practice this means that the * document is either a background tab or part of a minimized window, or the OS screen lock is * active. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState */ export declare type PageVisibility = 'visible' | 'hidden'; /** * The callback function for a `PageController`. This is called when either the page * state or visibility changes. * * @see {@link PageState} * @see {@link PageVisibility} */ export declare type PageControllerCallback = ({ state: PageState, visibility: PageVisibilityState, }: { state: any; visibility: any; }) => void; /** * `PageController` detects page state or visibility changes for the life of the given `host` * element. * * @see {@link PageState} * @see {@link PageVisibility} * @see https://developers.google.com/web/updates/2018/07/page-lifecycle-api */ export declare class PageController implements ReactiveController { protected readonly _host: ReactiveControllerHost & EventTarget; protected readonly _callback: PageControllerCallback; protected readonly _logger: LogDispatcher | undefined; protected _state: PageState; protected _visibility: PageVisibility; protected _disposal: DisposalBin; protected _safariBeforeUnloadTimeout?: any; get state(): PageState; get visibility(): PageVisibility; constructor(_host: ReactiveControllerHost & EventTarget, _callback: PageControllerCallback, _logger?: LogDispatcher | undefined); hostConnected(): void; hostDisconnected(): void; protected _handlePageEvent(event: Event): void; protected _triggerCallback(): void; protected _determinePageState(event?: Event): PageState; } //# sourceMappingURL=PageController.d.ts.map