type(mentions): export interface MentionsProps (#49281)

* type(mentions): export interface MentionsProps

* type: fix
This commit is contained in:
thinkasany
2024-06-06 17:09:14 +08:00
committed by GitHub
parent ab1acc720e
commit 36d6d3d7f2
3 changed files with 5 additions and 3 deletions

View File

@@ -85,7 +85,7 @@ export type { LayoutProps, SiderProps } from './layout';
export { default as List } from './list';
export type { ListProps } from './list';
export { default as Mentions } from './mentions';
export type { MentionProps } from './mentions';
export type { MentionProps, MentionsProps } from './mentions';
export { default as Menu } from './menu';
export type { MenuItemProps, MenuProps, MenuRef, MenuTheme, SubMenuProps } from './menu';
export { default as message } from './message';

View File

@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { Mentions } from 'antd';
import type { MentionProps } from 'antd';
import type { MentionsProps } from 'antd';
const MOCK_DATA = {
'@': ['afc163', 'zombiej', 'yesmeck'],
@@ -12,7 +12,7 @@ type PrefixType = keyof typeof MOCK_DATA;
const App: React.FC = () => {
const [prefix, setPrefix] = useState<PrefixType>('@');
const onSearch: MentionProps['onSearch'] = (_, newPrefix) => {
const onSearch: MentionsProps['onSearch'] = (_, newPrefix) => {
setPrefix(newPrefix as PrefixType);
};

View File

@@ -52,6 +52,8 @@ export interface MentionProps extends Omit<RcMentionsProps, 'suffix'> {
variant?: Variant;
}
export interface MentionsProps extends MentionProps {}
export interface MentionsRef extends RcMentionsRef {}
interface MentionsConfig {