index.d.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. import type { App, PropType, ExtractPropTypes } from 'vue';
  2. import type { KeyboardEventHandler } from '../_util/EventInterface';
  3. import type { CustomSlotsType } from '../_util/type';
  4. interface MentionsConfig {
  5. prefix?: string | string[];
  6. split?: string;
  7. }
  8. export interface MentionsOptionProps {
  9. value: string;
  10. disabled?: boolean;
  11. label?: string | number | ((o: MentionsOptionProps) => any);
  12. [key: string]: any;
  13. }
  14. interface MentionsEntity {
  15. prefix: string;
  16. value: string;
  17. }
  18. export type MentionPlacement = 'top' | 'bottom';
  19. export declare const mentionsProps: () => {
  20. loading: {
  21. type: BooleanConstructor;
  22. default: any;
  23. };
  24. onFocus: {
  25. type: PropType<(e: FocusEvent) => void>;
  26. };
  27. onBlur: {
  28. type: PropType<(e: FocusEvent) => void>;
  29. };
  30. onSelect: {
  31. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  32. };
  33. onChange: {
  34. type: PropType<(text: string) => void>;
  35. };
  36. onPressenter: {
  37. type: PropType<KeyboardEventHandler>;
  38. };
  39. 'onUpdate:value': {
  40. type: PropType<(text: string) => void>;
  41. };
  42. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  43. defaultValue: StringConstructor;
  44. id: StringConstructor;
  45. status: PropType<"" | "error" | "warning">;
  46. autofocus: {
  47. type: BooleanConstructor;
  48. default: any;
  49. };
  50. prefix: import("vue-types").VueTypeDef<string | string[]>;
  51. prefixCls: StringConstructor;
  52. value: StringConstructor;
  53. disabled: {
  54. type: BooleanConstructor;
  55. default: any;
  56. };
  57. split: StringConstructor;
  58. transitionName: StringConstructor;
  59. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  60. character: import("vue-types").VueTypeValidableDef<any>;
  61. characterRender: FunctionConstructor;
  62. filterOption: {
  63. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  64. };
  65. validateSearch: FunctionConstructor;
  66. getPopupContainer: {
  67. type: PropType<() => HTMLElement>;
  68. };
  69. options: {
  70. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  71. default: import("../vc-mentions/src/Option").OptionProps[];
  72. };
  73. rows: (StringConstructor | NumberConstructor)[];
  74. direction: {
  75. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  76. };
  77. };
  78. export type MentionsProps = Partial<ExtractPropTypes<ReturnType<typeof mentionsProps>>>;
  79. export declare const MentionsOption: import("vue").DefineComponent<ExtractPropTypes<{
  80. label: {
  81. default: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  82. type: PropType<import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode)>;
  83. };
  84. value: StringConstructor;
  85. disabled: BooleanConstructor;
  86. payload: {
  87. type: PropType<Record<string, any>>;
  88. default: Record<string, any>;
  89. };
  90. }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
  91. label: {
  92. default: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  93. type: PropType<import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode)>;
  94. };
  95. value: StringConstructor;
  96. disabled: BooleanConstructor;
  97. payload: {
  98. type: PropType<Record<string, any>>;
  99. default: Record<string, any>;
  100. };
  101. }>> & Readonly<{}>, {
  102. label: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  103. disabled: boolean;
  104. payload: Record<string, any>;
  105. }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
  106. declare const _default: {
  107. new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes<{
  108. loading: {
  109. type: BooleanConstructor;
  110. default: any;
  111. };
  112. onFocus: {
  113. type: PropType<(e: FocusEvent) => void>;
  114. };
  115. onBlur: {
  116. type: PropType<(e: FocusEvent) => void>;
  117. };
  118. onSelect: {
  119. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  120. };
  121. onChange: {
  122. type: PropType<(text: string) => void>;
  123. };
  124. onPressenter: {
  125. type: PropType<KeyboardEventHandler>;
  126. };
  127. 'onUpdate:value': {
  128. type: PropType<(text: string) => void>;
  129. };
  130. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  131. defaultValue: StringConstructor;
  132. id: StringConstructor;
  133. status: PropType<"" | "error" | "warning">;
  134. autofocus: {
  135. type: BooleanConstructor;
  136. default: any;
  137. };
  138. prefix: import("vue-types").VueTypeDef<string | string[]>;
  139. prefixCls: StringConstructor;
  140. value: StringConstructor;
  141. disabled: {
  142. type: BooleanConstructor;
  143. default: any;
  144. };
  145. split: StringConstructor;
  146. transitionName: StringConstructor;
  147. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  148. character: import("vue-types").VueTypeValidableDef<any>;
  149. characterRender: FunctionConstructor;
  150. filterOption: {
  151. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  152. };
  153. validateSearch: FunctionConstructor;
  154. getPopupContainer: {
  155. type: PropType<() => HTMLElement>;
  156. };
  157. options: {
  158. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  159. default: import("../vc-mentions/src/Option").OptionProps[];
  160. };
  161. rows: (StringConstructor | NumberConstructor)[];
  162. direction: {
  163. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  164. };
  165. }>> & Readonly<{}>, () => import("../_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
  166. disabled: boolean;
  167. autofocus: boolean;
  168. options: import("../vc-mentions/src/Option").OptionProps[];
  169. loading: boolean;
  170. }, true, {}, CustomSlotsType<{
  171. notFoundContent?: any;
  172. option?: any;
  173. default?: any;
  174. }>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
  175. P: {};
  176. B: {};
  177. D: {};
  178. C: {};
  179. M: {};
  180. Defaults: {};
  181. }, Readonly<ExtractPropTypes<{
  182. loading: {
  183. type: BooleanConstructor;
  184. default: any;
  185. };
  186. onFocus: {
  187. type: PropType<(e: FocusEvent) => void>;
  188. };
  189. onBlur: {
  190. type: PropType<(e: FocusEvent) => void>;
  191. };
  192. onSelect: {
  193. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  194. };
  195. onChange: {
  196. type: PropType<(text: string) => void>;
  197. };
  198. onPressenter: {
  199. type: PropType<KeyboardEventHandler>;
  200. };
  201. 'onUpdate:value': {
  202. type: PropType<(text: string) => void>;
  203. };
  204. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  205. defaultValue: StringConstructor;
  206. id: StringConstructor;
  207. status: PropType<"" | "error" | "warning">;
  208. autofocus: {
  209. type: BooleanConstructor;
  210. default: any;
  211. };
  212. prefix: import("vue-types").VueTypeDef<string | string[]>;
  213. prefixCls: StringConstructor;
  214. value: StringConstructor;
  215. disabled: {
  216. type: BooleanConstructor;
  217. default: any;
  218. };
  219. split: StringConstructor;
  220. transitionName: StringConstructor;
  221. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  222. character: import("vue-types").VueTypeValidableDef<any>;
  223. characterRender: FunctionConstructor;
  224. filterOption: {
  225. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  226. };
  227. validateSearch: FunctionConstructor;
  228. getPopupContainer: {
  229. type: PropType<() => HTMLElement>;
  230. };
  231. options: {
  232. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  233. default: import("../vc-mentions/src/Option").OptionProps[];
  234. };
  235. rows: (StringConstructor | NumberConstructor)[];
  236. direction: {
  237. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  238. };
  239. }>> & Readonly<{}>, () => import("../_util/type").VueNode, {}, {}, {}, {
  240. disabled: boolean;
  241. autofocus: boolean;
  242. options: import("../vc-mentions/src/Option").OptionProps[];
  243. loading: boolean;
  244. }>;
  245. __isFragment?: never;
  246. __isTeleport?: never;
  247. __isSuspense?: never;
  248. } & import("vue").ComponentOptionsBase<Readonly<ExtractPropTypes<{
  249. loading: {
  250. type: BooleanConstructor;
  251. default: any;
  252. };
  253. onFocus: {
  254. type: PropType<(e: FocusEvent) => void>;
  255. };
  256. onBlur: {
  257. type: PropType<(e: FocusEvent) => void>;
  258. };
  259. onSelect: {
  260. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  261. };
  262. onChange: {
  263. type: PropType<(text: string) => void>;
  264. };
  265. onPressenter: {
  266. type: PropType<KeyboardEventHandler>;
  267. };
  268. 'onUpdate:value': {
  269. type: PropType<(text: string) => void>;
  270. };
  271. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  272. defaultValue: StringConstructor;
  273. id: StringConstructor;
  274. status: PropType<"" | "error" | "warning">;
  275. autofocus: {
  276. type: BooleanConstructor;
  277. default: any;
  278. };
  279. prefix: import("vue-types").VueTypeDef<string | string[]>;
  280. prefixCls: StringConstructor;
  281. value: StringConstructor;
  282. disabled: {
  283. type: BooleanConstructor;
  284. default: any;
  285. };
  286. split: StringConstructor;
  287. transitionName: StringConstructor;
  288. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  289. character: import("vue-types").VueTypeValidableDef<any>;
  290. characterRender: FunctionConstructor;
  291. filterOption: {
  292. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  293. };
  294. validateSearch: FunctionConstructor;
  295. getPopupContainer: {
  296. type: PropType<() => HTMLElement>;
  297. };
  298. options: {
  299. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  300. default: import("../vc-mentions/src/Option").OptionProps[];
  301. };
  302. rows: (StringConstructor | NumberConstructor)[];
  303. direction: {
  304. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  305. };
  306. }>> & Readonly<{}>, () => import("../_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
  307. disabled: boolean;
  308. autofocus: boolean;
  309. options: import("../vc-mentions/src/Option").OptionProps[];
  310. loading: boolean;
  311. }, {}, string, CustomSlotsType<{
  312. notFoundContent?: any;
  313. option?: any;
  314. default?: any;
  315. }>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
  316. Option: import("vue").DefineComponent<ExtractPropTypes<{
  317. label: {
  318. default: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  319. type: PropType<import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode)>;
  320. };
  321. value: StringConstructor;
  322. disabled: BooleanConstructor;
  323. payload: {
  324. type: PropType<Record<string, any>>;
  325. default: Record<string, any>;
  326. };
  327. }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
  328. label: {
  329. default: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  330. type: PropType<import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode)>;
  331. };
  332. value: StringConstructor;
  333. disabled: BooleanConstructor;
  334. payload: {
  335. type: PropType<Record<string, any>>;
  336. default: Record<string, any>;
  337. };
  338. }>> & Readonly<{}>, {
  339. label: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  340. disabled: boolean;
  341. payload: Record<string, any>;
  342. }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
  343. getMentions: (value?: string, config?: MentionsConfig) => MentionsEntity[];
  344. install: (app: App) => App<any>;
  345. };
  346. export default _default;