@player-ui/meta-plugin 0.0.1-next.1
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.cjs.js +16 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.esm.js +12 -0
- package/package.json +17 -0
- package/src/index.ts +18 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
class MetaPlugin {
|
|
6
|
+
constructor(plugins = []) {
|
|
7
|
+
this.name = "meta-plugin";
|
|
8
|
+
this.plugins = plugins;
|
|
9
|
+
}
|
|
10
|
+
apply(player) {
|
|
11
|
+
this.plugins.forEach((plugin) => player.registerPlugin(plugin));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.MetaPlugin = MetaPlugin;
|
|
16
|
+
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PlayerPlugin, Player } from '@player-ui/player';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A plugin that can wrap a set of other plugins.
|
|
5
|
+
*/
|
|
6
|
+
declare class MetaPlugin implements PlayerPlugin {
|
|
7
|
+
name: string;
|
|
8
|
+
readonly plugins: Array<PlayerPlugin>;
|
|
9
|
+
constructor(plugins?: Array<PlayerPlugin>);
|
|
10
|
+
apply(player: Player): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { MetaPlugin };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class MetaPlugin {
|
|
2
|
+
constructor(plugins = []) {
|
|
3
|
+
this.name = "meta-plugin";
|
|
4
|
+
this.plugins = plugins;
|
|
5
|
+
}
|
|
6
|
+
apply(player) {
|
|
7
|
+
this.plugins.forEach((plugin) => player.registerPlugin(plugin));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { MetaPlugin };
|
|
12
|
+
//# sourceMappingURL=index.esm.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@player-ui/meta-plugin",
|
|
3
|
+
"version": "0.0.1-next.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org"
|
|
7
|
+
},
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@player-ui/binding-grammar": "0.0.1-next.1"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@babel/runtime": "7.15.4"
|
|
13
|
+
},
|
|
14
|
+
"main": "dist/index.cjs.js",
|
|
15
|
+
"module": "dist/index.esm.js",
|
|
16
|
+
"typings": "dist/index.d.ts"
|
|
17
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Player, PlayerPlugin } from '@player-ui/player';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A plugin that can wrap a set of other plugins.
|
|
5
|
+
*/
|
|
6
|
+
export class MetaPlugin implements PlayerPlugin {
|
|
7
|
+
name = 'meta-plugin';
|
|
8
|
+
|
|
9
|
+
public readonly plugins: Array<PlayerPlugin>;
|
|
10
|
+
|
|
11
|
+
constructor(plugins: Array<PlayerPlugin> = []) {
|
|
12
|
+
this.plugins = plugins;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
apply(player: Player) {
|
|
16
|
+
this.plugins.forEach((plugin) => player.registerPlugin(plugin));
|
|
17
|
+
}
|
|
18
|
+
}
|