fix: fix ts error for BubbleMenu and FloatingMenu in @tiptap/react (#5126)

This commit is contained in:
cosine 2024-05-10 08:50:12 +08:00 committed by GitHub
parent 152c7cb8ae
commit baff4af39e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -5,7 +5,8 @@ import { useCurrentEditor } from './Context.js'
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export type BubbleMenuProps = Omit<Optional<BubbleMenuPluginProps, 'pluginKey' | 'editor'>, 'element'> & {
export type BubbleMenuProps = Omit<Optional<BubbleMenuPluginProps, 'pluginKey'>, 'element' | 'editor'> & {
editor: BubbleMenuPluginProps['editor'] | null;
className?: string;
children: React.ReactNode;
updateDelay?: number;

View File

@ -7,7 +7,8 @@ import { useCurrentEditor } from './Context.js'
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>
export type FloatingMenuProps = Omit<Optional<FloatingMenuPluginProps, 'pluginKey' | 'editor'>, 'element'> & {
export type FloatingMenuProps = Omit<Optional<FloatingMenuPluginProps, 'pluginKey'>, 'element' | 'editor'> & {
editor: FloatingMenuPluginProps['editor'] | null;
className?: string,
children: React.ReactNode
}