declare namespace viewer { /** * Utility class providing simplified access to the clients fullscreen API. The toggle can be used to toggle * fullscreen for a HTML element while managing the execution of custom toggle code. * * ``` * canvas.element.addEventListener('click', function() { gloperate.viewer.Fullscreen.toggle(canvas.element); }); * ``` * * Use `:fullscreen` (or `:-moz-full-screen`, `:-webkit-full-screen`, and `:-ms-full-screen`) selectors in order to * configure fullscreen specific style. Alternatively, an additional class, e.g., `fullscreen`, could be toggled * via callaback. */ class Fullscreen { /** * Cached fullscreenchange event function of the clients specific fullscreen API. */ protected static _event: string; /** * Callback that is to be triggered within the remove event listener. */ protected static _callback: (() => void) | undefined; /** * Backup of the element's initial width and height. */ protected static _size: [string, string]; /** * Cached exit call of the clients specific fullscreen API. */ protected static _exit: () => void; /** * Cached request call of the clients specific fullscreen API. */ protected static _request: (element: HTMLElement) => void; /** * Cached element call returning the fullscreen element specific to the clients fullscreen API. */ protected static _element: () => HTMLElement; /** * Event listener used to add the remove event listener using on indirection, that is, the first fullscreen * event triggered after a request is ignored. This is important for triggering the fullscreen callback before * the request is completed. The listener adds the removeListener and removes itself as listener. */ protected static addEventListener: EventListener; /** * Event listener that is used to account for implicit fullscreen exit events, e.g., user explicitly uses a GUI * element for entering fullscreen, but uses ESC to exit fullscreen. The listener triggers the callback provided * on toggle and removes itself as listener. */ protected static removeEventListener: EventListener; /** * Query and cache the client specific fullscreen API. */ protected static queryAndCacheAPI(): void; /** * Returns whether or not a fullscreen element exists, indicating if fullscreen is active or not. */ static active(): boolean; /** * Requests or exits fullscreen mode for a given element. If the element is already in fullscreen, fullscreen * mode is exited. Else, fullscreen mode is requested. The function considers various platform specific * fullscreen interfaces, i.e., native, ms, moz, and webkit. * @param element - Element to toggle fullscreen state of. */ static toggle(element: HTMLElement, callback?: () => void): void; } } export = viewer;