@compass-framework/plugin 1.2.4 → 1.2.6

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.
@@ -1,5 +1,5 @@
1
- import {Environment} from "./Environment";
2
- import {Identifier} from "./Identifier";
1
+ import {Environment} from "./PluginRuntime";
2
+ import {Identifier} from "./PluginIdentifier";
3
3
 
4
4
  export declare abstract class Plugin<Property, Arguments> {
5
5
  public abstract onCreated(args: Arguments): Identifier;
@@ -0,0 +1,11 @@
1
+ import {Plugin} from "./BasePlugin";
2
+
3
+ export declare abstract class PluginManager<Property, Arguments> {
4
+ protected constructor(args: Arguments);
5
+
6
+ public abstract getPluginProperty(): Property;
7
+
8
+ public installPlugin(plugin: Plugin<Property, Arguments>): void;
9
+
10
+ public unInstallPlugin(plugin: Plugin<Property, Arguments>): void;
11
+ }
@@ -0,0 +1,9 @@
1
+ import {PluginSpecification} from "./PluginSpecification";
2
+
3
+ export declare class PluginIdentifier<API = void> {
4
+ groupId: string;
5
+ name: string;
6
+ artifactId: string;
7
+
8
+ public constructor(spec: PluginSpecification);
9
+ }
@@ -0,0 +1,4 @@
1
+ export enum PluginPlatform {
2
+ Web,
3
+ Nodejs,
4
+ }
@@ -0,0 +1,12 @@
1
+ import {PluginIdentifier} from "./PluginIdentifier";
2
+ import {PluginPlatform} from "./PluginPlatform";
3
+
4
+ export interface Environment<Property> {
5
+ exportAPIs(apis: object): void;
6
+
7
+ importAPIs<T>(key: PluginIdentifier<T>): T;
8
+
9
+ getProperty(): Property;
10
+
11
+ getPlatform(): PluginPlatform;
12
+ }
@@ -1,4 +1,4 @@
1
- export interface Specification {
1
+ export interface PluginSpecification {
2
2
  groupId: string;
3
3
  name: string;
4
4
  artifactId: string;
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./@types/Environment";
2
- export * from "./@types/Platform";
3
- export * from "./@types/Identifier";
4
- export * from "./@types/Plugin";
5
- export * from "./@types/PluginManager";
1
+ export * from "./@types/PluginRuntime";
2
+ export * from "./@types/PluginPlatform";
3
+ export * from "./@types/PluginIdentifier";
4
+ export * from "./@types/BasePlugin";
5
+ export * from "./@types/BasePluginManager";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-framework/plugin",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "@compass-framework/plugin public api",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./index.js",
@@ -10,8 +10,5 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "dependencies": {
14
- "@compass-framework/library": "1.0.5",
15
- "@compass-framework/core": "1.2.4"
16
- }
13
+ "dependencies": {}
17
14
  }
@@ -1,15 +0,0 @@
1
- import {Context} from "@compass-framework/core";
2
- import {Platform} from "./Platform";
3
- import {Identifier} from "./Identifier";
4
-
5
- export interface Environment<Property> {
6
- exportAPIs(apis: object): void;
7
-
8
- importAPIs<T>(key: Identifier<T>): T;
9
-
10
- getProperty(): Property;
11
-
12
- getPlatform(): Platform;
13
-
14
- getContext(global?: boolean): Context;
15
- }
@@ -1,9 +0,0 @@
1
- import {Specification} from "./Specification";
2
-
3
- export declare class Identifier<API = null> {
4
- groupId: string;
5
- name: string;
6
- artifactId: string;
7
-
8
- public constructor(spec: Specification);
9
- }
@@ -1,4 +0,0 @@
1
- export enum Platform {
2
- Web,
3
- Nodejs,
4
- }
@@ -1,10 +0,0 @@
1
- import {Context} from "@compass-framework/core";
2
- import {Plugin} from "./Plugin";
3
-
4
- export declare class PluginManager<Property, Arguments> {
5
- public constructor(context: Context, property: Property, args: Arguments);
6
-
7
- public usePlugin(plugin: Plugin<Property, Arguments>): void;
8
-
9
- public unUsePlugin(plugin: Plugin<Property, Arguments>): void;
10
- }