@plteam/chat-ui
Version:
CUI Kit is a free and open-source library for creating AI assistant chat interfaces, built with React, Material UI, and TypeScript
67 lines (66 loc) • 6.27 kB
TypeScript
import * as React from 'react';
import { ListItemTextProps } from '@mui/material/ListItemText';
import { type ButtonProps } from '@mui/material/Button';
import { type IconButtonProps } from '@mui/material/IconButton';
import { SlotPropsType } from './SlotPropsType';
import { MdMenuItemProps } from '../../ui/menu/MdMenuItem';
import { Thread, Message } from '../../models';
import { ChatUsersProps } from './useChatProps';
import { ChatIconSlotsType } from './ChatIconSlots';
import { ChipProps } from '@mui/material/Chip';
import { ListItemButtonProps } from '@mui/material/ListItemButton';
export type SlotValue<T = any> = React.JSXElementConstructor<T>;
export type CoreSlots = {
button: SlotValue<ButtonProps>;
iconButton: SlotValue<IconButtonProps>;
listItemText: SlotValue<ListItemTextProps>;
menuItem: SlotValue<MdMenuItemProps>;
chip: SlotValue<ChipProps>;
listItemButton: SlotValue<ListItemButtonProps>;
};
export type SlotsType<DM extends Message, DD extends Thread<DM>> = {
[key in keyof SlotPropsType<DM, DD>]: SlotValue<SlotPropsType<DM, DD>[key]>;
} & ChatIconSlotsType;
export type SlotsTypeEase = SlotsType<any, any>;
type SlotsReturnType<DM extends Message, DD extends Thread<DM>> = {
slots: SlotsType<DM, DD>;
coreSlots: CoreSlots;
slotProps: Partial<SlotPropsType<DM, DD>>;
};
export declare const getMarkdownSlots: <DM extends Message, DD extends Thread<DM>>(slots: Partial<SlotsType<DM, DD>> | undefined) => {
markdownWrapper: SlotValue<import("@mui/material").BoxProps<"div", {}>>;
markdownMessageRoot: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}> | SlotValue<import("@mui/material").BoxProps<"div", {}>>;
markdownReasoningRoot: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}> | SlotValue<import("@mui/material").BoxProps<"div", {}>>;
markdownA: SlotValue<import("@mui/material/Link").LinkProps<"a", {}>>;
markdownTable: SlotValue<import("@mui/material").TableProps<"table", {}>>;
markdownThead: SlotValue<import("@mui/material/TableHead").TableHeadProps<"thead", {}>>;
markdownTbody: SlotValue<import("@mui/material/TableBody").TableBodyProps<"tbody", {}>>;
markdownTh: React.FC<Partial<Record<"textComponent", React.JSXElementConstructor<import("@mui/material/Typography").TypographyProps<"span", {}>>> & Record<"textComponentProps", import("@mui/material/Typography").TypographyProps<"span", {}>>> & import("@mui/material").TableCellProps> | SlotValue<import("@mui/material").TableCellProps>;
markdownTd: React.FC<Partial<Record<"textComponent", React.JSXElementConstructor<import("@mui/material/Typography").TypographyProps<"span", {}>>> & Record<"textComponentProps", import("@mui/material/Typography").TypographyProps<"span", {}>>> & import("@mui/material").TableCellProps> | SlotValue<import("@mui/material").TableCellProps>;
markdownTdText: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownTr: SlotValue<import("@mui/material/TableRow").TableRowProps<"tr", {}>>;
markdownSpan: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownUl: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}> | SlotValue<React.HTMLAttributes<HTMLUListElement>>;
markdownOl: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, {}> | SlotValue<React.OlHTMLAttributes<HTMLOListElement>>;
markdownH1: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownH2: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownH3: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownH4: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownH5: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownH6: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
markdownImg: SlotValue<React.ClassAttributes<HTMLImageElement> & React.ImgHTMLAttributes<HTMLImageElement> & {
rootClassName?: string | undefined;
}>;
markdownCodeWrapper: SlotValue<React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement>>;
markdownCode: SlotValue<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>>;
markdownHr: SlotValue<any> | import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/Divider").DividerTypeMap<{}, "hr">>;
markdownBlockquote: SlotValue<React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>>;
markdownP: SlotValue<import("@mui/material/Typography").TypographyProps<"span", {}>>;
};
export declare const getMarkdownSlotProps: <DM extends Message, DD extends Thread<DM>>(slotProps: Partial<SlotPropsType<DM, DD>> | undefined) => SlotPropsType<DM, DD>;
export declare const usePropsSlots: <DM extends Message, DD extends Thread<DM>>(usersProps: Pick<ChatUsersProps<DM, DD>, "slots" | "coreSlots" | "slotProps">) => SlotsReturnType<DM, DD>;
export {};