util.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import type { CSSMotionProps } from 'rc-motion';
  2. import type { AlignType, AnimationType, BuildInPlacements, TransitionNameType } from './interface';
  3. export declare function getAlignPopupClassName(builtinPlacements: BuildInPlacements, prefixCls: string, align: AlignType, isAlignPoint: boolean): string;
  4. /** @deprecated We should not use this if we can refactor all deps */
  5. export declare function getMotion(prefixCls: string, motion: CSSMotionProps, animation: AnimationType, transitionName: TransitionNameType): CSSMotionProps;
  6. export declare function getWin(ele: HTMLElement): Window & typeof globalThis;
  7. /**
  8. * Get all the scrollable parent elements of the element
  9. * @param ele The element to be detected
  10. * @param areaOnly Only return the parent which will cut visible area
  11. */
  12. export declare function collectScroller(ele: HTMLElement): HTMLElement[];
  13. export declare function toNum(num: number, defaultValue?: number): number;
  14. export interface VisibleArea {
  15. left: number;
  16. top: number;
  17. right: number;
  18. bottom: number;
  19. }
  20. /**
  21. *
  22. *
  23. * **************************************
  24. * * Border *
  25. * * ************************** *
  26. * * * * * *
  27. * * B * * S * B *
  28. * * o * * c * o *
  29. * * r * Content * r * r *
  30. * * d * * o * d *
  31. * * e * * l * e *
  32. * * r ******************** l * r *
  33. * * * Scroll * *
  34. * * ************************** *
  35. * * Border *
  36. * **************************************
  37. *
  38. */
  39. /**
  40. * Get visible area of element
  41. */
  42. export declare function getVisibleArea(initArea: VisibleArea, scrollerList?: HTMLElement[]): {
  43. left: number;
  44. top: number;
  45. right: number;
  46. bottom: number;
  47. };