vue3-chat-yz
Version:
vue3-chat-yz
59 lines (58 loc) • 1.51 kB
TypeScript
import { CSSProperties, Component, Vnode } from 'vue';
import { DropDownItemProps } from './components/types';
export interface Groupable {
/**
* @desc 分组排序函数
* @descEN Group sorter
*/
sort?: unknown;
/**
* @desc 自定义分组标签渲染
* @descEN Semantic custom rendering
*/
title?: unknown;
}
export interface MenuProps {
items: DropDownItemProps[];
onClick?: (value: Conversation) => void;
}
export interface ItemProps {
direction?: "ltr" | "rtl";
className?: string;
active?: boolean;
info?: Conversation;
menu?: MenuProps;
inEllipsis?: boolean;
line?: number;
}
export interface GroupTitleRenderComponents {
components: {
GroupTitle: Component<any>;
};
}
export type GroupTitleRender = ((group: string, info: GroupTitleRenderComponents) => number | string | Vnode) | undefined;
export interface Conversation {
key: string;
label?: string;
timestamp?: number;
group?: string;
icon?: string;
disabled?: boolean;
}
export interface ConversationProps {
style?: CSSProperties;
className?: string;
direction?: "ltr" | "rtl";
groupable?: boolean | Groupable;
items?: Conversation[];
activeKey?: string;
defaultActiveKey?: string;
onActiveChange?: (value: string) => boolean;
classNames?: {
item: string;
};
styles?: {
item: CSSProperties;
};
menu?: ((value: Conversation) => MenuProps) | DropDownItemProps[];
}