@compass-framework/plugin 1.2.5 → 1.2.7
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/@types/BasePlugin.d.ts +12 -0
- package/@types/BasePluginManager.d.ts +11 -0
- package/@types/PluginIdentifier.d.ts +9 -0
- package/@types/PluginPlatform.d.ts +4 -0
- package/@types/PluginRuntime.d.ts +12 -0
- package/@types/{Specification.ts → PluginSpecification.ts} +1 -1
- package/index.d.ts +5 -5
- package/package.json +1 -1
- package/@types/Environment.d.ts +0 -12
- package/@types/Identifier.d.ts +0 -9
- package/@types/Platform.d.ts +0 -4
- package/@types/Plugin.d.ts +0 -12
- package/@types/PluginManager.d.ts +0 -9
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {PluginRuntime} from "./PluginRuntime";
|
|
2
|
+
import {PluginIdentifier} from "./PluginIdentifier";
|
|
3
|
+
|
|
4
|
+
export declare abstract class BasePlugin<Property, Arguments> {
|
|
5
|
+
public abstract onCreated(args: Arguments): PluginIdentifier;
|
|
6
|
+
|
|
7
|
+
public abstract onMounted(env: PluginRuntime<Property>): void;
|
|
8
|
+
|
|
9
|
+
public abstract onRemoved(): void;
|
|
10
|
+
|
|
11
|
+
public abstract getIdentifier(): PluginIdentifier;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {BasePlugin} from "./BasePlugin";
|
|
2
|
+
|
|
3
|
+
export declare abstract class BasePluginManager<Property, Arguments> {
|
|
4
|
+
protected constructor(args: Arguments);
|
|
5
|
+
|
|
6
|
+
public abstract getPluginProperty(): Property;
|
|
7
|
+
|
|
8
|
+
public installPlugin(plugin: BasePlugin<Property, Arguments>): void;
|
|
9
|
+
|
|
10
|
+
public unInstallPlugin(plugin: BasePlugin<Property, Arguments>): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {PluginIdentifier} from "./PluginIdentifier";
|
|
2
|
+
import {PluginPlatform} from "./PluginPlatform";
|
|
3
|
+
|
|
4
|
+
export interface PluginRuntime<Property> {
|
|
5
|
+
exportAPIs(apis: object): void;
|
|
6
|
+
|
|
7
|
+
importAPIs<T>(key: PluginIdentifier<T>): T;
|
|
8
|
+
|
|
9
|
+
getProperty(): Property;
|
|
10
|
+
|
|
11
|
+
getPlatform(): PluginPlatform;
|
|
12
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./@types/
|
|
2
|
-
export * from "./@types/
|
|
3
|
-
export * from "./@types/
|
|
4
|
-
export * from "./@types/
|
|
5
|
-
export * from "./@types/
|
|
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
package/@types/Environment.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {Identifier} from "./Identifier";
|
|
2
|
-
import {Platform} from "./Platform";
|
|
3
|
-
|
|
4
|
-
export interface Environment<Property> {
|
|
5
|
-
exportAPIs(apis: object): void;
|
|
6
|
-
|
|
7
|
-
importAPIs<T>(key: Identifier<T>): T;
|
|
8
|
-
|
|
9
|
-
getProperty(): Property;
|
|
10
|
-
|
|
11
|
-
getPlatform(): Platform;
|
|
12
|
-
}
|
package/@types/Identifier.d.ts
DELETED
package/@types/Platform.d.ts
DELETED
package/@types/Plugin.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {Environment} from "./Environment";
|
|
2
|
-
import {Identifier} from "./Identifier";
|
|
3
|
-
|
|
4
|
-
export declare abstract class Plugin<Property, Arguments> {
|
|
5
|
-
public abstract onCreated(args: Arguments): Identifier;
|
|
6
|
-
|
|
7
|
-
public abstract onMounted(env: Environment<Property>): void;
|
|
8
|
-
|
|
9
|
-
public abstract onRemoved(): void;
|
|
10
|
-
|
|
11
|
-
public abstract getIdentifier(): Identifier;
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import {Plugin} from "./Plugin";
|
|
2
|
-
|
|
3
|
-
export declare class PluginManager<Property, Arguments> {
|
|
4
|
-
public constructor(property: Property, args: Arguments);
|
|
5
|
-
|
|
6
|
-
public usePlugin(plugin: Plugin<Property, Arguments>): void;
|
|
7
|
-
|
|
8
|
-
public unUsePlugin(plugin: Plugin<Property, Arguments>): void;
|
|
9
|
-
}
|