Knub 30 conversion base work; Work on Utility plugin Knub 30 conversion
This commit is contained in:
parent
1bf5a7fa28
commit
d62a4e26ae
18 changed files with 585 additions and 324 deletions
20
backend/src/plugins/ZeppelinPluginBlueprint.ts
Normal file
20
backend/src/plugins/ZeppelinPluginBlueprint.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { BasePluginType, plugin, PluginBlueprint } from "knub";
|
||||
import * as t from "io-ts";
|
||||
import { pluginConfigPreprocessor } from "../pluginUtils";
|
||||
|
||||
export interface ZeppelinPluginBlueprint<TPluginType extends BasePluginType = BasePluginType> extends PluginBlueprint<TPluginType> {
|
||||
configSchema?: t.TypeC<any>;
|
||||
}
|
||||
|
||||
export function zeppelinPlugin(name: string, blueprint: Omit<ZeppelinPluginBlueprint, "name">): ZeppelinPluginBlueprint;
|
||||
export function zeppelinPlugin<TPluginType extends BasePluginType>():
|
||||
(name: string, blueprint: Omit<ZeppelinPluginBlueprint<TPluginType>, "name">) => ZeppelinPluginBlueprint<TPluginType>;
|
||||
export function zeppelinPlugin(...args) {
|
||||
if (args.length) {
|
||||
const blueprint: ZeppelinPluginBlueprint = plugin(...(args as Parameters<typeof plugin>));
|
||||
blueprint.configPreprocessor = pluginConfigPreprocessor.bind(blueprint);
|
||||
return blueprint;
|
||||
} else {
|
||||
return zeppelinPlugin;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue