@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 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
+ }
@@ -1,10 +1,10 @@
1
- import {PluginRuntime} from "./PluginRuntime";
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(runtime: PluginRuntime): Promise<void>;
7
+ public abstract onMounted(env: Environment): Promise<void>;
8
8
 
9
9
  public abstract onRemoved(): void;
10
10
 
@@ -1,14 +1,16 @@
1
- import {BasePlugin} from "./BasePlugin";
2
- import {PluginRuntime} from "./PluginRuntime";
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<Arguments = {}> {
5
- protected constructor();
6
+ export declare abstract class BasePluginManager<Setup extends PluginSetup> {
7
+ protected constructor(container: ViewGroup);
6
8
 
7
- public abstract getArguments(): Arguments;
9
+ public installPlugin(plugin: BasePlugin<Setup>): Promise<void>;
8
10
 
9
- public installPlugin(plugin: BasePlugin<Arguments>): Promise<void>;
11
+ public unInstallPlugin(plugin: BasePlugin<Setup>): void;
10
12
 
11
- public unInstallPlugin(plugin: BasePlugin<Arguments>): void;
13
+ public abstract getPluginSetup(): Setup;
12
14
 
13
- public getPluginRuntime(): PluginRuntime;
15
+ public getEnvironment(): Environment;
14
16
  }
@@ -1,4 +1,4 @@
1
- import {PluginSpecification} from "./PluginSpecification";
1
+ import { PluginSpecification } from "./PluginSpecification";
2
2
 
3
3
  export declare class PluginIdentifier<API = void> {
4
4
  public readonly groupId: string;
@@ -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 PluginRuntime {
4
+ export interface Environment {
5
5
  exportAPIs<T>(key: PluginIdentifier<T>, apis: T): void;
6
6
 
7
7
  importAPIs<T>(key: PluginIdentifier<T>): T;
@@ -0,0 +1,7 @@
1
+ import { Context, ViewGroup } from "@compass-framework/core";
2
+
3
+ export interface PluginSetup {
4
+ getContext(global?: boolean): Context;
5
+
6
+ getContainer(): ViewGroup;
7
+ }
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./@types/PluginRuntime";
2
2
  export * from "./@types/PluginPlatform";
3
3
  export * from "./@types/PluginIdentifier";
4
+ export * from "./@types/PluginSetup";
4
5
  export * from "./@types/BasePlugin";
5
6
  export * from "./@types/BasePluginManager";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-framework/plugin",
3
- "version": "1.3.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
- "dependencies": {}
13
+ "devDependencies": {
14
+ "@compass-framework/core": "1.2.48"
15
+ }
14
16
  }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "include": [
4
+ "../../global.d.ts",
5
+ "@types/"
6
+ ]
7
+ }