🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

js-plugin

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-plugin - npm Package Compare versions

Comparing version
1.0.7
to
1.0.8
+22
plugin.d.ts
export interface ExtensionPoint {
[extPoint: string]: (...args) => unknown;
}
export interface Plugin {
name: string;
initialize?: () => void;
/**
* ExtensionPoint can be nested, e.g. 'menu.processMenuItems'
* When index signature is provided, every key have to match the type, the type for 'name' and 'initialize' is added as index signature.
*/
[key: string]: string | (() => void) | ExtensionPoint | ((...args) => unknown);
}
export function register(plugin: Plugin): void;
export function unregister(name: string): void;
export function getPlugin(name: string): Plugin;
export function getPlugins(extPoint: string): Plugin[];
export function processRawPlugins(callback: (plugins: Plugin[]) => void): void;
export function invoke(extPoint: string, ...args): unknown;
export function sort(arr: unknown[], sortProp: string): void;
+4
-2
{
"name": "js-plugin",
"version": "1.0.7",
"version": "1.0.8",
"repository": "rekit/js-plugin",
"main": "plugin.js",
"types": "plugin.d.ts",
"publishConfig": {

@@ -13,3 +14,4 @@ "registry": "https://registry.npmjs.org"

"files": [
"plugin.js"
"plugin.js",
"plugin.d.ts"
],

@@ -16,0 +18,0 @@ "devDependencies": {

@@ -10,3 +10,3 @@ # Overview

Note that every plugin in the system maybe not bundled separatly but just a logical plugin. Below I give two cases to show the advantages of plugin based architecture.
Every plugin in the system maybe not bundled separatly but just a logical plugin. Below two cases show the advantages of plugin based architecture.

@@ -359,2 +359,2 @@ ## Example 1: Menu

# License
MIT
MIT