105 lines
4.2 KiB
TypeScript
105 lines
4.2 KiB
TypeScript
import { AudioRecorderRef, CopilotChatAudioRecorder } from "./CopilotChatAudioRecorder.cjs";
|
|
import { CopilotChatLabels } from "../../providers/CopilotChatConfigurationProvider.cjs";
|
|
import { WithSlots } from "../../lib/slots.cjs";
|
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
import React from "react";
|
|
|
|
//#region src/components/chat/CopilotChatInput.d.ts
|
|
type CopilotChatInputMode = "input" | "transcribe" | "processing";
|
|
type ToolsMenuItem = {
|
|
label: string;
|
|
} & ({
|
|
action: () => void;
|
|
items?: never;
|
|
} | {
|
|
action?: never;
|
|
items: (ToolsMenuItem | "-")[];
|
|
});
|
|
type CopilotChatInputSlots = {
|
|
textArea: typeof CopilotChatInput.TextArea;
|
|
sendButton: typeof CopilotChatInput.SendButton;
|
|
startTranscribeButton: typeof CopilotChatInput.StartTranscribeButton;
|
|
cancelTranscribeButton: typeof CopilotChatInput.CancelTranscribeButton;
|
|
finishTranscribeButton: typeof CopilotChatInput.FinishTranscribeButton;
|
|
addMenuButton: typeof CopilotChatInput.AddMenuButton;
|
|
audioRecorder: typeof CopilotChatAudioRecorder;
|
|
disclaimer: typeof CopilotChatInput.Disclaimer;
|
|
};
|
|
type CopilotChatInputRestProps = {
|
|
mode?: CopilotChatInputMode;
|
|
toolsMenu?: (ToolsMenuItem | "-")[];
|
|
autoFocus?: boolean;
|
|
onSubmitMessage?: (value: string) => void;
|
|
onStop?: () => void;
|
|
isRunning?: boolean;
|
|
onStartTranscribe?: () => void;
|
|
onCancelTranscribe?: () => void;
|
|
onFinishTranscribe?: () => void;
|
|
onFinishTranscribeWithAudio?: (audioBlob: Blob) => Promise<void>;
|
|
onAddFile?: () => void;
|
|
value?: string;
|
|
onChange?: (value: string) => void; /** Positioning mode for the input container. Default: 'static' */
|
|
positioning?: "static" | "absolute"; /** Keyboard height in pixels for mobile keyboard handling */
|
|
keyboardHeight?: number; /** Ref for the outer positioning container */
|
|
containerRef?: React.Ref<HTMLDivElement>; /** Whether to show the disclaimer. Default: true for absolute positioning, false for static */
|
|
showDisclaimer?: boolean;
|
|
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange">;
|
|
type CopilotChatInputBaseProps = WithSlots<CopilotChatInputSlots, CopilotChatInputRestProps>;
|
|
type CopilotChatInputChildrenArgs = CopilotChatInputBaseProps extends {
|
|
children?: infer C;
|
|
} ? C extends ((props: infer P) => React.ReactNode) ? P : never : never;
|
|
type CopilotChatInputProps = Omit<CopilotChatInputBaseProps, "children"> & {
|
|
children?: (props: CopilotChatInputChildrenArgs) => React.ReactNode;
|
|
};
|
|
declare function CopilotChatInput({
|
|
mode,
|
|
onSubmitMessage,
|
|
onStop,
|
|
isRunning,
|
|
onStartTranscribe,
|
|
onCancelTranscribe,
|
|
onFinishTranscribe,
|
|
onFinishTranscribeWithAudio,
|
|
onAddFile,
|
|
onChange,
|
|
value,
|
|
toolsMenu,
|
|
autoFocus,
|
|
positioning,
|
|
keyboardHeight,
|
|
containerRef,
|
|
showDisclaimer,
|
|
textArea,
|
|
sendButton,
|
|
startTranscribeButton,
|
|
cancelTranscribeButton,
|
|
finishTranscribeButton,
|
|
addMenuButton,
|
|
audioRecorder,
|
|
disclaimer,
|
|
children,
|
|
className,
|
|
...props
|
|
}: CopilotChatInputProps): react_jsx_runtime0.JSX.Element;
|
|
declare namespace CopilotChatInput {
|
|
const SendButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
const ToolbarButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
icon: React.ReactNode;
|
|
labelKey: keyof CopilotChatLabels;
|
|
defaultClassName?: string;
|
|
}>;
|
|
const StartTranscribeButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
const CancelTranscribeButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
const FinishTranscribeButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
const AddMenuButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
toolsMenu?: (ToolsMenuItem | "-")[];
|
|
onAddFile?: () => void;
|
|
}>;
|
|
type TextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
const AudioRecorder: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<AudioRecorderRef>>;
|
|
const Disclaimer: React.FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
}
|
|
//#endregion
|
|
export { CopilotChatInput, CopilotChatInputMode, CopilotChatInputProps, ToolsMenuItem };
|
|
//# sourceMappingURL=CopilotChatInput.d.cts.map
|