UNPKG

mustard-app

Version:

个人前端微应用建设中。。。

33 lines (32 loc) 1.54 kB
import { IAppStatusCN, MustardName, MustardURL } from './typings'; declare const rawAddEventListener: { <K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; type AddEventListenerParams = Parameters<typeof rawAddEventListener>; type EventListenerType = 'dataChange' | IAppStatusCN | keyof HTMLElementEventMap; type EventListenerListener = AddEventListenerParams[1]; type EventListenerOptions = AddEventListenerParams[2]; export declare class MustardApp extends HTMLElement { url: MustardURL; name: MustardName; checkUrlStop: () => void; static get observedAttributes(): string[]; constructor(); reload(): void; connectedCallback(): void; disconnectedCallback(): void; adoptedCallback(): void; /** * 属性变化 * @param name 属性名 * @param oldValue 属性旧值 * @param newValue 属性新值 */ attributeChangedCallback(name: any, oldValue: any, newValue: any): void; setAttribute(key: string, value: unknown): void; addEventListener(type: EventListenerType, listener: EventListenerListener, options?: EventListenerOptions): void; removeEventListener(type: EventListenerType, listener: EventListenerListener, options?: EventListenerOptions): void; } export declare function defineMustardAppElement(): void; export {};