toolset.io
Version:
39 lines (38 loc) • 1.07 kB
TypeScript
/**
* 专用的类型,用于适配 Vexip UI 中 `transfer` 属性的处理
*/
export interface TransferNode extends Element {
__transferElement?: Element | null;
}
export interface EventPayload extends EventInit {
/**
* 事件的类型
*/
type: string;
[prop: string]: any;
}
/**
* 当前是否可以使用触摸交互
*/
export declare const USE_TOUCH: boolean;
/**
* 当前点击的类型,可以使用触摸交互时为 `pointerdown`,否则为 `click`
*/
export declare const CLICK_TYPE: string;
/**
* 为指定的元素派发事件
*
* @param el 指定的元素
* @param payload 事件的属性
* @param Event 事件类
*
* @returns 事件是否派发成功
*/
export declare function dispatchEvent(el: Element, payload: EventPayload, Event?: {
new (type: string, eventInitDict?: EventInit | undefined): Event;
prototype: Event;
readonly AT_TARGET: number;
readonly BUBBLING_PHASE: number;
readonly CAPTURING_PHASE: number;
readonly NONE: number;
}): boolean;