@compass-framework/plugin 1.3.2 → 1.3.4

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,5 +1,5 @@
1
- import {BasePlugin} from "./BasePlugin";
2
- import {PluginRuntime} from "./PluginRuntime";
1
+ import { BasePlugin } from "./BasePlugin";
2
+ import { Environment } from "./PluginRuntime";
3
3
 
4
4
  export declare abstract class BasePluginManager<Arguments = {}> {
5
5
  protected constructor();
@@ -10,5 +10,5 @@ export declare abstract class BasePluginManager<Arguments = {}> {
10
10
 
11
11
  public unInstallPlugin(plugin: BasePlugin<Arguments>): void;
12
12
 
13
- public getPluginRuntime(): PluginRuntime;
13
+ public getEnvironment(): Environment;
14
14
  }
@@ -1,9 +1,15 @@
1
- import {PluginSpecification} from "./PluginSpecification";
1
+ import { PluginSpecification } from "./PluginSpecification";
2
2
 
3
3
  export declare class PluginIdentifier<API = void> {
4
- groupId: string;
5
- name: string;
6
- artifactId: string;
4
+ public readonly groupId: string;
5
+ public readonly name: string;
6
+ public readonly artifactId: string;
7
7
 
8
8
  public constructor(spec: PluginSpecification);
9
+
10
+ public for(prefix: string): string;
11
+
12
+ public hashcode(): number;
13
+
14
+ public equals(other: PluginIdentifier<API>): boolean;
9
15
  }
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-framework/plugin",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "@compass-framework/plugin public api",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./index.js",
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "include": [
4
+ "../../global.d.ts",
5
+ "@types/"
6
+ ]
7
+ }