index.d.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import type { Ref } from 'vue';
  2. import type { Instance, Modifier, Options, State, VirtualElement } from '@popperjs/core';
  3. type ElementType = HTMLElement | undefined;
  4. type ReferenceElement = ElementType | VirtualElement;
  5. export type PartialOptions = Partial<Options>;
  6. export declare const usePopper: (referenceElementRef: Ref<ReferenceElement>, popperElementRef: Ref<ElementType>, opts?: Ref<PartialOptions> | PartialOptions) => {
  7. state: import("vue").ComputedRef<{
  8. elements?: {
  9. reference: Element | VirtualElement;
  10. popper: HTMLElement;
  11. arrow?: HTMLElement;
  12. } | undefined;
  13. options?: import("@popperjs/core").OptionsGeneric<any> | undefined;
  14. placement?: import("@popperjs/core").Placement | undefined;
  15. strategy?: import("@popperjs/core").PositioningStrategy | undefined;
  16. orderedModifiers?: Modifier<any, any>[] | undefined;
  17. rects?: import("@popperjs/core").StateRects | undefined;
  18. scrollParents?: {
  19. reference: Array<Element | import("@popperjs/core").Window | import("@popperjs/core").VisualViewport>;
  20. popper: Array<Element | import("@popperjs/core").Window | import("@popperjs/core").VisualViewport>;
  21. } | undefined;
  22. styles?: {
  23. [key: string]: Partial<CSSStyleDeclaration>;
  24. } | undefined;
  25. attributes?: {
  26. [key: string]: {
  27. [key: string]: string | boolean;
  28. };
  29. } | undefined;
  30. modifiersData?: {
  31. [key: string]: any;
  32. arrow?: {
  33. x?: number;
  34. y?: number;
  35. centerOffset: number;
  36. };
  37. hide?: {
  38. isReferenceHidden: boolean;
  39. hasPopperEscaped: boolean;
  40. referenceClippingOffsets: import("@popperjs/core").SideObject;
  41. popperEscapeOffsets: import("@popperjs/core").SideObject;
  42. };
  43. offset?: {
  44. top?: import("@popperjs/core").Offsets | undefined;
  45. bottom?: import("@popperjs/core").Offsets | undefined;
  46. left?: import("@popperjs/core").Offsets | undefined;
  47. right?: import("@popperjs/core").Offsets | undefined;
  48. auto?: import("@popperjs/core").Offsets | undefined;
  49. "auto-start"?: import("@popperjs/core").Offsets | undefined;
  50. "auto-end"?: import("@popperjs/core").Offsets | undefined;
  51. "top-start"?: import("@popperjs/core").Offsets | undefined;
  52. "top-end"?: import("@popperjs/core").Offsets | undefined;
  53. "bottom-start"?: import("@popperjs/core").Offsets | undefined;
  54. "bottom-end"?: import("@popperjs/core").Offsets | undefined;
  55. "right-start"?: import("@popperjs/core").Offsets | undefined;
  56. "right-end"?: import("@popperjs/core").Offsets | undefined;
  57. "left-start"?: import("@popperjs/core").Offsets | undefined;
  58. "left-end"?: import("@popperjs/core").Offsets | undefined;
  59. };
  60. preventOverflow?: import("@popperjs/core").Offsets;
  61. popperOffsets?: import("@popperjs/core").Offsets;
  62. } | undefined;
  63. reset?: boolean | undefined;
  64. }>;
  65. styles: import("vue").ComputedRef<{
  66. [key: string]: Partial<CSSStyleDeclaration>;
  67. }>;
  68. attributes: import("vue").ComputedRef<{
  69. [key: string]: {
  70. [key: string]: string | boolean;
  71. };
  72. }>;
  73. update: () => Promise<Partial<State>> | undefined;
  74. forceUpdate: () => void | undefined;
  75. instanceRef: import("vue").ComputedRef<Instance | undefined>;
  76. };
  77. export type UsePopperReturn = ReturnType<typeof usePopper>;
  78. export {};