@netless/window-manager 1.0.6-beta.0 → 1.0.6-beta.2
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/dist/index.d.ts +7 -5
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ExtendPluginManager.ts +6 -0
- package/src/index.ts +5 -0
package/package.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { WindowManager } from ".";
|
2
2
|
import Emittery from "emittery";
|
3
3
|
import type { EmitterType } from "./InternalEmitter";
|
4
|
+
import { appRegister } from "./Register";
|
4
5
|
|
5
6
|
export interface ExtendContext {
|
6
7
|
readonly manager: ExtendPluginManager;
|
@@ -35,6 +36,11 @@ export class ExtendPluginManager {
|
|
35
36
|
internalEmitter: props.internalEmitter,
|
36
37
|
};
|
37
38
|
}
|
39
|
+
|
40
|
+
hasRegister(kind: string) {
|
41
|
+
return appRegister.appClasses.has(kind);
|
42
|
+
}
|
43
|
+
|
38
44
|
use(extend: ExtendPluginInstance<any>) {
|
39
45
|
this.extends.set(extend.kind, extend);
|
40
46
|
extend._inject(this.context);
|
package/src/index.ts
CHANGED
@@ -57,6 +57,7 @@ import type { PageController, AddPageParams, PageState } from "./Page";
|
|
57
57
|
import { boxEmitter } from "./BoxEmitter";
|
58
58
|
import { IframeBridge } from "./View/IframeBridge";
|
59
59
|
import { setOptions } from "@netless/app-media-player";
|
60
|
+
import type { ExtendPluginInstance } from "./ExtendPluginManager";
|
60
61
|
import { ExtendPluginManager } from "./ExtendPluginManager";
|
61
62
|
export * from "./View/IframeBridge";
|
62
63
|
|
@@ -1092,6 +1093,10 @@ export class WindowManager
|
|
1092
1093
|
this._iframeBridge || (this._iframeBridge = new IframeBridge(this, this.appManager));
|
1093
1094
|
return this._iframeBridge;
|
1094
1095
|
}
|
1096
|
+
|
1097
|
+
public useExtendPlugin(extend: ExtendPluginInstance<any>) {
|
1098
|
+
this.extendPluginManager?.use(extend);
|
1099
|
+
}
|
1095
1100
|
}
|
1096
1101
|
|
1097
1102
|
setupBuiltin();
|