Skip to content

Commit

Permalink
✨ feat: add plugin client render interface
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Aug 20, 2023
1 parent e2cb97c commit 90412d1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@


> 📊 Total: <kbd>**2**</
> 📊 Total: <kbd>**3**</kbd>
<a href="https://github.com/arvinxx" title="arvinxx">
Expand All @@ -13,15 +9,3 @@
<a href="https://github.com/actions-user" title="actions-user">
<img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="50" />
</a>



> 📊 Total: <kbd>**2**</kbd>
<a href="https://github.com/arvinxx" title="arvinxx">
<img src="https://avatars.githubusercontent.com/u/28616219?v=4" width="50" />
</a>
<a href="https://github.com/apps/dependabot" title="dependabot[bot]">
<img src="https://avatars.githubusercontent.com/in/29110?v=4" width="50" />
</a>

23 changes: 23 additions & 0 deletions src/types/client.ts
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;
}
1 change: 1 addition & 0 deletions src/types/index.ts
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';

0 comments on commit 90412d1

Please sign in to comment.