81 lines
2.5 KiB
TypeScript
81 lines
2.5 KiB
TypeScript
declare const GLOBAL: any;
|
|
declare const IS_IOS: boolean;
|
|
declare function getPlatform(): string;
|
|
|
|
interface ChooseImageParams {
|
|
count?: number;
|
|
sizeType?: Array<string>;
|
|
sourceType?: Array<string>;
|
|
dom?: any;
|
|
}
|
|
interface ChooseVideoParams {
|
|
count?: number;
|
|
sourceType?: Array<string>;
|
|
dom?: any;
|
|
}
|
|
interface OutsideClickListenParams {
|
|
domRefs: any;
|
|
ignoreDomRefs?: any;
|
|
handler: (evt: MouseEvent) => void;
|
|
button?: number;
|
|
}
|
|
|
|
declare function chooseImage(options: ChooseImageParams): Promise<unknown>;
|
|
declare function chooseVideo(options: ChooseVideoParams): Promise<unknown>;
|
|
|
|
interface IDomRect {
|
|
id: string;
|
|
top: number;
|
|
left: number;
|
|
right: number;
|
|
width: number;
|
|
bottom: number;
|
|
height: number;
|
|
x?: number;
|
|
y?: number;
|
|
}
|
|
interface IScrollInfo {
|
|
scrollHeight: number;
|
|
scrollLeft: number;
|
|
scrollTop: number;
|
|
scrollWidth: number;
|
|
id: string;
|
|
}
|
|
interface IFields {
|
|
[key: string]: any;
|
|
}
|
|
declare function setInstanceMapping(instanceName: string, instance: any): void;
|
|
declare function getBoundingClientRect(selector: string | HTMLElement, instanceName?: string): Promise<IDomRect>;
|
|
declare function getBoundingClientRectSync(selector: string | HTMLElement): IDomRect;
|
|
declare function getScrollInfo(selector: string | HTMLElement, instanceName?: string): Promise<IScrollInfo>;
|
|
declare function getScrollInfoSync(selector: string | HTMLElement): IScrollInfo;
|
|
declare function getFields(selector: string | HTMLElement, instanceName?: string): Promise<IFields>;
|
|
|
|
declare class OutsideClick {
|
|
static instance: any;
|
|
private eventCallback;
|
|
private listener;
|
|
private button;
|
|
constructor();
|
|
private init;
|
|
listen(options: OutsideClickListenParams): void;
|
|
private remove;
|
|
}
|
|
|
|
interface ILongPressOptions {
|
|
duration?: number;
|
|
eventDelegation?: {
|
|
subSelector: string;
|
|
};
|
|
}
|
|
interface IAddLongPressEventListener {
|
|
element: HTMLElement;
|
|
onLongPress: (e: PointerEvent, target?: HTMLElement | undefined, currentTarget?: HTMLElement | undefined) => void;
|
|
options?: ILongPressOptions;
|
|
}
|
|
declare function addLongPressEventListener(args: IAddLongPressEventListener): void;
|
|
|
|
declare const outsideClick: OutsideClick;
|
|
|
|
export { GLOBAL as TUIGlobal, addLongPressEventListener as addLongPressListener, chooseImage, chooseVideo, getBoundingClientRect, getBoundingClientRectSync, getFields, getPlatform, getScrollInfo, getScrollInfoSync, IS_IOS as isIOS, outsideClick, setInstanceMapping };
|