import { ShallowRef } from "vue"; import { ComputePositionReturn } from "@floating-ui/dom"; //#region src/use-pop/index.d.ts type TipDirection = 'top' | 'bottom' | 'left' | 'right'; type TipAlign = 'center' | 'start' | 'end'; interface Options { /** 触发元素 */ triggerRef: ShallowRef; /** 内容元素 */ contentRef: ShallowRef; /** * 箭头元素,如果存在,则会在弹框的箭头位置显示箭头 */ arrowRef?: ShallowRef; /** 方向 */ direction?: ShallowRef | TipDirection; /** 对齐方式 */ alignment?: ShallowRef | TipAlign; /** * 箭头大小 * @default 10 */ arrowSize?: number; /** * 触发器元素位置变更时回调, * 一般用于在触发器元素位置变更时更新弹框位置 */ onTriggerPositionChange?: () => void; /** 更新元素前回调 */ onBeforeUpdate?: (triggerEl: HTMLElement, contentEl: HTMLElement) => void; /** 更新元素后回调 */ onAfterUpdate?: (position: ComputePositionReturn) => void; /** 弹框弹出时回调 */ onPop?: (position: ComputePositionReturn) => void; } interface PopResult { /** * 更新弹框位置 */ update: () => Promise; /** 浮框容器id */ popperContainerId: string; } /** * 浮框组合式函数 * @param options 选项 * @returns */ declare function usePop(options: Options): PopResult; //#endregion export { usePop }; //# sourceMappingURL=index.d.ts.map