import * as easy_dom_util from 'easy-dom-util'; import { TEleCommon, Ele, TEasyDomUtil, IJson } from 'easy-dom-util'; export { dom } from 'easy-dom-util'; import * as easy_dom_util_src_dom from 'easy-dom-util/src/dom'; import * as easy_dom_util_src_touchEvent from 'easy-dom-util/src/touchEvent'; declare enum ConfirmStyle { Default = "default", Yellow = "yellow", Yellow2 = "yellow2" } declare enum ConfirmType { Confirm = "confirm", Alert = "alert", Pop = "pop" } declare enum ToastPosition { Top = "top", Middle = "middle", Bottom = "bottom" } /* * @Author: chenzhongsheng * @Date: 2023-02-14 17:30:36 * @Description: Coding something */ type TNoneArgFn = ()=>void; type TUIEls = IJson & {isOpen: boolean}; interface IOpenHide { onopen?: ((mask: Ele)=>void)|null; onhide?: TNoneArgFn|null; } interface IConfirmDefault { (text: string | IConfirmOptions, title?: string, target?: IConfirm): Promise; create( text: string | IConfirmOptions, title?: string, fn?: IConfirmDefault ): Promise; close(target?: IConfirm): boolean; theme: ConfirmStyle; onOptions?: (options: IConfirmOptions)=>IConfirmOptions; } interface IPopDefault extends IConfirmDefault { (text: TEleCommon | IConfirmOptions, title?: string, target?: IConfirm): Promise; } interface IConfirmOptions extends IOpenHide { parent?: TEleCommon, onGetCloseMethod?: (fn: TNoneArgFn) => void; type?: ConfirmType; theme?: ConfirmStyle; title?: string; text?: string; confirmText?: string; cancelText?: string; cancelBtn?: boolean; confirmBtn?: boolean; closeBtn?: boolean; customClass?: string; customEl?: TEleCommon; contentHtml?: boolean; custom?: (el: Ele, $: TEasyDomUtil)=>void; clickConfirmClose?: boolean; clickCancelClose?: boolean; onconfirm?: TNoneArgFn; oncancel?: TNoneArgFn; onOptions?: (options: IConfirmOptions)=>void; } interface IConfirm extends Required { el: TUIEls; lastParent: Ele; lastCustomed: boolean; _isDefault: boolean; } type TConfirmResult = 'confirm' | 'close' | 'cancel'; interface ILoading extends Required { el: TUIEls; timer: any; lastParent: Ele; } interface ILoadingOptions extends IOpenHide { text?: string; parent?: TEleCommon, time?: number, backgroundOpacity?: number, } interface ILoadingDefault { (text: string | ILoadingOptions, time?: number, target?: ILoading): Promise; create( text: string | ILoadingOptions, time?: number, fn?: ILoadingDefault ): (()=>void); close(target?: ILoading): void; } interface IToast extends ILoading { customClass: string; } interface IToastOptions extends IOpenHide { text?: string; parent?: TEleCommon, time?: number, backgroundOpacity?: number, customClass?: string, contentHtml?: boolean; position?: ToastPosition; showClose?: boolean; button?: any; } interface IToastDefault { (text: string | IToastOptions, time?: number, target?: IToast): Promise; create( text: string | IToastOptions, time?: number, fn?: IToastDefault ): (()=>void); close(target?: IToast): void; } declare const tool: { query: typeof easy_dom_util.query; exist: typeof easy_dom_util.exist; create: typeof easy_dom_util.create; classPrefix: typeof easy_dom_util.classPrefix; clearClassPrefix: typeof easy_dom_util.clearClassPrefix; checkDom: typeof easy_dom_util.checkDom; reportStyle: typeof easy_dom_util.reportStyle; addCommonStyle: typeof easy_dom_util.addCommonStyle; initStylePool: typeof easy_dom_util.initStylePool; registTouchEvent: typeof easy_dom_util.registTouchEvent; mouseToTouchEvent: typeof easy_dom_util_src_touchEvent.mouseToTouchEvent; windowSize: typeof easy_dom_util.windowSize; isMobile: typeof easy_dom_util.isMobile; version: string; setWindowSize: typeof easy_dom_util.setWindowSize; dom: easy_dom_util_src_dom.IDom & easy_dom_util_src_dom.IDoms; collectRef: typeof easy_dom_util.collectRef; }; declare const loading: ILoadingDefault; declare const toast: IToastDefault; declare const confirm: IConfirmDefault; declare const alert: IConfirmDefault; declare const pop: IPopDefault; interface IDragOptions { el: TEleCommon; parent?: TEleCommon; enableDrag?: boolean; onClick?: () => void; onSideChange?: () => void; onDragStart?: () => void; onDragMove?: () => void; onDragEnd?: () => void; zIndex?: number; delay?: number; aside?: boolean; preventDefault?: boolean; reinitPosition?: boolean; position?: null; margin?: number | number[]; } declare class Drag { el: Ele; parent: Ele | null; margin: number[]; preventDefault: boolean; disX: number; disY: number; moveX: number; moveY: number; L: number; T: number; starX: number; starY: number; startTime: number; left: 'auto' | number; top: 'auto' | number; enableDrag: boolean; onClick: () => void; onSideChange: () => void; sideLeft: boolean; aside: boolean; onDragStart: () => void; onDragMove: () => void; onDragEnd: () => void; constructor({ el, parent, enableDrag, onClick, onSideChange, onDragStart, onDragMove, onDragEnd, zIndex, delay, aside, preventDefault, reinitPosition, position, margin, }: IDragOptions); touchActiveInit(zIndex: number): void; getParentSize(): { width: number; height: number; }; initPosition(init?: boolean, position?: { left: number; top: number; } | null): void; setPosition(left: number, top?: number): void; touchStart(e: TouchEvent): void; touchMove(e: TouchEvent): void; touchEnd(e: TouchEvent): void; } declare const _default$1: "0.1.4"; declare const drag: (opts: IDragOptions) => Drag; declare const _default: { ConfirmStyle: typeof ConfirmStyle; ConfirmType: typeof ConfirmType; ToastPosition: typeof ToastPosition; tool: { query: typeof easy_dom_util.query; exist: typeof easy_dom_util.exist; create: typeof easy_dom_util.create; classPrefix: typeof easy_dom_util.classPrefix; clearClassPrefix: typeof easy_dom_util.clearClassPrefix; checkDom: typeof easy_dom_util.checkDom; reportStyle: typeof easy_dom_util.reportStyle; addCommonStyle: typeof easy_dom_util.addCommonStyle; initStylePool: typeof easy_dom_util.initStylePool; registTouchEvent: typeof easy_dom_util.registTouchEvent; mouseToTouchEvent: typeof easy_dom_util_src_touchEvent.mouseToTouchEvent; windowSize: typeof easy_dom_util.windowSize; isMobile: typeof easy_dom_util.isMobile; version: string; setWindowSize: typeof easy_dom_util.setWindowSize; dom: easy_dom_util_src_dom.IDom & easy_dom_util_src_dom.IDoms; collectRef: typeof easy_dom_util.collectRef; }; loading: ILoadingDefault; toast: IToastDefault; confirm: IConfirmDefault; alert: IConfirmDefault; pop: IPopDefault; drag: (opts: IDragOptions) => Drag; version: string; }; export { ConfirmStyle, ConfirmType, ToastPosition, alert, confirm, _default as default, drag, loading, pop, toast, tool, _default$1 as version };