@moonset/executor
Version:
The Moonset Executor
46 lines (45 loc) • 1.19 kB
TypeScript
export interface DataPlugin {
version: '1';
plugin: 'data';
type: string;
init: (host: PluginHost, platform: string) => void;
import: (host: PluginHost, platform: string, data: any) => void;
export: (host: PluginHost, platform: string, data: any) => void;
}
export interface PlatformPlugin {
version: '1';
plugin: 'platform';
type: string;
init: (host: PluginHost) => void;
task: (host: PluginHost, type: string, task: any) => Promise<any>;
run: (host: PluginHost) => Promise<any>;
}
export interface Hook {
fn: Function;
thisArg: any;
}
export declare class PluginHost {
static instance: PluginHost;
readonly hooks: {
[key: string]: Hook;
};
readonly plugins: string[];
readonly cdkPlugins: string[];
constructs: {
[key: string]: any;
};
platformPlugins: {
[key: string]: any;
};
id: string;
session: string;
platform: string;
settings: any;
constructor();
/**
* Loads a plug-in into this PluginHost.
*
* @param moduleSpec the specification (path or name) of the plug-in module to be loaded.
*/
load(moduleSpec: string): void;
}