Skip to content

Commit

Permalink
⚡ chore: update callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
LCJove committed Jun 12, 2024
1 parent 9b4a0b1 commit bfb4d0d
Show file tree
Hide file tree
Showing 7 changed files with 613 additions and 36 deletions.
9 changes: 5 additions & 4 deletions src/ChatItem/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ReactNode } from 'react';

import { ActionsProps } from '@/ChatList/ActionsBar';
import { EditableMessageProps } from '@/EditableMessage';
import { OpenAIChatMessage } from '@/ProChat/types/chat';
import { ChatMessageError, DivProps, MetaData } from '@/types';
import { MarkdownProps } from '@ant-design/pro-editor';

Expand Down Expand Up @@ -104,11 +105,11 @@ export interface ChatItemProps<T = Record<string, any>> {
) => ReactNode
>;
actionsCallbacks?: {
onEditFinished?: (id?: string, value?: string) => void;
beforeDelFinished?: (id?: string) => void;
onRegenerateFinished?: (id?: string, error?: boolean) => void;
onEdit?: (id?: string, value?: string) => Promise<void> | void;
onDelete?: (id?: string) => Promise<void> | void;
onRegenerate?: (id?: string, error?: boolean) => Promise<void> | void;
};
actionsProps?: Record<string, ActionsProps>;
actionsProps?: Record<OpenAIChatMessage['role'], ActionsProps>;
};

renderErrorMessages?: (data: ChatMessageError) => ReactNode;
Expand Down
Loading

0 comments on commit bfb4d0d

Please sign in to comment.