@compass-framework/plugin 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +12 -0
- package/@types/BasePlugin.d.ts +3 -3
- package/@types/BasePluginManager.d.ts +10 -8
- package/@types/PluginIdentifier.d.ts +1 -1
- package/@types/PluginRuntime.d.ts +3 -3
- package/@types/PluginSetup.ts +7 -0
- package/index.d.ts +1 -0
- package/package.json +4 -2
- package/tsconfig.json +7 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const baseConfig = require("../../.eslintrc.js")
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
...baseConfig,
|
|
6
|
+
"parserOptions": {
|
|
7
|
+
"warnOnUnsupportedTypeScriptVersion": false,
|
|
8
|
+
"ecmaVersion": 12,
|
|
9
|
+
"sourceType": "module",
|
|
10
|
+
"project": path.resolve(__dirname, "tsconfig.json")
|
|
11
|
+
}
|
|
12
|
+
}
|
package/@types/BasePlugin.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {PluginIdentifier} from "./PluginIdentifier";
|
|
1
|
+
import { Environment } from "./PluginRuntime";
|
|
2
|
+
import { PluginIdentifier } from "./PluginIdentifier";
|
|
3
3
|
|
|
4
4
|
export declare abstract class BasePlugin<Arguments = {}> {
|
|
5
5
|
public abstract onCreated(args: Arguments): Promise<PluginIdentifier>;
|
|
6
6
|
|
|
7
|
-
public abstract onMounted(
|
|
7
|
+
public abstract onMounted(env: Environment): Promise<void>;
|
|
8
8
|
|
|
9
9
|
public abstract onRemoved(): void;
|
|
10
10
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ViewGroup } from "@compass-framework/core";
|
|
2
|
+
import { PluginSetup } from "./PluginSetup";
|
|
3
|
+
import { BasePlugin } from "./BasePlugin";
|
|
4
|
+
import { Environment } from "./PluginRuntime";
|
|
3
5
|
|
|
4
|
-
export declare abstract class BasePluginManager<
|
|
5
|
-
protected constructor();
|
|
6
|
+
export declare abstract class BasePluginManager<Setup extends PluginSetup> {
|
|
7
|
+
protected constructor(container: ViewGroup);
|
|
6
8
|
|
|
7
|
-
public
|
|
9
|
+
public installPlugin(plugin: BasePlugin<Setup>): Promise<void>;
|
|
8
10
|
|
|
9
|
-
public
|
|
11
|
+
public unInstallPlugin(plugin: BasePlugin<Setup>): void;
|
|
10
12
|
|
|
11
|
-
public
|
|
13
|
+
public abstract getPluginSetup(): Setup;
|
|
12
14
|
|
|
13
|
-
public
|
|
15
|
+
public getEnvironment(): Environment;
|
|
14
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {PluginIdentifier} from "./PluginIdentifier";
|
|
2
|
-
import {PluginPlatform} from "./PluginPlatform";
|
|
1
|
+
import { PluginIdentifier } from "./PluginIdentifier";
|
|
2
|
+
import { PluginPlatform } from "./PluginPlatform";
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface Environment {
|
|
5
5
|
exportAPIs<T>(key: PluginIdentifier<T>, apis: T): void;
|
|
6
6
|
|
|
7
7
|
importAPIs<T>(key: PluginIdentifier<T>): T;
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compass-framework/plugin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "@compass-framework/plugin public api",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -10,5 +10,7 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@compass-framework/core": "1.2.48"
|
|
15
|
+
}
|
|
14
16
|
}
|