0.0.12 • Published 4 years ago

jk-plugin-core v0.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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:

  1. The plug-in must follow the iPlugin interface
export interface IPlugin {

    name: string;

    uuid: string;

    version: string;

    [key: string]: any;

}
  1. 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;

}
0.0.12

4 years ago

0.0.11

4 years ago

0.0.1

4 years ago