index.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import * as React from 'react';
  2. declare const _SpinSizes: readonly ["small", "default", "large"];
  3. export type SpinSize = (typeof _SpinSizes)[number];
  4. export type SpinIndicator = React.ReactElement<HTMLElement>;
  5. export interface SpinProps {
  6. /** Customize prefix class name */
  7. prefixCls?: string;
  8. /** Additional class name of Spin */
  9. className?: string;
  10. /** Additional root class name of Spin */
  11. rootClassName?: string;
  12. /** Whether Spin is spinning */
  13. spinning?: boolean;
  14. /** Style of Spin */
  15. style?: React.CSSProperties;
  16. /** Size of Spin, options: `small`, `default` and `large` */
  17. size?: SpinSize;
  18. /** Customize description content when Spin has children */
  19. tip?: React.ReactNode;
  20. /** Specifies a delay in milliseconds for loading state (prevent flush) */
  21. delay?: number;
  22. /** The className of wrapper when Spin has children */
  23. wrapperClassName?: string;
  24. /** React node of the spinning indicator */
  25. indicator?: SpinIndicator;
  26. /** Children of Spin */
  27. children?: React.ReactNode;
  28. /** Display a backdrop with the `Spin` component */
  29. fullscreen?: boolean;
  30. percent?: number | 'auto';
  31. }
  32. export type SpinType = React.FC<SpinProps> & {
  33. setDefaultIndicator: (indicator: React.ReactNode) => void;
  34. };
  35. declare const Spin: SpinType;
  36. export default Spin;