index.d.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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<{
  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. }, unknown, unknown, {}, {}, 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. }>>, {
  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. }, {}>;
  106. declare const _default: {
  107. new (...args: any[]): import("vue").CreateComponentPublicInstance<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. }>>, () => import("../_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<ExtractPropTypes<{
  166. loading: {
  167. type: BooleanConstructor;
  168. default: any;
  169. };
  170. onFocus: {
  171. type: PropType<(e: FocusEvent) => void>;
  172. };
  173. onBlur: {
  174. type: PropType<(e: FocusEvent) => void>;
  175. };
  176. onSelect: {
  177. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  178. };
  179. onChange: {
  180. type: PropType<(text: string) => void>;
  181. };
  182. onPressenter: {
  183. type: PropType<KeyboardEventHandler>;
  184. };
  185. 'onUpdate:value': {
  186. type: PropType<(text: string) => void>;
  187. };
  188. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  189. defaultValue: StringConstructor;
  190. id: StringConstructor;
  191. status: PropType<"" | "error" | "warning">;
  192. autofocus: {
  193. type: BooleanConstructor;
  194. default: any;
  195. };
  196. prefix: import("vue-types").VueTypeDef<string | string[]>;
  197. prefixCls: StringConstructor;
  198. value: StringConstructor;
  199. disabled: {
  200. type: BooleanConstructor;
  201. default: any;
  202. };
  203. split: StringConstructor;
  204. transitionName: StringConstructor;
  205. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  206. character: import("vue-types").VueTypeValidableDef<any>;
  207. characterRender: FunctionConstructor;
  208. filterOption: {
  209. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  210. };
  211. validateSearch: FunctionConstructor;
  212. getPopupContainer: {
  213. type: PropType<() => HTMLElement>;
  214. };
  215. options: {
  216. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  217. default: import("../vc-mentions/src/Option").OptionProps[];
  218. };
  219. rows: (StringConstructor | NumberConstructor)[];
  220. direction: {
  221. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  222. };
  223. }>>, {
  224. disabled: boolean;
  225. autofocus: boolean;
  226. options: import("../vc-mentions/src/Option").OptionProps[];
  227. loading: boolean;
  228. }, true, {}, CustomSlotsType<{
  229. notFoundContent?: any;
  230. option?: any;
  231. default?: any;
  232. }>, {
  233. P: {};
  234. B: {};
  235. D: {};
  236. C: {};
  237. M: {};
  238. Defaults: {};
  239. }, Readonly<ExtractPropTypes<{
  240. loading: {
  241. type: BooleanConstructor;
  242. default: any;
  243. };
  244. onFocus: {
  245. type: PropType<(e: FocusEvent) => void>;
  246. };
  247. onBlur: {
  248. type: PropType<(e: FocusEvent) => void>;
  249. };
  250. onSelect: {
  251. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  252. };
  253. onChange: {
  254. type: PropType<(text: string) => void>;
  255. };
  256. onPressenter: {
  257. type: PropType<KeyboardEventHandler>;
  258. };
  259. 'onUpdate:value': {
  260. type: PropType<(text: string) => void>;
  261. };
  262. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  263. defaultValue: StringConstructor;
  264. id: StringConstructor;
  265. status: PropType<"" | "error" | "warning">;
  266. autofocus: {
  267. type: BooleanConstructor;
  268. default: any;
  269. };
  270. prefix: import("vue-types").VueTypeDef<string | string[]>;
  271. prefixCls: StringConstructor;
  272. value: StringConstructor;
  273. disabled: {
  274. type: BooleanConstructor;
  275. default: any;
  276. };
  277. split: StringConstructor;
  278. transitionName: StringConstructor;
  279. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  280. character: import("vue-types").VueTypeValidableDef<any>;
  281. characterRender: FunctionConstructor;
  282. filterOption: {
  283. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  284. };
  285. validateSearch: FunctionConstructor;
  286. getPopupContainer: {
  287. type: PropType<() => HTMLElement>;
  288. };
  289. options: {
  290. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  291. default: import("../vc-mentions/src/Option").OptionProps[];
  292. };
  293. rows: (StringConstructor | NumberConstructor)[];
  294. direction: {
  295. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  296. };
  297. }>>, () => import("../_util/type").VueNode, {}, {}, {}, {
  298. disabled: boolean;
  299. autofocus: boolean;
  300. options: import("../vc-mentions/src/Option").OptionProps[];
  301. loading: boolean;
  302. }>;
  303. __isFragment?: never;
  304. __isTeleport?: never;
  305. __isSuspense?: never;
  306. } & import("vue").ComponentOptionsBase<Readonly<ExtractPropTypes<{
  307. loading: {
  308. type: BooleanConstructor;
  309. default: any;
  310. };
  311. onFocus: {
  312. type: PropType<(e: FocusEvent) => void>;
  313. };
  314. onBlur: {
  315. type: PropType<(e: FocusEvent) => void>;
  316. };
  317. onSelect: {
  318. type: PropType<(option: MentionsOptionProps, prefix: string) => void>;
  319. };
  320. onChange: {
  321. type: PropType<(text: string) => void>;
  322. };
  323. onPressenter: {
  324. type: PropType<KeyboardEventHandler>;
  325. };
  326. 'onUpdate:value': {
  327. type: PropType<(text: string) => void>;
  328. };
  329. notFoundContent: import("vue-types").VueTypeValidableDef<any>;
  330. defaultValue: StringConstructor;
  331. id: StringConstructor;
  332. status: PropType<"" | "error" | "warning">;
  333. autofocus: {
  334. type: BooleanConstructor;
  335. default: any;
  336. };
  337. prefix: import("vue-types").VueTypeDef<string | string[]>;
  338. prefixCls: StringConstructor;
  339. value: StringConstructor;
  340. disabled: {
  341. type: BooleanConstructor;
  342. default: any;
  343. };
  344. split: StringConstructor;
  345. transitionName: StringConstructor;
  346. placement: import("vue-types").VueTypeDef<"top" | "bottom">;
  347. character: import("vue-types").VueTypeValidableDef<any>;
  348. characterRender: FunctionConstructor;
  349. filterOption: {
  350. type: PropType<false | typeof import("../vc-mentions/src/util").filterOption>;
  351. };
  352. validateSearch: FunctionConstructor;
  353. getPopupContainer: {
  354. type: PropType<() => HTMLElement>;
  355. };
  356. options: {
  357. type: PropType<import("../vc-mentions/src/Option").OptionProps[]>;
  358. default: import("../vc-mentions/src/Option").OptionProps[];
  359. };
  360. rows: (StringConstructor | NumberConstructor)[];
  361. direction: {
  362. type: PropType<import("../vc-mentions/src/mentionsProps").Direction>;
  363. };
  364. }>>, () => import("../_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
  365. disabled: boolean;
  366. autofocus: boolean;
  367. options: import("../vc-mentions/src/Option").OptionProps[];
  368. loading: boolean;
  369. }, {}, string, CustomSlotsType<{
  370. notFoundContent?: any;
  371. option?: any;
  372. default?: any;
  373. }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
  374. Option: import("vue").DefineComponent<{
  375. label: {
  376. default: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  377. type: PropType<import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode)>;
  378. };
  379. value: StringConstructor;
  380. disabled: BooleanConstructor;
  381. payload: {
  382. type: PropType<Record<string, any>>;
  383. default: Record<string, any>;
  384. };
  385. }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
  386. label: {
  387. default: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  388. type: PropType<import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode)>;
  389. };
  390. value: StringConstructor;
  391. disabled: BooleanConstructor;
  392. payload: {
  393. type: PropType<Record<string, any>>;
  394. default: Record<string, any>;
  395. };
  396. }>>, {
  397. label: import("../_util/type").VueNode | ((o: import("../vc-mentions/src/Option").BaseOptionsProps) => import("../_util/type").VueNode);
  398. disabled: boolean;
  399. payload: Record<string, any>;
  400. }, {}>;
  401. getMentions: (value?: string, config?: MentionsConfig) => MentionsEntity[];
  402. install: (app: App) => App<any>;
  403. };
  404. export default _default;