index.d.ts 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import type { ComponentPublicInstance, CSSProperties, ExtractPropTypes, PropType } from 'vue';
  2. declare function getDefaultTarget(): Window & typeof globalThis;
  3. declare enum AffixStatus {
  4. None = 0,
  5. Prepare = 1
  6. }
  7. export interface AffixState {
  8. affixStyle?: CSSProperties;
  9. placeholderStyle?: CSSProperties;
  10. status: AffixStatus;
  11. lastAffix: boolean;
  12. prevTarget: Window | HTMLElement | null;
  13. }
  14. export declare const affixProps: () => {
  15. /**
  16. * 距离窗口顶部达到指定偏移量后触发
  17. */
  18. offsetTop: NumberConstructor;
  19. /** 距离窗口底部达到指定偏移量后触发 */
  20. offsetBottom: NumberConstructor;
  21. /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
  22. target: {
  23. type: PropType<() => Window | HTMLElement | null>;
  24. default: typeof getDefaultTarget;
  25. };
  26. prefixCls: StringConstructor;
  27. /** 固定状态改变时触发的回调函数 */
  28. onChange: PropType<(lastAffix: boolean) => void>;
  29. onTestUpdatePosition: PropType<() => void>;
  30. };
  31. export type AffixProps = Partial<ExtractPropTypes<ReturnType<typeof affixProps>>>;
  32. export type AffixEmits = {
  33. change: (lastAffix: boolean) => void;
  34. testUpdatePosition: () => void;
  35. };
  36. export type AffixExpose = {
  37. updatePosition: (...args: any[]) => void;
  38. lazyUpdatePosition: (...args: any[]) => void;
  39. };
  40. export type AffixInstance = ComponentPublicInstance<AffixProps, AffixExpose>;
  41. declare const _default: {
  42. new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<ExtractPropTypes<{
  43. /**
  44. * 距离窗口顶部达到指定偏移量后触发
  45. */
  46. offsetTop: NumberConstructor;
  47. /** 距离窗口底部达到指定偏移量后触发 */
  48. offsetBottom: NumberConstructor;
  49. /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
  50. target: {
  51. type: PropType<() => Window | HTMLElement>;
  52. default: typeof getDefaultTarget;
  53. };
  54. prefixCls: StringConstructor;
  55. /** 固定状态改变时触发的回调函数 */
  56. onChange: PropType<(lastAffix: boolean) => void>;
  57. onTestUpdatePosition: PropType<() => void>;
  58. }>>, () => import("../_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<ExtractPropTypes<{
  59. /**
  60. * 距离窗口顶部达到指定偏移量后触发
  61. */
  62. offsetTop: NumberConstructor;
  63. /** 距离窗口底部达到指定偏移量后触发 */
  64. offsetBottom: NumberConstructor;
  65. /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
  66. target: {
  67. type: PropType<() => Window | HTMLElement>;
  68. default: typeof getDefaultTarget;
  69. };
  70. prefixCls: StringConstructor;
  71. /** 固定状态改变时触发的回调函数 */
  72. onChange: PropType<(lastAffix: boolean) => void>;
  73. onTestUpdatePosition: PropType<() => void>;
  74. }>>, {
  75. target: () => Window | HTMLElement;
  76. }, true, {}, {}, {
  77. P: {};
  78. B: {};
  79. D: {};
  80. C: {};
  81. M: {};
  82. Defaults: {};
  83. }, Readonly<ExtractPropTypes<{
  84. /**
  85. * 距离窗口顶部达到指定偏移量后触发
  86. */
  87. offsetTop: NumberConstructor;
  88. /** 距离窗口底部达到指定偏移量后触发 */
  89. offsetBottom: NumberConstructor;
  90. /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
  91. target: {
  92. type: PropType<() => Window | HTMLElement>;
  93. default: typeof getDefaultTarget;
  94. };
  95. prefixCls: StringConstructor;
  96. /** 固定状态改变时触发的回调函数 */
  97. onChange: PropType<(lastAffix: boolean) => void>;
  98. onTestUpdatePosition: PropType<() => void>;
  99. }>>, () => import("../_util/type").VueNode, {}, {}, {}, {
  100. target: () => Window | HTMLElement;
  101. }>;
  102. __isFragment?: never;
  103. __isTeleport?: never;
  104. __isSuspense?: never;
  105. } & import("vue").ComponentOptionsBase<Readonly<ExtractPropTypes<{
  106. /**
  107. * 距离窗口顶部达到指定偏移量后触发
  108. */
  109. offsetTop: NumberConstructor;
  110. /** 距离窗口底部达到指定偏移量后触发 */
  111. offsetBottom: NumberConstructor;
  112. /** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
  113. target: {
  114. type: PropType<() => Window | HTMLElement>;
  115. default: typeof getDefaultTarget;
  116. };
  117. prefixCls: StringConstructor;
  118. /** 固定状态改变时触发的回调函数 */
  119. onChange: PropType<(lastAffix: boolean) => void>;
  120. onTestUpdatePosition: PropType<() => void>;
  121. }>>, () => import("../_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
  122. target: () => Window | HTMLElement;
  123. }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
  124. export default _default;