Skip to content

Commit ab93dad

Browse files
committed
chore: Add define plugin
1 parent d33c01d commit ab93dad

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

typescript-packages/client/src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,21 @@ import Toaster from './hooks/toaster-hook';
1616
export const errorBoundaryHook: ErrorBoundaryHook = new ErrorBoundaryHook();
1717
export const routerHook: RouterHook = new RouterHook();
1818
export const toaster: Toaster = new Toaster();
19+
20+
export interface Plugin {
21+
version?: string;
22+
icon: JSX.Element;
23+
content?: JSX.Element;
24+
onDismount?(): void;
25+
alwaysRender?: boolean;
26+
titleView?: JSX.Element;
27+
}
28+
29+
export type DefinePluginFn = () => Plugin;
30+
31+
export const definePlugin = (fn: DefinePluginFn): DefinePluginFn => {
32+
return (...args) => {
33+
// TODO: Maybe wrap this
34+
return fn(...args);
35+
};
36+
};

0 commit comments

Comments
 (0)