@scml/addon-mod-i18n-script-list 1.0.0

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/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # I18nScriptListAddonMod
2
+
3
+ ## Type definition source
4
+
5
+ Type definitions are from the repository:
6
+
7
+ - https://github.com/Lyoko-Jeremie/I18nScriptListAddonMod
8
+
9
+ Fetched from the `master` branch by default. Build: `pnpm run download && pnpm run build`.
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@scml/addon-mod-i18n-script-list",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "description": "SugarCube 2 Mod Loader Workspace",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Rikka",
9
+ "email": "admin@rikka.cc",
10
+ "url": "https://github.com/Muromi-Rikka"
11
+ },
12
+ "files": [
13
+ "type-dist",
14
+ "README.md"
15
+ ],
16
+ "type": "module",
17
+ "types": "./type-dist/global.ts",
18
+ "exports": {
19
+ "./I18nScriptList": "./type-dist/I18nScriptList.d.ts"
20
+ },
21
+ "dependencies": {
22
+ "@scml/sc2-modloader": "1.0.0",
23
+ "@scml/utils": "1.0.0"
24
+ },
25
+ "scripts": {
26
+ "download": "tsx src/download.ts",
27
+ "build": "tsdown && tsx src/after-build.ts",
28
+ "typecheck": "tsc --noEmit"
29
+ }
30
+ }
@@ -0,0 +1,46 @@
1
+ import { a as ModInfo, i as LogWrapper, n as ModUtils, o as ModZipReader, r as AddonPluginHookPointEx, t as SC2DataManager } from "./SC2DataManager-D7dvpJzz.js";
2
+
3
+ //#region remote/I18nScriptList.d.ts
4
+ interface LanguageFileItem {
5
+ language: string;
6
+ scriptFileList: string[];
7
+ }
8
+ interface I18nScriptListParams {
9
+ mainLanguage: string;
10
+ languageFile: LanguageFileItem[];
11
+ }
12
+ interface ModRecord {
13
+ mod: ModInfo;
14
+ modZip: ModZipReader;
15
+ params: I18nScriptListParams;
16
+ state: ModLanguageState;
17
+ }
18
+ declare function checkParams(params: any): params is I18nScriptListParams;
19
+ declare class ModLanguageState {
20
+ private logger;
21
+ private mod;
22
+ private modZip;
23
+ private params;
24
+ private _language;
25
+ private _fallbackLanguage;
26
+ constructor(logger: LogWrapper, mod: ModInfo, modZip: ModZipReader, params: I18nScriptListParams, _language: string, // navigator.language
27
+ _fallbackLanguage: string);
28
+ modName: string;
29
+ get language(): string;
30
+ get fallbackLanguage(): string;
31
+ _main_language: string | undefined;
32
+ calcMainLanguage(): void;
33
+ updateModScriptList(): Promise<void>;
34
+ }
35
+ declare class I18nScriptList implements AddonPluginHookPointEx {
36
+ gSC2DataManager: SC2DataManager;
37
+ gModUtils: ModUtils;
38
+ private readonly logger;
39
+ constructor(gSC2DataManager: SC2DataManager, gModUtils: ModUtils);
40
+ info: ModRecord[];
41
+ registerMod(addonName: string, mod: ModInfo, modZip: ModZipReader): Promise<void>;
42
+ beforePatchModToGame(): Promise<void>;
43
+ init(): void;
44
+ }
45
+ //#endregion
46
+ export { I18nScriptList, I18nScriptListParams, LanguageFileItem, ModLanguageState, ModRecord, checkParams };