You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/web/src/plugin/common/reg.ts

62 lines
1.3 KiB
TypeScript

import { buildRegFn, buildRegList, FastFormFieldMeta } from 'tailchat-shared';
/**
*
*/
export interface PluginGroupPanel {
/**
*
* @example com.msgbyte.webview/grouppanel
*/
name: string;
/**
*
*/
label: string;
/**
* ,
*/
provider: string;
/**
* , 使
*/
extraFormMeta: FastFormFieldMeta[];
/**
*
*/
render: React.ComponentType;
}
export const [pluginGroupPanel, regGroupPanel] =
buildRegList<PluginGroupPanel>();
export interface PluginMessageInterpreter {
name?: string;
explainMessage: (message: string) => React.ReactElement | null;
}
/**
*
* ,
*/
export const [messageInterpreter, regMessageInterpreter] =
buildRegList<PluginMessageInterpreter>();
/**
*
*
*/
export const [getMessageRender, regMessageRender] = buildRegFn<
(message: string) => React.ReactNode
>('message-render', (message) => message);
interface ChatInputAction {
label: string;
onClick: () => void;
}
export const [chatInputActions, regChatInputAction] =
buildRegList<ChatInputAction>();