From 36d6d3d7f2f19a3447cd4cac870ec6feabc63e95 Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Thu, 6 Jun 2024 17:09:14 +0800 Subject: [PATCH] type(mentions): export interface MentionsProps (#49281) * type(mentions): export interface MentionsProps * type: fix --- components/index.ts | 2 +- components/mentions/demo/prefix.tsx | 4 ++-- components/mentions/index.tsx | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/index.ts b/components/index.ts index 11188036cc..9055860120 100644 --- a/components/index.ts +++ b/components/index.ts @@ -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'; diff --git a/components/mentions/demo/prefix.tsx b/components/mentions/demo/prefix.tsx index b40312902d..1822af8165 100644 --- a/components/mentions/demo/prefix.tsx +++ b/components/mentions/demo/prefix.tsx @@ -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('@'); - const onSearch: MentionProps['onSearch'] = (_, newPrefix) => { + const onSearch: MentionsProps['onSearch'] = (_, newPrefix) => { setPrefix(newPrefix as PrefixType); }; diff --git a/components/mentions/index.tsx b/components/mentions/index.tsx index 30a4a01cf4..28b461cfc6 100644 --- a/components/mentions/index.tsx +++ b/components/mentions/index.tsx @@ -52,6 +52,8 @@ export interface MentionProps extends Omit { variant?: Variant; } +export interface MentionsProps extends MentionProps {} + export interface MentionsRef extends RcMentionsRef {} interface MentionsConfig {