@vnejs/plugins.settings.volume 0.2.0 → 0.2.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/modules/volume.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { ModuleCore } from "@vnejs/module.core";
|
|
|
2
2
|
import type { VolumePluginConstants, VolumePluginEvents, VolumePluginParams, VolumePluginSettings } from "../types.js";
|
|
3
3
|
export declare class Volume extends ModuleCore<VolumePluginEvents, VolumePluginConstants, VolumePluginSettings, VolumePluginParams> {
|
|
4
4
|
name: string;
|
|
5
|
-
|
|
5
|
+
isDestroyAfterStart: boolean;
|
|
6
|
+
setup: () => Promise<[import("@vnejs/shared").EmitResults<"vne:settings:init"> | undefined, import("@vnejs/shared").EmitResults<"vne:settings:init"> | undefined, import("@vnejs/shared").EmitResults<"vne:settings:init"> | undefined]>;
|
|
6
7
|
}
|
package/dist/modules/volume.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
export class Volume extends ModuleCore {
|
|
3
3
|
name = "volume";
|
|
4
|
-
|
|
4
|
+
isDestroyAfterStart = true;
|
|
5
|
+
setup = () => Promise.all([
|
|
5
6
|
this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.VOLUME.COMMON, value: 100 }),
|
|
6
7
|
this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.VOLUME.AUDIO, value: 100 }),
|
|
7
8
|
this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.VOLUME.VIDEO, value: 100 }),
|
package/package.json
CHANGED
package/src/modules/volume.ts
CHANGED
|
@@ -5,7 +5,9 @@ import type { VolumePluginConstants, VolumePluginEvents, VolumePluginParams, Vol
|
|
|
5
5
|
export class Volume extends ModuleCore<VolumePluginEvents, VolumePluginConstants, VolumePluginSettings, VolumePluginParams> {
|
|
6
6
|
name = "volume";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
isDestroyAfterStart = true;
|
|
9
|
+
|
|
10
|
+
setup = () =>
|
|
9
11
|
Promise.all([
|
|
10
12
|
this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.VOLUME.COMMON, value: 100 }),
|
|
11
13
|
this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.VOLUME.AUDIO, value: 100 }),
|
package/src/tests/volume.test.ts
CHANGED
|
@@ -11,11 +11,11 @@ describe("Volume", () => {
|
|
|
11
11
|
registerVolumePluginVne();
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
it("
|
|
14
|
+
it("setup registers common, audio and video volume settings", async () => {
|
|
15
15
|
const { module, observer } = createVolumeTestModule(Volume, { subscribe: false });
|
|
16
16
|
const init = spyEvent(observer, SETTINGS_EVENTS.INIT);
|
|
17
17
|
|
|
18
|
-
await (module as Volume).
|
|
18
|
+
await (module as Volume).setup();
|
|
19
19
|
|
|
20
20
|
expect(init).toHaveBeenCalledTimes(3);
|
|
21
21
|
expect(init).toHaveBeenCalledWith({ name: SETTINGS_KEYS.COMMON, value: 100 });
|