UNPKG

@whitesev/pops

Version:

弹窗库

740 lines (739 loc) 1.21 MB
import type { PopsAlertDetails } from "./components/alert/indexType"; import type { PopsConfirmDetails } from "./components/confirm/indexType"; import type { PopsPromptDetails } from "./components/prompt/indexType"; import type { PopsLoadingDetails } from "./components/loading/indexType"; import type { PopsIframeDetails } from "./components/iframe/indexType"; import type { PopsToolTipDetails } from "./components/tooltip/indexType"; import type { PopsDrawerDetails } from "./components/drawer/indexType"; import type { PopsFolderDetails } from "./components/folder/indexType"; import type { PopsPanelDetails } from "./components/panel/indexType"; import type { PopsRightClickMenuDetails } from "./components/rightClickMenu/indexType"; import type { PopsSearchSuggestionDetails } from "./components/searchSuggestion/indexType"; declare class Pops { /** 配置 */ config: { /** 版本号 */ version: string; cssText: { index: string; ninePalaceGridPosition: string; scrollbar: string; button: string; common: string; anim: string; alertCSS: string; confirmCSS: string; promptCSS: string; loadingCSS: string; iframeCSS: string; tooltipCSS: string; drawerCSS: string; folderCSS: string; panelCSS: string; rightClickMenu: string; }; /** icon图标的svg代码 */ iconSVG: { loading: string; min: string; max: string; mise: string; close: string; edit: string; share: string; delete: string; search: string; upload: string; next: string; prev: string; eleme: string; elemePlus: string; chromeFilled: string; cpu: string; videoPlay: string; videoPause: string; headset: string; monitor: string; documentCopy: string; picture: string; circleClose: string; view: string; hide: string; keyboard: string; arrowRight: string; arrowLeft: string; }; /** 当前已配置的动画@keyframes名字映射(初始化时生成) */ animation: { [key: string]: CSSKeyframesRule; }; /** 存储已创建的元素 */ layer: { iframe: import("./types/layer").PopsLayerCommonConfig[]; loading: import("./types/layer").PopsLayerCommonConfig[]; folder: import("./types/layer").PopsLayerCommonConfig[]; alert: import("./types/layer").PopsLayerCommonConfig[]; confirm: import("./types/layer").PopsLayerCommonConfig[]; prompt: import("./types/layer").PopsLayerCommonConfig[]; drawer: import("./types/layer").PopsLayerCommonConfig[]; panel: import("./types/layer").PopsLayerCommonConfig[]; tooltip: import("./types/layer").PopsLayerCommonConfig[]; rightClickMenu: import("./types/layer").PopsLayerCommonConfig[]; }; /** 禁止滚动 */ forbiddenScroll: { event(event: Event): boolean; }; /** pops使用的工具类 */ Utils: { isWin(target: any): boolean; isDOM(target: any): boolean; delete(target: any, propName: any): void; assign<T1, T2 extends object, T3 extends boolean>(target: T1, source: T2, isAdd?: T3 | undefined): T3 extends true ? T1 & T2 : T1; getRandomGUID(): string; contains(target: any): boolean; contains(context: any, target?: any): boolean; formatTime(text?: string | number | Date, formatType?: string): string; formatTime(text?: string | number | Date, formatType?: "yyyy-MM-dd HH:mm:ss" | "yyyy/MM/dd HH:mm:ss" | "yyyy_MM_dd_HH_mm_ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH\u65F6mm\u5206ss\u79D2" | "yyyy\u5E74MM\u6708dd\u65E5 hh:mm:ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH:mm:ss" | "yyyy-MM-dd" | "yyyyMMdd" | "HH:mm:ss"): string; formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T | undefined): T extends true ? string : number; AnyTouch: () => typeof import("any-touch").default; isPhone(userAgent?: string): boolean; setTimeout(callback: Function, timeout?: number): number; clearTimeout(timeId: number | undefined): void; setInterval(callback: Function, timeout?: number): number; clearInterval(timeId: number | undefined): void; }; /** pops使用的DOM工具类 */ DOMUtils: { getAnimationEndNameList(): string[]; getTransitionEndNameList(): string[]; offset(element: HTMLElement, calcScroll?: boolean): DOMRect; width(element: HTMLElement | string | Window | Document | typeof globalThis, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number; height(element: HTMLElement | string | Window | Document | typeof globalThis, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number; outerWidth(element: HTMLElement | string | Window | Document, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number; outerHeight(element: HTMLElement | string | Window, isShow?: boolean, parent?: HTMLElement | ShadowRoot): number; addClassName(element: HTMLElement, className: string): void; removeClassName(element: HTMLElement, className: string): void; containsClassName(element: HTMLElement, className: string): boolean; css(element: HTMLElement | string, property: keyof CSSStyleDeclaration): string; css(element: HTMLElement | string, property: string): string; css(element: HTMLElement | string, property: keyof CSSStyleDeclaration & string, value: string | number): string; css(element: HTMLElement | string, property: { [P in keyof CSSStyleDeclaration]?: CSSStyleDeclaration[P]; } | { [key: string]: string | number; }): string; createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, property?: ({ [P in keyof HTMLElementTagNameMap[K]]?: HTMLElementTagNameMap[K][P] extends string | boolean | number ? HTMLElementTagNameMap[K][P] : never; } & { [key: string]: any; }) | string, attributes?: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsCreateElementAttributesMap): HTMLElementTagNameMap[K]; parseTextToDOM<R extends HTMLElement>(elementString: string): R; getTextBoundingRect(input: HTMLInputElement | HTMLTextAreaElement, selectionStart: number | string, selectionEnd: number | string, debug: boolean): DOMRect; cssHide(ele: Element | null, isImportant?: boolean): void; cssShow(ele: Element | null): void; parseHTML<T1 extends boolean, T2 extends boolean>(html: string, useParser?: T1 | undefined, isComplete?: T2 | undefined): import("./types/PopsDOMUtilsEventType").ParseHTMLReturnType<T1, T2>; append(element: Element | Node | ShadowRoot | HTMLElement | string, content: HTMLElement | string | (HTMLElement | string | Element)[] | NodeList): void; appendHead($ele: HTMLElement): void; appendBody($ele: HTMLElement): void; isShow(element: HTMLElement): boolean; showElement($ele: HTMLElement, ownParent?: Node): { cloneNode: HTMLElement; recovery(): void; }; getStyleValue(element: HTMLElement | CSSStyleDeclaration, styleName: string): number; before(element: HTMLElement | Element | string, content: HTMLElement | string): void; after(element: HTMLElement | Element | string, content: HTMLElement | string): void; getKeyFrames(sheet: CSSStyleSheet): {}; on<T extends import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: T | T[], callback: (this: HTMLElement, event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event[T]) => void, option?: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOption | boolean): void; on<T extends Event>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string | string[], callback: (this: HTMLElement, event: T) => void, option?: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOption | boolean): void; on<T extends import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: T | T[], selector: string | string[] | undefined | null, callback: (this: HTMLElement, event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event[T], selectorTarget: HTMLElement) => void, option?: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOption | boolean): void; on<T extends Event>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string | string[], selector: string | string[] | undefined | null, callback: (this: HTMLElement, event: T, selectorTarget: HTMLElement) => void, option?: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOption | boolean): void; off<T extends import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: T | T[], callback?: ((this: HTMLElement, event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event[T]) => void) | undefined, option?: EventListenerOptions | boolean, filter?: (value: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute, index: number, array: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute[]) => boolean): void; off<T extends Event>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string | string[], callback?: ((this: HTMLElement, event: T) => void) | undefined, option?: EventListenerOptions | boolean, filter?: (value: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute, index: number, array: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute[]) => boolean): void; off<T extends import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: T | T[], selector?: string | string[] | undefined | null, callback?: ((this: HTMLElement, event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event[T], selectorTarget: HTMLElement) => void) | undefined, option?: EventListenerOptions | boolean, filter?: (value: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute, index: number, array: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute[]) => boolean): void; off<T extends Event>(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType: string | string[], selector?: string | string[] | undefined | null, callback?: ((this: HTMLElement, event: T, selectorTarget: HTMLElement) => void) | undefined, option?: EventListenerOptions | boolean, filter?: (value: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute, index: number, array: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsEventListenerOptionsAttribute[]) => boolean): void; offAll(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType?: string): void; offAll(element: import("./types/PopsDOMUtilsEventType").PopsDOMUtilsElementEventType, eventType?: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType | import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType[]): void; ready<T extends Function>(callback: T): void; trigger(element: HTMLElement | string | NodeList | any[] | Window | Document, eventType: string | string[], details?: object, useDispatchToTriggerEvent?: boolean): void; trigger(element: HTMLElement | string | NodeList | any[] | Window | Document, eventType: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType | import("./types/PopsDOMUtilsEventType").PopsDOMUtils_EventType[], details?: object, useDispatchToTriggerEvent?: boolean): void; click(element: HTMLElement | string | Window, handler?: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["click"]) => void, details?: any, useDispatchToTriggerEvent?: boolean): void; blur(element: HTMLElement | string | Window, handler?: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["blur"]) => void, details?: object, useDispatchToTriggerEvent?: boolean): void; focus(element: HTMLElement | string | Window, handler?: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["focus"]) => void, details?: object, useDispatchToTriggerEvent?: boolean): void; hover(element: HTMLElement | string, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["hover"]) => void, option?: boolean | AddEventListenerOptions): void; keyup(target: HTMLElement | string | Window | typeof globalThis, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["keyup"]) => void, option?: boolean | AddEventListenerOptions): void; keydown(target: HTMLElement | Window | typeof globalThis | string, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["keydown"]) => void, option?: boolean | AddEventListenerOptions): void; keypress(target: HTMLElement | Window | typeof globalThis | string, handler: (event: import("./types/PopsDOMUtilsEventType").PopsDOMUtils_Event["keypress"]) => void, option?: boolean | AddEventListenerOptions): void; preventEvent(event: Event): boolean; preventEvent(element: HTMLElement, eventNameList?: string | string[], capture?: boolean): boolean; selector<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | undefined; selector<E extends Element = Element>(selector: string): E | undefined; selectorAll<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K][]; selectorAll<E extends Element = Element>(selector: string): E[]; matches($el: HTMLElement | Element | null | undefined, selector: string): boolean; closest<K extends keyof HTMLElementTagNameMap>($el: HTMLElement | Element, selector: string): HTMLElementTagNameMap[K] | null; closest<E extends Element = Element>($el: HTMLElement | Element, selector: string): E | null; }; /** pops创建的实例使用的工具类 */ InstanceUtils: { getMaxZIndexNodeInfo(deviation?: number, target?: Element | ShadowRoot | Document, ignoreCallBack?: ($ele: Element | HTMLElement | ShadowRoot) => boolean | void): { node: Element; zIndex: number; }; getPopsMaxZIndex(deviation?: number): { zIndex: number; animElement: HTMLDivElement | null; isOverMaxZIndex: boolean; }; getMaxZIndex(deviation?: number): number; removeInstance(moreLayerConfigList: import("./types/layer").PopsLayerCommonConfig[][], guid: string, isAll?: boolean): import("./types/layer").PopsLayerCommonConfig[][]; hide(popsType: import("./types/main").PopsLayerMode, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement: HTMLElement): Promise<void>; show(popsType: import("./types/main").PopsLayerMode, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement, maskElement?: HTMLElement): Promise<void>; close(popsType: string, layerConfigList: import("./types/layer").PopsLayerCommonConfig[], guid: string, config: PopsAlertDetails | PopsDrawerDetails | PopsPromptDetails | PopsConfirmDetails | PopsIframeDetails | PopsLoadingDetails | PopsPanelDetails | PopsFolderDetails, animElement: HTMLElement): Promise<void>; drag(moveElement: HTMLElement, options: { dragElement: HTMLElement; limit: boolean; triggerClick?: boolean; extraDistance: number; container?: Window | typeof globalThis | HTMLElement; moveCallBack?: (moveElement: HTMLElement, left: number, top: number) => void; endCallBack?: (moveElement: HTMLElement, left: number, top: number) => void; preventEvent?: (event: TouchEvent | PointerEvent) => boolean; }): void; sortElementListByProperty<T extends unknown, R>(getBeforeValueFun: (value: T) => R, getAfterValueFun: (value: T) => R, sortByDesc?: boolean): (after_obj: T, before_obj: T) => 1 | 0 | -1; }; /** pops处理float类型使用的工具类 */ MathFloatUtils: { isFloat(num: number): boolean; add(number1: number, number2: number): number; sub(number1: number, number2: number): string; division(number1: number, number2: number): number; }; /** pops.panel中用于处理各个类型的工具 */ panelHandleContentUtils: () => { asideULElement: HTMLUListElement; sectionContainerHeaderULElement: HTMLUListElement; sectionContainerULElement: HTMLUListElement; $el: { $content: HTMLDivElement; $contentAside: HTMLDivElement; $contentSectionContainer: HTMLDivElement; }; init(details: { config: Required<PopsPanelDetails>; $el: { $content: HTMLDivElement; $contentAside: HTMLDivElement; $contentSectionContainer: HTMLDivElement; }; }): void; clearContainer(): void; clearAsideItemIsVisited(): void; setAsideItemIsVisited(element: HTMLElement): void; setElementAttributes(element: HTMLElement, attributes?: any): void; setElementProps(element: HTMLElement, props?: any): void; setElementClassName(element: HTMLElement, className?: string | string[] | (() => string | string[])): void; createAsideItem(asideConfig: import("./components/panel/indexType").PopsPanelContentConfig): HTMLLIElement; createSectionContainerItem_switch(formConfig: import("./components/panel/switchType").PopsPanelSwitchDetails): HTMLLIElement; createSectionContainerItem_slider(formConfig: import("./components/panel/sliderType").PopsPanelSliderDetails): HTMLLIElement; createSectionContainerItem_slider_new(formConfig: import("./components/panel/sliderType").PopsPanelSliderDetails): HTMLLIElement; createSectionContainerItem_input(formConfig: import("./components/panel/inputType").PopsPanelInputDetails): HTMLLIElement; createSectionContainerItem_textarea(formConfig: import("./components/panel/textareaType").PopsPanelTextAreaDetails): HTMLLIElement; createSectionContainerItem_select(formConfig: import("./components/panel/selectType").PopsPanelSelectDetails<any>): HTMLLIElement; createSectionContainerItem_select_multiple_new(formConfig: import("./components/panel/selectMultipleType").PopsPanelSelectMultipleDetails<any>): HTMLLIElement; createSectionContainerItem_button(formConfig: import("./components/panel/buttonType").PopsPanelButtonDetails): HTMLLIElement; createSectionContainerItem_deepMenu(formConfig: import("./components/panel/deepMenuType").PopsPanelDeepMenuDetails): HTMLLIElement; createSectionContainerItem_own(formConfig: import("./components/panel/ownType").PopsPanelOwnDetails): HTMLLIElement; createSectionContainerItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails): HTMLLIElement | undefined; createSectionContainerItem_forms(formConfig: import("./components/panel/indexType").PopsPanelContentConfig | import("./components/panel/formsType").PopsPanelFormsDetails): void; uListContainerAddItem(formConfig: import("./components/panel/indexType").PopsPanelFormsTotalDetails, containerOptions: Omit<import("./components/panel/commonType").PopsPanelRightAsideContainerOptions, "target">): void; setAsideItemClickEvent(asideLiElement: HTMLElement, asideConfig: import("./components/panel/indexType").PopsPanelContentConfig): void; }; }; init(): void; /** * 释放原有的pops控制权 * @example * let pops = window.pops.noConflict() */ noConflict(): Pops; /** * 通过navigator.userAgent判断是否是手机访问 * @param userAgent */ isPhone(userAgent?: string): boolean; /** * 为所有弹窗设置全局属性 */ GlobalConfig: { config: { style?: string | (() => string) | null; zIndex?: (number | (() => number) | null) | (string | (() => string) | null); } & Partial<import("./types/components").PopsCommonConfig>; setGlobalConfig(config: { style?: string | (() => string) | null; zIndex?: (number | (() => number) | null) | (string | (() => string) | null); } & Partial<import("./types/components").PopsCommonConfig>): void; getGlobalConfig(): { style?: string | undefined; zIndex?: string | number | undefined; useShadowRoot?: boolean | undefined; class?: string | undefined; only?: boolean | undefined; width?: string | undefined; height?: string | undefined; position?: import("./types/position").PopsPosition | undefined; animation?: import("./types/animation").PopsAnimation | undefined; mask?: import("./types/mask").PopsMaskDetails | undefined; forbiddenScroll?: boolean | undefined; beforeAppendToPageCallBack?: void; }; }; /** * 普通信息框 * @param details 配置 */ alert: (details: PopsAlertDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">; /** * 询问框 * @param details 配置 */ confirm: (details: PopsConfirmDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">; /** * 输入框 * @param details 配置 */ prompt: (details: PopsPromptDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">; /** * 加载层 * @param details 配置 */ loading: (details: PopsLoadingDetails) => Omit<Omit<import("./types/event").PopsEventDetails, "$shadowContainer" | "$shadowRoot">, "function" | "type">; /** * iframe层 * @param details 配置 */ iframe: (details: PopsIframeDetails) => Omit<import("./types/event").PopsEventDetails & { iframeElement: HTMLIFrameElement; }, "function" | "type">; /** * 提示框 * @param details 配置 */ tooltip: (details: PopsToolTipDetails) => { guid: string; config: { target: HTMLElement; content: string | (() => string); isDiffContent: boolean; position: import("./components/tooltip/indexType").PopsTooltipPosition; className: string; isFixed: boolean; alwaysShow: boolean; delayCloseTime: number; triggerShowEventName: string; triggerCloseEventName: string; eventOption: { once: boolean; passive: boolean; signal: { readonly aborted: boolean; onabort: ((this: AbortSignal, ev: Event) => any) | null; readonly reason: any; throwIfAborted: () => void; addEventListener: { <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; removeEventListener: { <K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; }; dispatchEvent: (event: Event) => boolean; }; capture: boolean; }; showBeforeCallBack: ($toolTip: HTMLElement) => false | void; showAfterCallBack: ($toolTip: HTMLElement) => void; closeBeforeCallBack: ($toolTip: HTMLElement) => false | void; closeAfterCallBack: ($toolTip: HTMLElement) => void; showArrow: boolean; arrowDistance: number; otherDistance: number; useShadowRoot: boolean; only: boolean; zIndex: number | (() => number); style: string | null; beforeAppendToPageCallBack: ($shadowRoot: ShadowRoot | HTMLElement, $shadowContainer: HTMLDivElement) => void; }; $shadowContainer: HTMLDivElement; $shadowRoot: HTMLDivElement | ShadowRoot; toolTip: import("./components/tooltip").ToolTip; }; /** * 抽屉 * @param details 配置 */ drawer: (details: PopsDrawerDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">; /** * 文件夹 * @param details 配置 */ folder: (details: PopsFolderDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">; /** * 配置面板 * @param details 配置 */ panel: (details: PopsPanelDetails) => Omit<import("./types/event").PopsEventDetails, "function" | "type">; /** * 右键菜单 * @param details 配置 */ rightClickMenu: (details: PopsRightClickMenuDetails) => { guid: string; config: { target: Node | HTMLElement | { addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void; dispatchEvent: (event: Event) => boolean; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void; } | { [x: number]: /*elided*/ any; readonly clientInformation: { readonly clipboard: { read: () => Promise<ClipboardItems>; readText: () => Promise<string>; write: (data: ClipboardItems) => Promise<void>; writeText: (data: string) => Promise<void>; addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void; dispatchEvent: (event: Event) => boolean; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void; }; readonly credentials: { create: (options?: CredentialCreationOptions) => Promise<Credential | null>; get: (options?: CredentialRequestOptions) => Promise<Credential | null>; preventSilentAccess: () => Promise<void>; store: (credential: Credential) => Promise<void>; }; readonly doNotTrack: string | null; readonly geolocation: { clearWatch: (watchId: number) => void; getCurrentPosition: (successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions) => void; watchPosition: (successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions) => number; }; readonly maxTouchPoints: number; readonly mediaCapabilities: { decodingInfo: (configuration: MediaDecodingConfiguration) => Promise<MediaCapabilitiesDecodingInfo>; encodingInfo: (configuration: MediaEncodingConfiguration) => Promise<MediaCapabilitiesEncodingInfo>; }; readonly mediaDevices: { ondevicechange: ((this: MediaDevices, ev: Event) => any) | null; enumerateDevices: () => Promise<MediaDeviceInfo[]>; getDisplayMedia: (options?: DisplayMediaStreamOptions) => Promise<MediaStream>; getSupportedConstraints: () => MediaTrackSupportedConstraints; getUserMedia: (constraints?: MediaStreamConstraints) => Promise<MediaStream>; addEventListener: { <K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; removeEventListener: { <K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; }; dispatchEvent: (event: Event) => boolean; }; readonly mediaSession: { metadata: { album: string; artist: string; artwork: readonly { sizes: string; src: string; type: string; }[]; title: string; } | null; playbackState: MediaSessionPlaybackState; setActionHandler: (action: MediaSessionAction, handler: MediaSessionActionHandler | null) => void; setPositionState: (state?: MediaPositionState) => void; }; readonly permissions: { query: (permissionDesc: PermissionDescriptor) => Promise<PermissionStatus>; }; readonly serviceWorker: { readonly controller: { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; postMessage: { (message: any, transfer: Transferable[]): void; (message: any, options?: StructuredSerializeOptions): void; }; addEventListener: { <K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; removeEventListener: { <K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; }; dispatchEvent: (event: Event) => boolean; onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null; } | null; oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null; onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null; onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null; readonly ready: { then: <TResult1 = ServiceWorkerRegistration, TResult2 = never>(onfulfilled?: ((value: ServiceWorkerRegistration) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>; catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined) => Promise<ServiceWorkerRegistration | TResult>; finally: (onfinally?: (() => void) | null | undefined) => Promise<ServiceWorkerRegistration>; readonly [Symbol.toStringTag]: string; }; getRegistration: (clientURL?: string | URL) => Promise<ServiceWorkerRegistration | undefined>; getRegistrations: () => Promise<ReadonlyArray<ServiceWorkerRegistration>>; register: (scriptURL: string | URL, options?: RegistrationOptions) => Promise<ServiceWorkerRegistration>; startMessages: () => void; addEventListener: { <K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; removeEventListener: { <K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; }; dispatchEvent: (event: Event) => boolean; }; readonly userActivation: { readonly hasBeenActive: boolean; readonly isActive: boolean; }; readonly wakeLock: { request: (type?: WakeLockType) => Promise<WakeLockSentinel>; }; canShare: (data?: ShareData) => boolean; getGamepads: () => (Gamepad | null)[]; requestMIDIAccess: (options?: MIDIOptions) => Promise<MIDIAccess>; requestMediaKeySystemAccess: (keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]) => Promise<MediaKeySystemAccess>; sendBeacon: (url: string | URL, data?: BodyInit | null) => boolean; share: (data?: ShareData) => Promise<void>; vibrate: (pattern: VibratePattern) => boolean; readonly webdriver: boolean; clearAppBadge: () => Promise<void>; setAppBadge: (contents?: number) => Promise<void>; readonly hardwareConcurrency: number; registerProtocolHandler: (scheme: string, url: string | URL) => void; readonly cookieEnabled: boolean; readonly appCodeName: string; readonly appName: string; readonly appVersion: string; readonly platform: string; readonly product: string; readonly productSub: string; readonly userAgent: string; readonly vendor: string; readonly vendorSub: string; readonly language: string; readonly languages: ReadonlyArray<string>; readonly locks: { query: () => Promise<LockManagerSnapshot>; request: { (name: string, callback: LockGrantedCallback): Promise<any>; (name: string, options: LockOptions, callback: LockGrantedCallback): Promise<any>; }; }; readonly onLine: boolean; readonly mimeTypes: { [x: number]: { readonly description: string; readonly enabledPlugin: { [x: number]: /*elided*/ any; readonly description: string; readonly filename: string; readonly length: number; readonly name: string; item: (index: number) => MimeType | null; namedItem: (name: string) => MimeType | null; }; readonly suffixes: string; readonly type: string; }; readonly length: number; item: (index: number) => MimeType | null; namedItem: (name: string) => MimeType | null; }; readonly pdfViewerEnabled: boolean; readonly plugins: { [x: number]: { [x: number]: { readonly description: string; readonly enabledPlugin: /*elided*/ any; readonly suffixes: string; readonly type: string; }; readonly description: string; readonly filename: string; readonly length: number; readonly name: string; item: (index: number) => MimeType | null; namedItem: (name: string) => MimeType | null; }; readonly length: number; item: (index: number) => Plugin | null; namedItem: (name: string) => Plugin | null; refresh: () => void; }; javaEnabled: () => boolean; readonly storage: { estimate: () => Promise<StorageEstimate>; getDirectory: () => Promise<FileSystemDirectoryHandle>; persist: () => Promise<boolean>; persisted: () => Promise<boolean>; }; }; readonly closed: boolean; readonly customElements: { define: (name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions) => void; get: (name: string) => CustomElementConstructor | undefined; getName: (constructor: CustomElementConstructor) => string | null; upgrade: (root: Node) => void; whenDefined: (name: string) => Promise<CustomElementConstructor>; }; readonly devicePixelRatio: number; readonly document: Document; readonly event: { readonly bubbles: boolean; cancelBubble: boolean; readonly cancelable: boolean; readonly composed: boolean; readonly currentTarget: { addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void; dispatchEvent: (event: Event) => boolean; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void; } | null; readonly defaultPrevented: boolean; readonly eventPhase: number; readonly isTrusted: boolean; returnValue: boolean; readonly srcElement: { addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void; dispatchEvent: (event: Event) => boolean; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void; } | null; readonly target: { addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void; dispatchEvent: (event: Event) => boolean; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void; } | null; readonly timeStamp: DOMHighResTimeStamp; readonly type: string; composedPath: () => EventTarget[]; initEvent: (type: string, bubbles?: boolean, cancelable?: boolean) => void; preventDefault: () => void; stopImmediatePropagation: () => void; stopPropagation: () => void; readonly NONE: 0; readonly CAPTURING_PHASE: 1; readonly AT_TARGET: 2; readonly BUBBLING_PHASE: 3; } | undefined; readonly external: { AddSearchProvider: () => void; IsSearchProviderInstalled: () => void; }; readonly frameElement: Element | null; readonly frames: /*elided*/ any; readonly history: { readonly length: number; scrollRestoration: ScrollRestoration; readonly state: any; back: () => void; forward: () => void; go: (delta?: number) => void; pushState: (data: any, unused: string, url?: string | URL | null) => void; replaceState: (data: any, unused: string, url?: string | URL | null) => void; }; readonly innerHeight: number; readonly innerWidth: number; readonly length: number; location: { readonly ancestorOrigins: { [x: number]: string; readonly length: number; contains: (string: string) => boolean; item: (index: number) => string | null; }; hash: string; host: string; hostname: string; href: string; toString: () => string; readonly origin: string; pathname: string; port: string; protocol: string; search: string; assign: (url: string | URL) => void; reload: () => void; replace: (url: string | URL) => void; }; readonly locationbar: { readonly visible: boolean; }; readonly menubar: { readonly visible: boolean; }; name: string; readonly navigator: { readonly clipboard: { read: () => Promise<ClipboardItems>; readText: () => Promise<string>; write: (data: ClipboardItems) => Promise<void>; writeText: (data: string) => Promise<void>; addEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean) => void; dispatchEvent: (event: Event) => boolean; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean) => void; }; readonly credentials: { create: (options?: CredentialCreationOptions) => Promise<Credential | null>; get: (options?: CredentialRequestOptions) => Promise<Credential | null>; preventSilentAccess: () => Promise<void>; store: (credential: Credential) => Promise<void>; }; readonly doNotTrack: string | null; readonly geolocation: { clearWatch: (watchId: number) => void; getCurrentPosition: (successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions) => void; watchPosition: (successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions) => number; }; readonly maxTouchPoints: number; readonly mediaCapabilities: { decodingInfo: (configuration: MediaDecodingConfiguration) => Promise<MediaCapabilitiesDecodingInfo>; encodingInfo: (configuration: MediaEncodingConfiguration) => Promise<MediaCapabilitiesEncodingInfo>; }; readonly mediaDevices: { ondevicechange: ((this: MediaDevices, ev: Event) => any) | null; enumerateDevices: () => Promise<MediaDeviceInfo[]>; getDisplayMedia: (options?: DisplayMediaStreamOptions) => Promise<MediaStream>; getSupportedConstraints: () => MediaTrackSupportedConstraints; getUserMedia: (constraints?: MediaStreamConstraints) => Promise<MediaStream>; addEventListener: { <K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; removeEventListener: { <K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; }; dispatchEvent: (event: Event) => boolean; }; readonly mediaSession: { metadata: { album: string; artist: string; artwork: readonly { sizes: string; src: string; type: string; }[]; title: string; } | null; playbackState: MediaSessionPlaybackState; setActionHandler: (action: MediaSessionAction, handler: MediaSessionActionHandler | null) => void; setPositionState: (state?: MediaPositionState) => void; };