index.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. import * as React from 'react';
  2. import type { InputStatus } from '../../_util/statusUtils';
  3. import type { Variant } from '../../config-provider';
  4. import type { SizeType } from '../../config-provider/SizeContext';
  5. export interface OTPRef {
  6. focus: VoidFunction;
  7. blur: VoidFunction;
  8. nativeElement: HTMLDivElement;
  9. }
  10. export interface OTPProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onInput'> {
  11. prefixCls?: string;
  12. length?: number;
  13. variant?: Variant;
  14. rootClassName?: string;
  15. className?: string;
  16. style?: React.CSSProperties;
  17. size?: SizeType;
  18. defaultValue?: string;
  19. value?: string;
  20. onChange?: (value: string) => void;
  21. formatter?: (value: string) => string;
  22. separator?: ((index: number) => React.ReactNode) | React.ReactNode;
  23. disabled?: boolean;
  24. status?: InputStatus;
  25. mask?: boolean | string;
  26. type?: React.HTMLInputTypeAttribute;
  27. onInput?: (value: string[]) => void;
  28. }
  29. declare const OTP: React.ForwardRefExoticComponent<OTPProps & React.RefAttributes<OTPRef>>;
  30. export default OTP;