-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: add plugin client render interface
- Loading branch information
Showing
3 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
/** | ||
* 插件渲染函数 | ||
* @param props - 插件渲染属性 | ||
* @returns React 节点 | ||
*/ | ||
export type PluginRender<T = any> = (props: PluginRenderProps<T>) => ReactNode; | ||
|
||
/** | ||
* 插件渲染属性 | ||
* @template Result - 结果类型,默认为 any | ||
*/ | ||
export interface PluginRenderProps<Result = any> { | ||
/** | ||
* 内容 | ||
*/ | ||
content: Result; | ||
/** | ||
* 名称 | ||
*/ | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './chatGPT'; | ||
export * from './client'; | ||
export * from './manifest'; | ||
export * from './market'; |