0.0.12 • Published 4 years ago
jk-plugin-core v0.0.12
jk-plugin-core
'jk-plugin-core' is the core of jk-web app's plug-in system. It is used to register, log off and bind plug-ins to specified objects, as follows:
- The plug-in must follow the iPlugin interface
export interface IPlugin {
name: string;
uuid: string;
version: string;
[key: string]: any;
}
- Plug in core export class
export default class PluginCore {
private constructor();
/**Scope, which is used to bind the property name of the global object*/
private scope;
/**Plug in core instance*/
private static Instance;
/**Plug in list*/
private Plugins;
/**Get plug-in core instance*/
static getInstance(scope?: string): PluginCore | null;
/**Hang on an object*/
static bind(target: IKV): void;
/**Register plug-ins*/
register(plugin: IPlugin): void;
/**Destroy plug-ins*/
unRegister(plugin: IPlugin): void;
}