diff --git a/src/sender/interface.ts b/src/sender/interface.ts index d395175f..a4030465 100644 --- a/src/sender/interface.ts +++ b/src/sender/interface.ts @@ -1,10 +1,8 @@ import type { ButtonProps, TextAreaProps } from "ant-design-vue"; import { Input } from "ant-design-vue"; -import type { ChangeEvent, ClipboardEventHandler, KeyboardEventHandler } from "ant-design-vue/es/_util/EventInterface"; import type { ConfigProviderProps } from "ant-design-vue"; import type { CSSProperties, VNode } from "vue"; import type { AllowSpeech } from "./useSpeech"; -import type { InputRef } from "ant-design-vue/es/vc-input/inputProps"; import type { AvoidValidation } from '../type-utility'; import SendButton from "./components/SendButton.vue"; import ClearButton from "./components/ClearButton.vue"; @@ -13,6 +11,16 @@ import SpeechButton from "./components/SpeechButton/index.vue"; export type SubmitType = 'enter' | 'shiftEnter' | false; +export type KeyboardEventHandler = (e: KeyboardEvent) => void; + +export type ClipboardEventHandler = (e: ClipboardEvent) => void; + +export type ChangeEvent = Event & { + target: { + value?: string | undefined; + }; +} + export interface SenderComponents { input?: typeof Input.TextArea; } @@ -80,9 +88,14 @@ export interface SenderProps { autoSize?: AvoidValidation; } +export interface InputFocusOptions extends FocusOptions { + cursor?: 'start' | 'end' | 'all'; +} export type SenderRef = { nativeElement: HTMLDivElement; -} & Pick; + focus: (options?: InputFocusOptions) => void; + blur: () => void; +}; export interface SenderHeaderContextProps { prefixCls?: ConfigProviderProps['prefixCls'];