index.d.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import * as React from 'react';
  2. import type { DataDrivenOptionProps as MentionsOptionProps, MentionsProps as RcMentionsProps, MentionsRef as RcMentionsRef } from 'rc-mentions/lib/Mentions';
  3. import type { InputStatus } from '../_util/statusUtils';
  4. import type { Variant } from '../config-provider';
  5. export declare const Option: React.FC<import("rc-mentions/lib/Option").OptionProps>;
  6. export type MentionPlacement = 'top' | 'bottom';
  7. export type { DataDrivenOptionProps as MentionsOptionProps } from 'rc-mentions/lib/Mentions';
  8. export interface OptionProps {
  9. value: string;
  10. children: React.ReactNode;
  11. [key: string]: any;
  12. }
  13. export interface MentionProps extends Omit<RcMentionsProps, 'suffix'> {
  14. rootClassName?: string;
  15. loading?: boolean;
  16. status?: InputStatus;
  17. options?: MentionsOptionProps[];
  18. popupClassName?: string;
  19. /**
  20. * @since 5.13.0
  21. * @default "outlined"
  22. */
  23. variant?: Variant;
  24. }
  25. export interface MentionsProps extends MentionProps {
  26. }
  27. export interface MentionsRef extends RcMentionsRef {
  28. }
  29. interface MentionsConfig {
  30. prefix?: string | string[];
  31. split?: string;
  32. }
  33. interface MentionsEntity {
  34. prefix: string;
  35. value: string;
  36. }
  37. declare const InternalMentions: React.ForwardRefExoticComponent<MentionProps & React.RefAttributes<MentionsRef>>;
  38. type CompoundedComponent = typeof InternalMentions & {
  39. Option: typeof Option;
  40. _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
  41. getMentions: (value: string, config?: MentionsConfig) => MentionsEntity[];
  42. };
  43. declare const Mentions: CompoundedComponent;
  44. declare const PurePanel: (props: import("../_util/type").AnyObject) => React.JSX.Element;
  45. export default Mentions;