@vnejs/compatibility.platform.electron-with-text.locs 0.2.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.d.ts +8 -0
- package/dist/index.js +12 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +1 -0
- package/package.json +41 -0
- package/src/index.ts +20 -0
- package/src/types.ts +11 -0
- package/src/utils.ts +4 -0
- package/tsconfig.json +14 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
3
|
+
import type { ElectronConfigPayload } from "./utils.js";
|
|
4
|
+
export declare class CompatibilityElectronLocs extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
5
|
+
name: string;
|
|
6
|
+
subscribe: () => void;
|
|
7
|
+
onElectronConfig: ({ language }?: ElectronConfigPayload) => Promise<unknown[]> | undefined;
|
|
8
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import { regModule } from "@vnejs/shared";
|
|
3
|
+
export class CompatibilityElectronLocs extends ModuleCore {
|
|
4
|
+
name = "compatibility.platform.electron-with-text.locs";
|
|
5
|
+
subscribe = () => {
|
|
6
|
+
if (this.PARAMS.PLATFORMS.CURRENT_PLATFORM !== this.CONST.PLATFORMS.ELECTRON)
|
|
7
|
+
return;
|
|
8
|
+
this.on(this.EVENTS.ELECTRON.CONFIG, this.onElectronConfig);
|
|
9
|
+
};
|
|
10
|
+
onElectronConfig = ({ language } = {}) => this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.LOCS.LANG, value: language || this.PARAMS.LOCS.DEFAULT_LANG });
|
|
11
|
+
}
|
|
12
|
+
regModule(CompatibilityElectronLocs);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as ElectronPluginName, SubscribeEvents as ElectronSubscribeEvents } from "@vnejs/contracts.platform.electron";
|
|
3
|
+
import type { Params as LocsParams, PluginName as LocsPluginName, SettingsKeys as LocsSettingsKeys } from "@vnejs/contracts.text.locs";
|
|
4
|
+
export type PluginEvents = ModuleCoreEvents & Record<ElectronPluginName, ElectronSubscribeEvents>;
|
|
5
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
6
|
+
export type PluginSettings = ModuleCoreSettings & Record<LocsPluginName, LocsSettingsKeys>;
|
|
7
|
+
export type PluginParams = ModuleCoreParams & Record<LocsPluginName, LocsParams>;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils.d.ts
ADDED
package/dist/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/compatibility.platform.electron-with-text.locs",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src",
|
|
18
|
+
"tsconfig.json"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "echo \"Error: no test specified\"",
|
|
22
|
+
"build": "npx @vnejs/monorepo package",
|
|
23
|
+
"publish:major:plugin": "npm run publish:major",
|
|
24
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
25
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
26
|
+
"publish:major": "npx @vnejs/monorepo publish major --access public",
|
|
27
|
+
"publish:minor": "npx @vnejs/monorepo publish minor --access public",
|
|
28
|
+
"publish:patch": "npx @vnejs/monorepo publish patch --access public"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@vnejs/contracts.platform.electron": "~0.2.0",
|
|
34
|
+
"@vnejs/contracts.text.locs": "~0.2.0",
|
|
35
|
+
"@vnejs/module.core": "~0.2.0",
|
|
36
|
+
"@vnejs/shared": "~0.2.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@vnejs/configs.ts-common": "~0.2.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import { regModule } from "@vnejs/shared";
|
|
3
|
+
|
|
4
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
5
|
+
import type { ElectronConfigPayload } from "./utils.js";
|
|
6
|
+
|
|
7
|
+
export class CompatibilityElectronLocs extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
8
|
+
name = "compatibility.platform.electron-with-text.locs";
|
|
9
|
+
|
|
10
|
+
subscribe = () => {
|
|
11
|
+
if (this.PARAMS.PLATFORMS.CURRENT_PLATFORM !== this.CONST.PLATFORMS.ELECTRON) return;
|
|
12
|
+
|
|
13
|
+
this.on(this.EVENTS.ELECTRON.CONFIG, this.onElectronConfig);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
onElectronConfig = ({ language }: ElectronConfigPayload = {}) =>
|
|
17
|
+
this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.LOCS.LANG, value: language || this.PARAMS.LOCS.DEFAULT_LANG });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
regModule(CompatibilityElectronLocs);
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as ElectronPluginName, SubscribeEvents as ElectronSubscribeEvents } from "@vnejs/contracts.platform.electron";
|
|
3
|
+
import type { Params as LocsParams, PluginName as LocsPluginName, SettingsKeys as LocsSettingsKeys } from "@vnejs/contracts.text.locs";
|
|
4
|
+
|
|
5
|
+
export type PluginEvents = ModuleCoreEvents & Record<ElectronPluginName, ElectronSubscribeEvents>;
|
|
6
|
+
|
|
7
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
8
|
+
|
|
9
|
+
export type PluginSettings = ModuleCoreSettings & Record<LocsPluginName, LocsSettingsKeys>;
|
|
10
|
+
|
|
11
|
+
export type PluginParams = ModuleCoreParams & Record<LocsPluginName, LocsParams>;
|
package/src/utils.ts
ADDED