UNPKG

ideaz-element

Version:

<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>

50 lines (49 loc) 2.37 kB
export interface EnhancedHTMLElement extends HTMLElement { webkitRequestFullScreen?: () => Promise<void>; mozRequestFullScreen?: () => Promise<void>; msRequestFullscreen?: () => Promise<void>; } export declare function isUndefined(val: unknown): val is undefined; /** * @description Determine whether the current state of the browser allows full screen access */ export declare function isFullscreenEnabled(): boolean; /** * @description Get Full Screen Elements */ export declare function getFullscreenElement(): Element | null; /** * @description Determine whether the current state is full screen */ export declare function isFullscreen(): boolean; /** * 退出全屏 * https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen */ export declare function exitFullscreen(): Promise<void>; /** * Enter full screen * https://developer.mozilla.org/zh-CN/docs/Web/API/Element/requestFullScreen * There is a problem with top layer stacking. If you want to avoid the problem caused by stacking order, * you need to manually determine the full screen status. If the current state is already full screen, you can exit full screen first and then let the target element enter full screen * @param {EnhancedHTMLElement} [element=document.body] - Full screen target element, default to body * @param {FullscreenOptions} options - Full screen options */ export declare function enterFullscreen(element?: EnhancedHTMLElement, options?: FullscreenOptions): Promise<void>; /** * @description Monitor full screen change events * @param {Function} callback * @param {boolean|AddEventListenerOptions} options Listening Event Options */ export declare function listenFullscreen(callback: EventListener, options?: boolean | AddEventListenerOptions): void; /** * @description Remove monitoring for full screen change events * @param {Function} callback * @param {boolean|EventListenerOptions} options Listening Event Options */ export declare function unlistenFullscreen(callback: EventListener, options?: boolean | EventListenerOptions): void; /** * Block the default behavior of the F11 button and call enter/exit full screen based on the current full screen state, * Resolve the issue of inconsistent status when entering full screen through both F11 button and API methods. */ export declare function patchF11DefaultAction(): void;