@scml/addon-modded-feats 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.
@@ -0,0 +1,1514 @@
1
+ /// <reference path="./common/common.d.ts" />
2
+ /// <reference path="./common/array.d.ts" />
3
+ /// <reference path="./common/collection.d.ts" />
4
+ /// <reference path="./common/date.d.ts" />
5
+ /// <reference path="./common/function.d.ts" />
6
+ /// <reference path="./common/lang.d.ts" />
7
+ /// <reference path="./common/math.d.ts" />
8
+ /// <reference path="./common/number.d.ts" />
9
+ /// <reference path="./common/object.d.ts" />
10
+ /// <reference path="./common/seq.d.ts" />
11
+ /// <reference path="./common/string.d.ts" />
12
+ /// <reference path="./common/util.d.ts" />
13
+ import JSZip from "jszip";
14
+ import { UseStore, clear, createStore, del, entries, get, keys, set, setMany, values } from "idb-keyval";
15
+ import moment from "moment/moment";
16
+ import * as idbInstance from "idb";
17
+ import { deleteDB, openDB } from "idb";
18
+
19
+ //#region ../sugarcube-2-ModLoader/type-dist/ModPack/ModMeta.d.ts
20
+ //#region remote/BeforeSC2/ModPack/ModMeta.d.ts
21
+ interface FileMeta {
22
+ b: number;
23
+ e: number;
24
+ l: number;
25
+ }
26
+ interface CryptoInfo {
27
+ Xchacha20NonceBase64: string;
28
+ PwhashSaltBase64: string;
29
+ }
30
+ interface ModMeta {
31
+ magicNumber: string;
32
+ name: string;
33
+ protocolVersion: number;
34
+ blockSize: number;
35
+ cryptoInfo?: CryptoInfo;
36
+ fileTreeBlock: FileMeta;
37
+ bootJsonFile: FileMeta;
38
+ fileMeta: Record<string, FileMeta>;
39
+ } //#endregion
40
+ //#endregion
41
+ //#region ../sugarcube-2-ModLoader/type-dist/JSZipLikeReadOnlyInterface.d.ts
42
+ //#region remote/BeforeSC2/JSZipLikeReadOnlyInterface.d.ts
43
+ interface JSZipObjectLikeReadOnlyInterface {
44
+ async<T extends OutputType>(type: T, onUpdate?: any): Promise<OutputByType[T]>;
45
+ get name(): string;
46
+ get dir(): boolean;
47
+ }
48
+ interface InputByType {
49
+ base64: string;
50
+ string: string;
51
+ text: string;
52
+ binarystring: string;
53
+ array: number[];
54
+ uint8array: Uint8Array;
55
+ arraybuffer: ArrayBuffer;
56
+ blob: Blob;
57
+ }
58
+ interface OutputByType {
59
+ base64: string;
60
+ string: string;
61
+ uint8array: Uint8Array;
62
+ blob: Blob;
63
+ }
64
+ type InputFileFormat = InputByType[keyof InputByType] | Promise<InputByType[keyof InputByType]>;
65
+ type OutputType = keyof OutputByType;
66
+ interface JSZipLikeReadOnlyInterface {
67
+ file(path: string): JSZipObjectLikeReadOnlyInterface | null;
68
+ file(path: RegExp): JSZipObjectLikeReadOnlyInterface[] | null;
69
+ forEach(callback: (relativePath: string, file: JSZipObjectLikeReadOnlyInterface) => void): void;
70
+ filter(predicate: (relativePath: string, file: JSZipObjectLikeReadOnlyInterface) => boolean): JSZipObjectLikeReadOnlyInterface[];
71
+ loadAsync(data: InputFileFormat, options?: any): Promise<JSZipLikeReadOnlyInterface | undefined>;
72
+ is_JeremieModLoader_ModPack?: boolean;
73
+ hashString?: string;
74
+ generateAsync?: typeof JSZip['generateAsync'];
75
+ get files(): Record<string, JSZipObjectLikeReadOnlyInterface>;
76
+ }
77
+ //#endregion
78
+ //#region ../sugarcube-2-ModLoader/type-dist/ModZipReader.d.ts
79
+ interface Twee2PassageR {
80
+ name: string;
81
+ tags: string[];
82
+ content: string;
83
+ }
84
+ declare class ModZipReaderHash {
85
+ _hash: string | undefined;
86
+ _zipBase64String: string | undefined;
87
+ constructor(zipBase64String: string | undefined, hash?: string | undefined);
88
+ protected digestMessage(message: string): Promise<string>;
89
+ protected XxHashH64Bigint2String(h64: bigint): string;
90
+ protected XxHashH32Number2String(h32: bigint): string;
91
+ init(): Promise<void>;
92
+ compare(h: ModZipReaderHash): boolean;
93
+ compareWithString(h: string): boolean;
94
+ toString(): string;
95
+ fromString(hash: string): (typeof this._hash);
96
+ }
97
+ declare class ModZipReader {
98
+ loaderBase: LoaderBase;
99
+ modLoadControllerCallback: ModLoadControllerCallback;
100
+ log: LogWrapper;
101
+ private gcFinalizationRegistry;
102
+ private _zip;
103
+ private _zipIsExist;
104
+ get zip(): JSZipLikeReadOnlyInterface;
105
+ modZipReaderHash: ModZipReaderHash;
106
+ constructor(zip: JSZipLikeReadOnlyInterface, zipBase64String: string, loaderBase: LoaderBase, modLoadControllerCallback: ModLoadControllerCallback);
107
+ get isModPack(): boolean;
108
+ get isJsZip(): boolean;
109
+ modInfo?: ModInfo;
110
+ getModInfo(): ModInfo | undefined;
111
+ getZipFile(): JSZipLikeReadOnlyInterface | undefined;
112
+ /**
113
+ * use this to release zip object ref, try to remove the object from memory.
114
+ */
115
+ gcReleaseZip(): void;
116
+ /**
117
+ * use this to debug check if the zip object is really released.
118
+ * @return [isRefExist(true), isWeakRefExist(false), isWeakRefCleanBeCall(true/(null if not support))]
119
+ * only when the return is [true, false, true] the zip object is really released.
120
+ */
121
+ gcCheckReleased(): [boolean,
122
+ /* boolean,*/
123
+ /* boolean,*/
124
+ boolean | null];
125
+ gcIsReleased(): boolean;
126
+ static validateBootJson(bootJ: any, log?: LogWrapper): bootJ is ModBootJson;
127
+ static modBootFilePath: string;
128
+ init(): Promise<boolean>;
129
+ refillCacheStyleFileItems(styleFileList: string[], keepOld: boolean): Promise<void>;
130
+ refillCachePassageDataItems(tweeFileList: string[], keepOld: boolean): Promise<void>;
131
+ refillCacheScriptFileItems(scriptFileList: string[], keepOld: boolean): Promise<void>;
132
+ constructModInfoCache(bootJ: ModBootJson, keepOld: boolean): Promise<void>;
133
+ }
134
+ declare class LoaderBase {
135
+ log: ModLoadControllerCallback;
136
+ loaderKeyConfig: LoaderKeyConfig;
137
+ modList: ModZipReader[];
138
+ modZipList: Map<string, ModZipReader[]>;
139
+ logger: Record<'log' | 'warn' | 'error', ((s: string) => void)>;
140
+ constructor(log: ModLoadControllerCallback, loaderKeyConfig: LoaderKeyConfig);
141
+ init(): void;
142
+ getZipFile(name: string): ModZipReader[] | undefined;
143
+ addZipFile(name: string, zip: ModZipReader): void;
144
+ load(): Promise<boolean>;
145
+ }
146
+ declare class LocalStorageLoader extends LoaderBase {
147
+ static modDataLocalStorageZipList: string;
148
+ static modDataLocalStorageZipPrefix: string;
149
+ init(): void;
150
+ load(): Promise<boolean>;
151
+ static listMod(): string[] | undefined;
152
+ static calcModNameKey(name: string): string;
153
+ static addMod(name: string, modBase64String: string): void;
154
+ static removeMod(name: string): void;
155
+ static checkModZipFile(modBase64String: string): Promise<string | ModBootJson>;
156
+ setConfigKey(modDataLocalStorageZipListKey?: string, modDataLocalStorageZipPrefix?: string): void;
157
+ }
158
+ declare class IndexDBLoader extends LoaderBase {
159
+ modLoadControllerCallback: ModLoadControllerCallback;
160
+ loaderKeyConfig: LoaderKeyConfig;
161
+ static dbName: string;
162
+ static storeName: string;
163
+ static modDataIndexDBZipListHidden: string;
164
+ static modDataIndexDBZipList: string;
165
+ static modDataIndexDBZipPrefix: string;
166
+ init(): void;
167
+ customStore: UseStore;
168
+ constructor(modLoadControllerCallback: ModLoadControllerCallback, loaderKeyConfig: LoaderKeyConfig);
169
+ load(): Promise<boolean>;
170
+ /**
171
+ * @param modeList must have same items as the list in listMod()
172
+ */
173
+ static reorderModList(modeList: string[]): Promise<void>;
174
+ static setModList(modeList: string[]): Promise<void>;
175
+ static setHiddenModList(modeList: string[]): Promise<void>;
176
+ static loadHiddenModList(): Promise<string[] | undefined>;
177
+ static listMod(): Promise<string[] | undefined>;
178
+ static calcModNameKey(name: string): string;
179
+ static addMod(name: string, modBase64String: string | Uint8Array): Promise<void>;
180
+ static removeMod(name: string): Promise<void>;
181
+ static checkModZipFile(modBase64String: string | Uint8Array): Promise<string | ModBootJson>;
182
+ setConfigKey(dbName?: string, storeName?: string, modDataIndexDBZipList?: string, modDataIndexDBZipListHidden?: string): void;
183
+ }
184
+ declare class LocalLoader extends LoaderBase {
185
+ modLoadControllerCallback: ModLoadControllerCallback;
186
+ loaderKeyConfig: LoaderKeyConfig;
187
+ thisWin: Window;
188
+ modDataValueZipListPath: string;
189
+ init(): void;
190
+ constructor(modLoadControllerCallback: ModLoadControllerCallback, loaderKeyConfig: LoaderKeyConfig, thisWin: Window);
191
+ load(): Promise<boolean>;
192
+ setConfigKey(modDataValueZipListPath?: string): void;
193
+ }
194
+ declare class RemoteLoader extends LoaderBase {
195
+ modDataRemoteListPath: string;
196
+ init(): void;
197
+ load(): Promise<boolean>;
198
+ setConfigKey(modDataRemoteListPath: string): void;
199
+ }
200
+ declare class LazyLoader extends LoaderBase {
201
+ add(modeZip: JSZipLikeReadOnlyInterface): Promise<ModZipReader>;
202
+ load(): Promise<boolean>;
203
+ }
204
+ declare class LoaderKeyConfig {
205
+ log: ModLoadControllerCallback;
206
+ modLoaderKeyConfigWinHookFunctionName: string;
207
+ logger: Record<'log' | 'warn' | 'error', ((s: string) => void)>;
208
+ constructor(log: ModLoadControllerCallback);
209
+ config: Map<string, string>;
210
+ getLoaderKey(k: string, d: string): string;
211
+ protected isInit: boolean;
212
+ protected init(): void;
213
+ /**
214
+ * @example
215
+ * @code
216
+ * ```
217
+ * window.modLoaderKeyConfigWinHookFunction = (loaderKeyConfig: LoaderKeyConfig) => {
218
+ * loaderKeyConfig.config.set('modDataIndexDBZipList', 'modDataIndexDBZipList123456789');
219
+ * };
220
+ * ```
221
+ *
222
+ * @protected
223
+ */
224
+ protected callWinHookFunction(): void;
225
+ /**
226
+ * @example URL: ./Degrees of Lewdity VERSION.html.mod.html?modDataIndexDBZipList=modDataIndexDBZipList123456789
227
+ * @protected
228
+ */
229
+ protected getConfigFromUrlHash(): void;
230
+ } //#endregion
231
+ //#endregion
232
+ //#region ../sugarcube-2-ModLoader/type-dist/ModOrderContainer.d.ts
233
+ //#region remote/BeforeSC2/ModOrderContainer.d.ts
234
+ declare enum ModLoadFromSourceType {
235
+ 'Remote' = "Remote",
236
+ 'Local' = "Local",
237
+ 'LocalStorage' = "LocalStorage",
238
+ 'IndexDB' = "IndexDB",
239
+ 'SideLazy' = "SideLazy"
240
+ }
241
+ interface ModOrderItem {
242
+ name: string;
243
+ from: ModLoadFromSourceType;
244
+ mod: ModInfo;
245
+ zip: ModZipReader;
246
+ }
247
+ declare abstract class CustomReadonlyMapHelper<K, V> implements ReadonlyMap<K, V> {
248
+ abstract get size(): number;
249
+ abstract get(key: K): V | undefined;
250
+ abstract has(key: K): boolean;
251
+ abstract entries(): IterableIterator<[K, V]>;
252
+ [Symbol.iterator](): IterableIterator<[K, V]>;
253
+ forEach(callback: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
254
+ keys(): IterableIterator<K>;
255
+ values(): IterableIterator<V>;
256
+ }
257
+ declare class ModOrderContainer_One_ReadonlyMap extends CustomReadonlyMapHelper<string, ModOrderItem> {
258
+ parent: ModOrderContainer;
259
+ constructor(parent: ModOrderContainer);
260
+ get size(): number;
261
+ entries(): IterableIterator<[string, ModOrderItem]>;
262
+ get(key: string): ModOrderItem | undefined;
263
+ has(key: string): boolean;
264
+ }
265
+ declare class ModOrderContainer_OneAlias_ReadonlyMap extends CustomReadonlyMapHelper<string, ModOrderItem> {
266
+ parent: ModOrderContainer;
267
+ constructor(parent: ModOrderContainer);
268
+ get size(): number;
269
+ entries(): IterableIterator<[string, ModOrderItem]>;
270
+ get(key: string): ModOrderItem | undefined;
271
+ has(key: string): boolean;
272
+ }
273
+ /**
274
+ * a multi-index container designed for mod load cache list. work like a C++ Boost.MultiIndexContainer
275
+ * can keep mod `order` , optional keep mod `unique` , remember mod load `from source`
276
+ */
277
+ declare class ModOrderContainer {
278
+ container: Map<string, Map<ModLoadFromSourceType, ModOrderItem>>;
279
+ order: ModOrderItem[];
280
+ nameRefWithAlias: Map<string, string>;
281
+ constructor();
282
+ /**
283
+ * O(1)
284
+ *
285
+ * add addition limit that keep mod name unique
286
+ */
287
+ get_One_Map(): ModOrderContainer_One_ReadonlyMap;
288
+ get_One_Map_WithAlias(): ModOrderContainer_OneAlias_ReadonlyMap;
289
+ /**
290
+ * O(2n)
291
+ *
292
+ * add addition limit that keep mod name unique
293
+ */
294
+ get_One_Array(): ModOrderItem[];
295
+ /**
296
+ * O(n)
297
+ */
298
+ get_Array(): ModOrderItem[];
299
+ /**
300
+ * O(n)
301
+ */
302
+ getAllName(): string[];
303
+ /**
304
+ * O(1)
305
+ */
306
+ getHasByName(name: string): boolean;
307
+ /**
308
+ * O(1)
309
+ */
310
+ getHasByNameWithAlias(name: string): boolean;
311
+ /**
312
+ * O(1)
313
+ */
314
+ getHasByNameFrom(name: string, from: ModLoadFromSourceType): boolean;
315
+ /**
316
+ * O(1)
317
+ */
318
+ getByName(name: string): Map<ModLoadFromSourceType, ModOrderItem> | undefined;
319
+ /**
320
+ * O(1)
321
+ */
322
+ getModOrderItemByNameWithAlias(name: string): Map<ModLoadFromSourceType, ModOrderItem> | undefined;
323
+ /**
324
+ * O(1)
325
+ */
326
+ getByNameOne(name: string, noError?: boolean): ModOrderItem | undefined;
327
+ /**
328
+ * O(1)
329
+ */
330
+ getByNameOneWithAlias(name: string, noError?: boolean): ModOrderItem | undefined;
331
+ /**
332
+ * O(n)
333
+ */
334
+ getByFromTypeByOrder(from: ModLoadFromSourceType): ModOrderItem[];
335
+ /**
336
+ * O(n)
337
+ */
338
+ getByOrder(name: string): ModOrderItem[];
339
+ /**
340
+ * O(n)
341
+ */
342
+ checkNameUniq(): boolean;
343
+ /**
344
+ * O(n)
345
+ */
346
+ checkAlias(): boolean;
347
+ /**
348
+ * O(n+2log(n))
349
+ */
350
+ checkData(): boolean;
351
+ /**
352
+ * O(n)
353
+ */
354
+ delete(name: string, from: ModLoadFromSourceType): boolean;
355
+ /**
356
+ * O(n)
357
+ */
358
+ deleteAll(name: string): boolean;
359
+ /**
360
+ * O(1)
361
+ */
362
+ createModOrderItem(zip: ModZipReader, from: ModLoadFromSourceType): ModOrderItem | undefined;
363
+ /**
364
+ * O(2n)
365
+ */
366
+ pushFront(zip: ModZipReader, from: ModLoadFromSourceType): boolean;
367
+ /**
368
+ * O(2n)
369
+ */
370
+ pushBack(zip: ModZipReader, from: ModLoadFromSourceType): boolean;
371
+ /**
372
+ * O(2n)
373
+ */
374
+ insertReplace(zip: ModZipReader, from: ModLoadFromSourceType): boolean;
375
+ /**
376
+ * O(n)
377
+ */
378
+ popOut(name: string, from: ModLoadFromSourceType): ModOrderItem | undefined;
379
+ /**
380
+ * O(n)
381
+ */
382
+ popOutAll(name: string): ModOrderItem[] | undefined;
383
+ /**
384
+ * O(1)
385
+ */
386
+ popFront(): ModOrderItem | undefined;
387
+ /**
388
+ * O(1)
389
+ */
390
+ clear(): void;
391
+ /**
392
+ * O(1)
393
+ */
394
+ get size(): number;
395
+ /**
396
+ * O(2n)
397
+ */
398
+ clone(): ModOrderContainer;
399
+ private rebuildNameRefWithAlias;
400
+ private addModNameRefWithAlias;
401
+ private removeModNameRefWithAlias;
402
+ /**
403
+ * O(n)
404
+ */
405
+ private rebuildContainerFromOrder;
406
+ /**
407
+ * O(2n)
408
+ */
409
+ splitCloneInArray(name: string, from: ModLoadFromSourceType): {
410
+ before: ModOrderContainer;
411
+ current: ModOrderItem;
412
+ after: ModOrderContainer;
413
+ } | undefined;
414
+ static mergeModOrderContainer(nnn: (ModOrderContainer | ModOrderItem)[]): ModOrderContainer;
415
+ } //#endregion
416
+ //#endregion
417
+ //#region ../sugarcube-2-ModLoader/type-dist/ReplacePatcher.d.ts
418
+ //#region remote/BeforeSC2/ReplacePatcher.d.ts
419
+ interface PatchInfo {
420
+ js?: PatchInfoItem[];
421
+ css?: PatchInfoItem[];
422
+ twee?: PatchInfoItem[];
423
+ }
424
+ interface PatchInfoItem {
425
+ from: string;
426
+ to: string;
427
+ fileName: string;
428
+ passageName?: string;
429
+ }
430
+ interface PatchInfoMap {
431
+ js: Map<string, PatchInfoItem[]>;
432
+ css: Map<string, PatchInfoItem[]>;
433
+ twee: Map<string, PatchInfoItem[]>;
434
+ }
435
+ declare class ReplacePatcher {
436
+ logger: LogWrapper;
437
+ modName: string;
438
+ patchFileName: string;
439
+ patchInfo_: any;
440
+ patchInfo: PatchInfo;
441
+ patchInfoMap: PatchInfoMap;
442
+ constructor(logger: LogWrapper, modName: string, patchFileName: string, patchInfo_: any);
443
+ applyReplacePatcher(modSC2DataInfoCache: SC2DataInfo): void;
444
+ } //#endregion
445
+ //#endregion
446
+ //#region ../sugarcube-2-ModLoader/type-dist/ModLoader.d.ts
447
+ //#region remote/BeforeSC2/ModLoader.d.ts
448
+ interface IModImgGetter {
449
+ /**
450
+ * @return Promise<string> base64 img string
451
+ */
452
+ getBase64Image(): Promise<string | undefined>;
453
+ imgCache?: string;
454
+ invalid: boolean;
455
+ forceCache(): Promise<any>;
456
+ }
457
+ interface ModImg {
458
+ getter: IModImgGetter;
459
+ path: string;
460
+ }
461
+ interface ModBootJsonAddonPlugin {
462
+ modName: string;
463
+ addonName: string;
464
+ modVersion: string;
465
+ params?: any[] | {
466
+ [key: string]: any;
467
+ };
468
+ }
469
+ interface DependenceInfo {
470
+ modName: string;
471
+ version: string;
472
+ }
473
+ type ModNickName = ({ [key in string]?: string } & {
474
+ cn?: string;
475
+ en?: string;
476
+ }) | string | undefined;
477
+ interface ModBootJson {
478
+ name: string;
479
+ nickName?: ModNickName;
480
+ alias?: string[];
481
+ version: string;
482
+ styleFileList: string[];
483
+ scriptFileList: string[];
484
+ scriptFileList_preload?: string[];
485
+ scriptFileList_earlyload?: string[];
486
+ scriptFileList_inject_early?: string[];
487
+ tweeFileList: string[];
488
+ imgFileList: string[];
489
+ replacePatchList?: string[];
490
+ additionFile: string[];
491
+ additionBinaryFile?: string[];
492
+ addonPlugin?: ModBootJsonAddonPlugin[];
493
+ dependenceInfo?: DependenceInfo[];
494
+ }
495
+ interface ModInfo {
496
+ name: string;
497
+ nickName?: ModNickName;
498
+ alias: string[];
499
+ version: string;
500
+ cache: SC2DataInfo;
501
+ imgs: ModImg[];
502
+ /**
503
+ * origin path, replace path
504
+ *
505
+ * @deprecated the imgFileReplaceList not work and never implemented, don't use it.
506
+ * Please use `ImageLoaderAddon` or `BeautySelectorAddon` instead.
507
+ * @see `ImageLoaderAddon` https://github.com/Lyoko-Jeremie/DoL_ImgLoaderHooker
508
+ * @see `BeautySelectorAddon` https://github.com/Lyoko-Jeremie/DoL_BeautySelectorAddonMod
509
+ */
510
+ imgFileReplaceList: [string, string][];
511
+ /**
512
+ * file name, file content
513
+ */
514
+ scriptFileList_preload: [string, string][];
515
+ /**
516
+ * file name, file content
517
+ */
518
+ scriptFileList_earlyload: [string, string][];
519
+ /**
520
+ * file name, file content
521
+ */
522
+ scriptFileList_inject_early: [string, string][];
523
+ replacePatcher: ReplacePatcher[];
524
+ bootJson: ModBootJson;
525
+ modRef: {
526
+ [key: string]: any;
527
+ } | undefined;
528
+ }
529
+ declare enum ModDataLoadType {
530
+ 'Remote' = "Remote",
531
+ 'Local' = "Local",
532
+ 'LocalStorage' = "LocalStorage",
533
+ 'IndexDB' = "IndexDB"
534
+ }
535
+ declare class ModLoader {
536
+ gSC2DataManager: SC2DataManager;
537
+ modLoadControllerCallback: ModLoadControllerCallback;
538
+ thisWin: Window;
539
+ logger: LogWrapper;
540
+ constructor(gSC2DataManager: SC2DataManager, modLoadControllerCallback: ModLoadControllerCallback, thisWin: Window);
541
+ /**
542
+ * 已读取的mod列表(加载但没有初始化)
543
+ * The mod list that already read (load but not init)
544
+ */
545
+ private modReadCache;
546
+ /**
547
+ * 已加载的mod列表(加载并完成初始化)
548
+ * The mod list that already loaded (load and init)
549
+ */
550
+ private modCache;
551
+ /**
552
+ * 已加载的Lazy mod列表(使用 `lazyRegisterNewMod` 加载但未完成初始化)
553
+ * The Lazy mod list that already loaded (load use `lazyRegisterNewMod` but not init)
554
+ */
555
+ private modLazyCache;
556
+ modLoadRecord: ModOrderItem[];
557
+ /**
558
+ * O(2n)
559
+ */
560
+ getModCacheOneArray(): ModOrderItem[];
561
+ /**
562
+ O(n)
563
+ */
564
+ getModCacheArray(): ModOrderItem[];
565
+ getModAllName(): string[];
566
+ /**
567
+ O(1)
568
+ */
569
+ getModCacheMap(): ModOrderContainer_One_ReadonlyMap;
570
+ getModCacheMapWithAlias(): ModOrderContainer_OneAlias_ReadonlyMap;
571
+ /**
572
+ * O(n+2log(n))
573
+ */
574
+ checkModCacheData(): boolean;
575
+ /**
576
+ O(n)
577
+ */
578
+ checkModCacheUniq(): boolean;
579
+ /**
580
+ O(1)
581
+ */
582
+ getModCacheByNameOne(modName: string): ModOrderItem | undefined;
583
+ getModCacheByAliseOne(modName: string): ModOrderItem | undefined;
584
+ getModCacheByFromType(from: ModLoadFromSourceType): ModOrderItem[];
585
+ getModReadCache(): ModOrderContainer;
586
+ checkModConflictList(): {
587
+ mod: SC2DataInfo;
588
+ result: SimulateMergeResult;
589
+ }[];
590
+ private modLoaderKeyConfig?;
591
+ private modIndexDBLoader?;
592
+ private modLocalStorageLoader?;
593
+ private modLocalLoader?;
594
+ private modRemoteLoader?;
595
+ private modLazyLoader?;
596
+ getLoaderKeyConfig(): LoaderKeyConfig;
597
+ getIndexDBLoader(): IndexDBLoader;
598
+ getLocalStorageLoader(): LocalStorageLoader;
599
+ getLocalLoader(): LocalLoader;
600
+ getRemoteLoader(): RemoteLoader;
601
+ getLazyLoader(): LazyLoader;
602
+ loadOrder: ModDataLoadType[];
603
+ private addModReadZip;
604
+ loadMod(loadOrder: ModDataLoadType[]): Promise<boolean>;
605
+ private registerMod2Addon;
606
+ protected triggerAfterModLoad(): Promise<void>;
607
+ protected filterModCanLoad(modeC: ModOrderContainer): Promise<ModOrderContainer>;
608
+ lazyRegisterNewMod(modeZip: JSZipLikeReadOnlyInterface): Promise<boolean>;
609
+ private do_initModInjectEarlyLoadInDomScript;
610
+ private initModInjectEarlyLoadInDomScript;
611
+ private do_initModEarlyLoadScript;
612
+ private initModEarlyLoadScript;
613
+ getModEarlyLoadCache(): ModOrderContainer;
614
+ getModByNameOne(modName: string): ModOrderItem | undefined;
615
+ getModZip(modName: string): ModZipReader | undefined;
616
+ private loadEndModList?;
617
+ private toLoadModList?;
618
+ private nowLoadedMod?;
619
+ private newNowMod?;
620
+ private replacedNowMod?;
621
+ private tryInitWaitingLazyLoadMod;
622
+ } //#endregion
623
+ //#endregion
624
+ //#region ../sugarcube-2-ModLoader/type-dist/ModLoadController.d.ts
625
+ //#region remote/BeforeSC2/ModLoadController.d.ts
626
+ interface LogWrapper {
627
+ log: (s: string) => void;
628
+ warn: (s: string) => void;
629
+ error: (s: string) => void;
630
+ }
631
+ interface LifeTimeCircleHook extends Partial<ModLoadControllerCallback> {}
632
+ interface ModLoadControllerCallback {
633
+ /**
634
+ * ban a mod use this, need register this hook in `InjectEarlyLoad`
635
+ * @param bootJson
636
+ * @param zip
637
+ */
638
+ canLoadThisMod(bootJson: ModBootJson, zip: JSZipLikeReadOnlyInterface): Promise<boolean>;
639
+ /**
640
+ * use this to modify a mod, like i18n a mod
641
+ * @param bootJson
642
+ * @param zip carefully modify zip file
643
+ * @param modInfo you can modify the all info in there. read: [ModZipReader.init()]
644
+ */
645
+ afterModLoad(bootJson: ModBootJson, zip: JSZipLikeReadOnlyInterface, modInfo: ModInfo): Promise<any>;
646
+ InjectEarlyLoad_start(modName: string, fileName: string): Promise<any>;
647
+ InjectEarlyLoad_end(modName: string, fileName: string): Promise<any>;
648
+ EarlyLoad_start(modName: string, fileName: string): Promise<any>;
649
+ EarlyLoad_end(modName: string, fileName: string): Promise<any>;
650
+ LazyLoad_start(modName: string): Promise<any>;
651
+ LazyLoad_end(modName: string): Promise<any>;
652
+ Load_start(modName: string, fileName: string): Promise<any>;
653
+ Load_end(modName: string, fileName: string): Promise<any>;
654
+ PatchModToGame_start(): Promise<any>;
655
+ PatchModToGame_end(): Promise<any>;
656
+ /**
657
+ * @deprecated
658
+ */
659
+ ReplacePatcher_start(modName: string, fileName: string): Promise<any>;
660
+ /**
661
+ * @deprecated
662
+ */
663
+ ReplacePatcher_end(modName: string, fileName: string): Promise<any>;
664
+ /**
665
+ * Latest Hook On ModLoader When ALL Load End
666
+ */
667
+ ModLoaderLoadEnd(): Promise<any>;
668
+ /**
669
+ * @useless useless for user
670
+ */
671
+ logError(s: string): void;
672
+ /**
673
+ * @useless useless for user
674
+ */
675
+ logInfo(s: string): void;
676
+ /**
677
+ * @useless useless for user
678
+ */
679
+ logWarning(s: string): void;
680
+ exportDataZip(zip: JSZip): Promise<JSZip>;
681
+ }
682
+ interface LogRecord {
683
+ type: 'info' | 'warning' | 'error';
684
+ time: moment.Moment;
685
+ message: string;
686
+ }
687
+ /**
688
+ * ModLoader lifetime circle system,
689
+ * mod can register hook to this system, to listen to the lifetime circle of MpdLoader and error log.
690
+ *
691
+ * ModLoader 生命周期系统,
692
+ * mod 可以注册 hook 到这个系统,来监听 ModLoader 的生命周期和错误日志。
693
+ */
694
+ declare class ModLoadController implements ModLoadControllerCallback {
695
+ gSC2DataManager: SC2DataManager;
696
+ constructor(gSC2DataManager: SC2DataManager);
697
+ logRecordBeforeAnyLogHookRegister: LogRecord[];
698
+ LazyLoad_end: (modName: string) => Promise<any>;
699
+ LazyLoad_start: (modName: string) => Promise<any>;
700
+ EarlyLoad_end: (modName: string, fileName: string) => Promise<any>;
701
+ EarlyLoad_start: (modName: string, fileName: string) => Promise<any>;
702
+ InjectEarlyLoad_end: (modName: string, fileName: string) => Promise<any>;
703
+ InjectEarlyLoad_start: (modName: string, fileName: string) => Promise<any>;
704
+ Load_end: (modName: string, fileName: string) => Promise<any>;
705
+ Load_start: (modName: string, fileName: string) => Promise<any>;
706
+ PatchModToGame_end: () => Promise<any>;
707
+ PatchModToGame_start: () => Promise<any>;
708
+ ReplacePatcher_end: (modName: string, fileName: string) => Promise<any>;
709
+ ReplacePatcher_start: (modName: string, fileName: string) => Promise<any>;
710
+ logError: (s: string) => void;
711
+ logInfo: (s: string) => void;
712
+ logWarning: (s: string) => void;
713
+ ModLoaderLoadEnd: () => Promise<any>;
714
+ canLoadThisMod(bootJson: ModBootJson, zip: JSZipLikeReadOnlyInterface): Promise<boolean>;
715
+ afterModLoad(bootJson: ModBootJson, zip: JSZipLikeReadOnlyInterface, modInfo: ModInfo): Promise<any>;
716
+ /**
717
+ * call by ModLoaderGui (inner use)
718
+ * @param zip
719
+ */
720
+ exportDataZip(zip: JSZip): Promise<JSZip>;
721
+ private lifeTimeCircleHookTable;
722
+ addLifeTimeCircleHook(id: string, hook: LifeTimeCircleHook): void;
723
+ removeLifeTimeCircleHook(hook: LifeTimeCircleHook): void;
724
+ clearLifeTimeCircleHook(): void;
725
+ listModLocalStorage(): string[];
726
+ addModLocalStorage(name: string, modBase64String: string): void;
727
+ removeModLocalStorage(name: string): void;
728
+ checkModZipFileLocalStorage(modBase64String: string): Promise<string | ModBootJson>;
729
+ overwriteModIndexDBModList(modeList: string[]): Promise<void>;
730
+ overwriteModIndexDBHiddenModList(modeList: string[]): Promise<void>;
731
+ listModIndexDB(): Promise<string[]>;
732
+ loadHiddenModList(): Promise<string[]>;
733
+ addModIndexDB(name: string, modBase64String: string | Uint8Array): Promise<void>;
734
+ removeModIndexDB(name: string): Promise<void>;
735
+ checkModZipFileIndexDB(modBase64String: string | Uint8Array): Promise<string | ModBootJson>;
736
+ getLog(): LogWrapper;
737
+ } //#endregion
738
+ //#endregion
739
+ //#region ../sugarcube-2-ModLoader/type-dist/SC2DataInfoCache.d.ts
740
+ //#region remote/BeforeSC2/SC2DataInfoCache.d.ts
741
+ interface StyleTextFileItem {
742
+ id: number;
743
+ name: string;
744
+ content: string;
745
+ }
746
+ interface ScriptTextFileItem {
747
+ id: number;
748
+ name: string;
749
+ content: string;
750
+ }
751
+ interface PassageDataItem {
752
+ id: number;
753
+ name: string;
754
+ tags: string[];
755
+ content: string;
756
+ position?: string;
757
+ size?: string;
758
+ }
759
+ declare class CacheRecord<T extends {
760
+ name: string;
761
+ content: string;
762
+ }> {
763
+ log: LogWrapper;
764
+ dataSource: string;
765
+ cacheRecordName: string;
766
+ needBuildNoPathCache: boolean;
767
+ constructor(log: LogWrapper, dataSource: string, cacheRecordName: string, needBuildNoPathCache?: boolean);
768
+ getNoPathNameFromString(s: string): string;
769
+ noPathCache?: Map<string, string[]>;
770
+ buildNoPathCache(): void;
771
+ destroy(): void;
772
+ clean(): void;
773
+ items: T[];
774
+ fillMap(): void;
775
+ back2Array(): void;
776
+ map: Map<string, T>;
777
+ noName: T[];
778
+ replaceMerge(c: CacheRecord<T>, noWarnning?: boolean): void;
779
+ concatMerge(c: CacheRecord<T>): void;
780
+ getByNameWithNoPath(s: string): T | undefined;
781
+ getByNameWithOrWithoutPath(s: string): T | undefined;
782
+ }
783
+ declare class SC2DataInfo {
784
+ log: LogWrapper;
785
+ dataSource: string;
786
+ styleFileItems: CacheRecord<StyleTextFileItem>;
787
+ scriptFileItems: CacheRecord<ScriptTextFileItem>;
788
+ passageDataItems: CacheRecord<PassageDataItem>;
789
+ constructor(log: LogWrapper, dataSource: string);
790
+ clean(): void;
791
+ destroy(): void;
792
+ }
793
+ declare class SC2DataInfoCache extends SC2DataInfo {
794
+ log: LogWrapper;
795
+ dataSource: string;
796
+ scriptNode: HTMLScriptElement[];
797
+ styleNode: HTMLStyleElement[];
798
+ passageDataNodes: HTMLElement[];
799
+ cloneSC2DataInfo(): SC2DataInfo;
800
+ destroy(): void;
801
+ constructor(log: LogWrapper, dataSource: string, scriptNode: HTMLScriptElement[], styleNode: HTMLStyleElement[], passageDataNodes: HTMLElement[]);
802
+ } //#endregion
803
+ //#endregion
804
+ //#region ../sugarcube-2-ModLoader/type-dist/SimulateMerge.d.ts
805
+ //#region remote/BeforeSC2/SimulateMerge.d.ts
806
+ interface SimulateMergeResultItem {
807
+ ok: Set<string>;
808
+ conflict: Set<string>;
809
+ }
810
+ interface SimulateMergeResult {
811
+ styleFileItems: SimulateMergeResultItem;
812
+ scriptFileItems: SimulateMergeResultItem;
813
+ passageDataItems: SimulateMergeResultItem;
814
+ dataSource: string;
815
+ }
816
+ //#endregion
817
+ //#region ../sugarcube-2-ModLoader/type-dist/LanguageManager.d.ts
818
+ //#region remote/BeforeSC2/LanguageManager.d.ts
819
+ declare const MainLanguageTypeEnum: readonly ["en", "zh"];
820
+ declare class LanguageManager {
821
+ thisWin: Window;
822
+ gSC2DataManager: SC2DataManager;
823
+ private logger;
824
+ constructor(thisWin: Window, gSC2DataManager: SC2DataManager);
825
+ /**
826
+ * https://developer.mozilla.org/zh-CN/docs/Web/API/Navigator/language
827
+ * https://www.rfc-editor.org/rfc/bcp/bcp47.txt
828
+ * https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
829
+ *
830
+ * @return https://stackoverflow.com/questions/5580876/navigator-language-list-of-all-languages
831
+ */
832
+ getLanguage(): string;
833
+ mainLanguage: typeof MainLanguageTypeEnum[number];
834
+ } //#endregion
835
+ //#endregion
836
+ //#region ../sugarcube-2-ModLoader/type-dist/SemVer/InfiniteSemVer.d.ts
837
+ //#region remote/BeforeSC2/SemVer/InfiniteSemVer.d.ts
838
+ declare const BoundaryOperatorList: readonly [">=", "<=", ">", "<", "=", "^", undefined];
839
+ type BoundaryOperator = typeof BoundaryOperatorList[number];
840
+ type VersionBoundary = {
841
+ version: InfiniteSemVer;
842
+ operator: BoundaryOperator;
843
+ };
844
+ type VersionRange = VersionBoundarySet[];
845
+ type VersionBoundarySet = {
846
+ lower?: VersionBoundary;
847
+ upper?: VersionBoundary;
848
+ };
849
+ type InfiniteSemVer = {
850
+ version: number[];
851
+ preRelease?: string | undefined;
852
+ buildMetadata?: string | undefined;
853
+ };
854
+ declare function parseInfiniteSemVer(versionStr: string): VersionBoundary;
855
+ declare function parseVersionRange(rangeStr: string): VersionRange;
856
+ declare function isWithinRange(version: InfiniteSemVer, range: VersionRange, ignorePostfix?: boolean): boolean;
857
+ declare class SemVerToolsType {
858
+ parseRange: typeof parseVersionRange;
859
+ parseVersion: typeof parseInfiniteSemVer;
860
+ satisfies: typeof isWithinRange;
861
+ } //#endregion
862
+ //#endregion
863
+ //#region ../sugarcube-2-ModLoader/type-dist/IdbKeyValRef.d.ts
864
+ //#region remote/BeforeSC2/IdbKeyValRef.d.ts
865
+ declare class IdbRef {
866
+ get idb_openDB(): typeof openDB;
867
+ get idb_deleteDB(): typeof deleteDB;
868
+ get idbInstance(): typeof idbInstance;
869
+ }
870
+ declare class IdbKeyValRef {
871
+ get keyval_get(): typeof get;
872
+ get keyval_set(): typeof set;
873
+ get keyval_del(): typeof del;
874
+ get get(): typeof get;
875
+ get set(): typeof set;
876
+ get del(): typeof del;
877
+ get createStore(): typeof createStore;
878
+ get setMany(): typeof setMany;
879
+ get clear(): typeof clear;
880
+ get keys(): typeof keys;
881
+ get values(): typeof values;
882
+ get entries(): typeof entries;
883
+ } //#endregion
884
+ //#endregion
885
+ //#region ../sugarcube-2-ModLoader/type-dist/SugarCube2.d.ts
886
+ //#region remote/BeforeSC2/SugarCube2.d.ts
887
+ declare class Passage {
888
+ get className(): string;
889
+ get text(): string | any;
890
+ get title(): string | any;
891
+ description(): string | null;
892
+ processText(): string | null;
893
+ render(options): DocumentFragment;
894
+ static getExcerptFromNode(node, count): string;
895
+ static getExcerptFromText(node, count): string;
896
+ }
897
+ declare global {
898
+ interface SugarCube {
899
+ Passage: typeof Passage;
900
+ }
901
+ } //#endregion
902
+ //#endregion
903
+ //#region ../sugarcube-2-ModLoader/type-dist/WeakRefPool/WeakRefPool.d.ts
904
+ declare class WeakPoolRef<T> {
905
+ constructor();
906
+ get deref(): T | undefined;
907
+ }
908
+ //#endregion
909
+ //#region ../sugarcube-2-ModLoader/type-dist/Sc2EventTracer.d.ts
910
+ //#region remote/BeforeSC2/Sc2EventTracer.d.ts
911
+ interface Sc2EventTracerCallback {
912
+ whenSC2StoryReady?: () => any;
913
+ whenSC2PassageInit?: (passage: Passage) => any;
914
+ whenSC2PassageStart?: (passage: Passage, content: HTMLDivElement) => any;
915
+ whenSC2PassageRender?: (passage: Passage, content: HTMLDivElement) => any;
916
+ whenSC2PassageDisplay?: (passage: Passage, content: HTMLDivElement) => any;
917
+ whenSC2PassageEnd?: (passage: Passage, content: HTMLDivElement) => any;
918
+ }
919
+ declare class Sc2EventTracer {
920
+ thisWin: Window;
921
+ gSC2DataManager: SC2DataManager;
922
+ constructor(thisWin: Window, gSC2DataManager: SC2DataManager);
923
+ callback: Sc2EventTracerCallback[];
924
+ callbackLog: [string, WeakPoolRef<Sc2EventTracerCallback>, ...WeakPoolRef<any>[]][];
925
+ init(): void;
926
+ addCallback(cb: Sc2EventTracerCallback): void;
927
+ } //#endregion
928
+ //#endregion
929
+ //#region ../sugarcube-2-ModLoader/type-dist/AddonPlugin.d.ts
930
+ //#region remote/BeforeSC2/AddonPlugin.d.ts
931
+ type AddonPluginHookType = () => Promise<any>;
932
+ interface AddonPluginHookPoint {
933
+ afterInit?: AddonPluginHookType;
934
+ afterInjectEarlyLoad?: AddonPluginHookType;
935
+ afterModLoad?: AddonPluginHookType;
936
+ afterEarlyLoad?: AddonPluginHookType;
937
+ afterRegisterMod2Addon?: AddonPluginHookType;
938
+ beforePatchModToGame?: AddonPluginHookType;
939
+ afterPatchModToGame?: AddonPluginHookType;
940
+ afterPreload?: AddonPluginHookType;
941
+ }
942
+ type AddonPluginHookPoint_K = keyof AddonPluginHookPoint;
943
+ type AddonPluginHookPointWhenSC2 = {
944
+ whenSC2StoryReady?: () => Promise<any>;
945
+ whenSC2PassageInit?: (passage: Passage) => Promise<any>;
946
+ whenSC2PassageStart?: (passage: Passage, content: HTMLDivElement) => Promise<any>;
947
+ whenSC2PassageRender?: (passage: Passage, content: HTMLDivElement) => Promise<any>;
948
+ whenSC2PassageDisplay?: (passage: Passage, content: HTMLDivElement) => Promise<any>;
949
+ whenSC2PassageEnd?: (passage: Passage, content: HTMLDivElement) => Promise<any>;
950
+ };
951
+ type AddonPluginHookPointWhenSC2_T = AddonPluginHookPointWhenSC2;
952
+ type AddonPluginHookPointWhenSC2_K = keyof AddonPluginHookPointWhenSC2_T;
953
+ type AddonPluginHookPointExOptional = {
954
+ /**
955
+ * registerMod() will be called when export debug data, this is a chance to export addon data for debug, like when addon change data in memory
956
+ *
957
+ * registerMod() 会在导出 debug data 时被调用,这是导出 addon 数据的机会,比如当 addon 在内存中改变了数据。
958
+ * 举个例子,衣服扩展框架可以收集所有衣服mod的数据,统一在文件或内存中修改衣服数据,如果是在文件中修改那么会被默认导出,但如果是在内存中修改,则最好使用这个 hook 来导出数据以便 debug
959
+ *
960
+ * @optional
961
+ * @param zip the zip file to storage debug data
962
+ * @return return the same zip file or a new zip file, recommend return the same zip file
963
+ */
964
+ exportDataZip?: (zip: JSZip) => Promise<JSZip>;
965
+ };
966
+ type AddonPluginHookPointExMustImplement = {
967
+ /**
968
+ * registerMod() will be called when mod loaded and that mod require this addon, addon can read info from mod and do something
969
+ *
970
+ * registerMod() 会在 mod 加载完毕并且 mod 需要这个 addon 时被调用,addon 可以从 mod 读取信息并做一些事情。
971
+ * 举个例子,衣服扩展框架可以在这里读取衣服mod的数据,然后统一修改衣服数据,这样就可以避免多个不同的衣服mod前后修改衣服数组导致意外损坏衣服数组的数据。
972
+ * @mustImplement
973
+ * @param addonName the mod require this addon
974
+ * @param mod the mod info
975
+ * @param modZip the mod zip file reader
976
+ */
977
+ registerMod: (addonName: string, mod: ModInfo, modZip: ModZipReader) => Promise<any>;
978
+ };
979
+ /**
980
+ * AddonPluginHookPointEx is a interface for addon plugin to implement API Hook,
981
+ * addon plugin can implement any hook, but must implement registerMod(),
982
+ * addon can impl more API in there, to let mod call it to get more function.
983
+ *
984
+ * AddonPluginHookPointEx 是 addon plugin 用来实现 API Hook 的接口,
985
+ * addon plugin 可以实现任何 hook,但是必须实现 registerMod(),
986
+ * addon 可以在里面实现更多 API,让 mod 调用它来获得更多功能。
987
+ */
988
+ interface AddonPluginHookPointEx extends AddonPluginHookPoint, AddonPluginHookPointExOptional, AddonPluginHookPointExMustImplement, AddonPluginHookPointWhenSC2 {}
989
+ declare class AddonPluginManager implements Sc2EventTracerCallback {
990
+ gSC2DataManager: SC2DataManager;
991
+ gModLoadController: ModLoadController;
992
+ private addonPluginTable;
993
+ private log;
994
+ private passageTracer;
995
+ private sc2EventTracer;
996
+ constructor(gSC2DataManager: SC2DataManager, gModLoadController: ModLoadController);
997
+ /**
998
+ * inner use
999
+ */
1000
+ whenSC2StoryReady(): Promise<any>;
1001
+ /**
1002
+ * inner use
1003
+ */
1004
+ whenSC2PassageInit(passage: Passage): Promise<any>;
1005
+ /**
1006
+ * inner use
1007
+ */
1008
+ whenSC2PassageStart(passage: Passage, content: HTMLDivElement): Promise<any>;
1009
+ /**
1010
+ * inner use
1011
+ */
1012
+ whenSC2PassageRender(passage: Passage, content: HTMLDivElement): Promise<any>;
1013
+ /**
1014
+ * inner use
1015
+ */
1016
+ whenSC2PassageDisplay(passage: Passage, content: HTMLDivElement): Promise<any>;
1017
+ /**
1018
+ * inner use
1019
+ */
1020
+ whenSC2PassageEnd(passage: Passage, content: HTMLDivElement): Promise<any>;
1021
+ /**
1022
+ * call by ModLoader (inner use)
1023
+ *
1024
+ * register a mod to addon plugin, after all mod loaded and after EarlyLoad executed.
1025
+ *
1026
+ * @param mod
1027
+ * @param modZip
1028
+ */
1029
+ registerMod2Addon(mod: ModInfo, modZip: ModZipReader): Promise<void>;
1030
+ /**
1031
+ * call by ModLoaderGui (inner use)
1032
+ * @param zip
1033
+ */
1034
+ exportDataZip(zip: JSZip): Promise<JSZip>;
1035
+ /**
1036
+ * call by ModLoader (inner use)
1037
+ * @param hook
1038
+ */
1039
+ triggerHook(hook: AddonPluginHookPoint_K): Promise<void>;
1040
+ /**
1041
+ * call by ModLoader (inner use)
1042
+ */
1043
+ triggerHookWhenSC2<K extends AddonPluginHookPointWhenSC2_K>(hook: K, ...params: Parameters<NonNullable<AddonPluginHookPointWhenSC2_T[K]>>): Promise<void>;
1044
+ /**
1045
+ * check if a addon plugin is duplicate
1046
+ * @param modName
1047
+ * @param addonName
1048
+ */
1049
+ checkDuplicate(modName: string, addonName: string): boolean;
1050
+ /**
1051
+ * register a addon plugin, call by addon plugin,
1052
+ * this call must be done when InjectEarlyLoad.
1053
+ *
1054
+ * 注册一个 addon plugin,由 addon plugin 调用,必须在 InjectEarlyLoad 时调用此函数注册 Addon。
1055
+ * @param modName addon plugin's mod name
1056
+ * @param addonName addon plugin's name
1057
+ * @param hookPoint addon plugin's hook point
1058
+ */
1059
+ registerAddonPlugin(modName: string, addonName: string, hookPoint: AddonPluginHookPointEx): void;
1060
+ /**
1061
+ * get a addon plugin, call by mod
1062
+ *
1063
+ * 获取一个 addon plugin,由 mod 调用。 mod 可以读取 addon plugin 的 hookPoint 来调用 addon plugin 的 API
1064
+ * @param modName addon plugin's mod name
1065
+ * @param addonName addon plugin's name
1066
+ */
1067
+ getAddonPlugin(modName: string, addonName: string): AddonPluginHookPointEx | undefined;
1068
+ } //#endregion
1069
+ //#endregion
1070
+ //#region ../../node_modules/.pnpm/@types+lodash@4.17.23/node_modules/@types/lodash/index.d.ts
1071
+ declare const _: _.LoDashStatic;
1072
+ declare namespace _ {
1073
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface -- (This will be augmented)
1074
+ interface LoDashStatic {}
1075
+ }
1076
+ //#endregion
1077
+ //#region ../sugarcube-2-ModLoader/type-dist/Utils.d.ts
1078
+ //#region remote/BeforeSC2/Utils.d.ts
1079
+ declare class ModUtils {
1080
+ pSC2DataManager: SC2DataManager;
1081
+ thisWin: Window;
1082
+ get version(): string;
1083
+ constructor(pSC2DataManager: SC2DataManager, thisWin: Window);
1084
+ getThisWindow(): Window;
1085
+ /**
1086
+ * 获取所有mod的名字
1087
+ * 以mod加载顺序为序
1088
+ */
1089
+ getModListName(): string[];
1090
+ getModListNameNoAlias(): string[];
1091
+ getAnyModByNameNoAlias(name: string): ModInfo | undefined;
1092
+ /**
1093
+ * 获取指定mod的信息
1094
+ * @param name ModName
1095
+ * @return ModInfo | undefined
1096
+ */
1097
+ getMod(name: string): ModInfo | undefined;
1098
+ getModAndFromInfo(name: string): undefined | {
1099
+ name: string;
1100
+ mod: ModInfo;
1101
+ from: ModLoadFromSourceType;
1102
+ };
1103
+ getAllModInfoByFromType(from: ModLoadFromSourceType): {
1104
+ name: string;
1105
+ mod: ModInfo;
1106
+ from: ModLoadFromSourceType;
1107
+ }[];
1108
+ /**
1109
+ * 获取指定mod的Zip
1110
+ * @param modName ModName
1111
+ * @return ModZipReader | undefined
1112
+ */
1113
+ getModZip(modName: string): ModZipReader | undefined;
1114
+ /**
1115
+ * 获取指定Passage的信息
1116
+ * @param name PassageName
1117
+ * @return PassageDataItem | undefined
1118
+ */
1119
+ getPassageData(name: string): PassageDataItem | undefined;
1120
+ /**
1121
+ * 获取所有Passage的信息
1122
+ * @return PassageDataItem[]
1123
+ */
1124
+ getAllPassageData(): PassageDataItem[];
1125
+ /**
1126
+ * 获取当前最新的SC2DataInfo,其中存储了所有SC2引擎的数据,包括js/css/passage
1127
+ * @return SC2DataInfo
1128
+ */
1129
+ createNewSC2DataInfoFromNow(): SC2DataInfoCache;
1130
+ /**
1131
+ * 批量更新passage数据,如果存在则覆盖,如果不存在则创建
1132
+ * @param pd 需要更新的passage列表
1133
+ * @param replaceForce 强制覆盖而不提示警告
1134
+ */
1135
+ updatePassageDataMany(pd: PassageDataItem[], replaceForce?: boolean): void;
1136
+ replaceFollowSC2DataInfo(newSC2Data: SC2DataInfo, oldSC2DataCache: SC2DataInfoCache): void;
1137
+ /**
1138
+ * 更新passage数据,如果存在则覆盖,如果不存在则创建
1139
+ * @param name passageName
1140
+ * @param content passageContent
1141
+ * @param tags passageTags [] OR ['widget']
1142
+ * @param pid passagePid 默认是 0 , 如果不是故意覆盖已有的passage那么就填 0 即可
1143
+ * @deprecated use `CodeExample/how-to-modify-sc2data.ts` instead
1144
+ */
1145
+ updatePassageData(name: string, content: string, tags?: string[], pid?: undefined | number): void;
1146
+ /**
1147
+ * 从一个twee文件中分离出多个passage,工具函数
1148
+ * @param fileString 文件内容字符串
1149
+ */
1150
+ splitPassageFromTweeFile(fileString: string): Twee2PassageR[];
1151
+ /**
1152
+ * 获取mod冲突及覆盖的计算结果,可获知mod之间是否有互相覆盖的情况,如果没有mod则返回空数组
1153
+ *
1154
+ * 注意,此处只能获取模拟计算mod添加的文件互相的冲突关系,且不包含mod的js动态修改的内容,实际结果可能与这里不一致,
1155
+ *
1156
+ * @return { mod: SC2DataInfo, result: SimulateMergeResult }[]
1157
+ * mod mod添加的内容,其中 dataSource 是 modName
1158
+ * result 覆盖结果,其中的 ResultItem[conflict] (Set<string>) 就是互相覆盖的部分的名字(passageName或js/css文件名)
1159
+ */
1160
+ getModConflictInfo(): {
1161
+ mod: SC2DataInfo;
1162
+ result: SimulateMergeResult;
1163
+ }[];
1164
+ /**
1165
+ * 将字符串对正则表达式转义,用于直接将字符串用在正则表达式匹配前的消毒处理
1166
+ * @param pattern 需要转义的字符串
1167
+ * @return string 转义后的字符串
1168
+ */
1169
+ escapedPatternString(pattern: string): string;
1170
+ /**
1171
+ * 尝试在指定位置附近替换字符串
1172
+ * @param content 原始字符串
1173
+ * @param searchString 需要查找的字符串
1174
+ * @param replaceString 需要替换的字符串
1175
+ * @param positionHint 查找的位置
1176
+ * @param tolerance1 第一阶快速查找容差 见 @ref tryStringSearch
1177
+ * @param tolerance2Negative 第二阶正则查找(负方向)容差 见 @ref tryStringSearch
1178
+ * @param tolerance2Positive 第二阶正则查找(正方向)容差 见 @ref tryStringSearch
1179
+ * @return string 替换后的字符串
1180
+ */
1181
+ tryStringReplace(content: string, searchString: string, replaceString: string, positionHint: number, tolerance1?: number, tolerance2Negative?: number, tolerance2Positive?: number): string;
1182
+ /**
1183
+ * 尝试在指定位置附近查找字符串
1184
+ * @param content 原始字符串
1185
+ * @param searchString 需要查找的字符串
1186
+ * @param positionHint 查找的位置
1187
+ * @param tolerance1 第一阶快速查找容差,(常数字符串比对),如果为0则不使用。此方法可在正负tolerance1个位置范围下查找
1188
+ * @param tolerance2Negative 第二阶正则查找(负方向)容差,(正则字符串比对)。
1189
+ * @param tolerance2Positive 第二阶正则查找(正方向)容差,(正则字符串比对)。如果正负都为0则不使用。此方法可在正负tolerance2Negative个位置范围下查找。
1190
+ * @return number 查找到的位置,如果没有找到则返回undefined
1191
+ */
1192
+ tryStringSearch(content: string, searchString: string, positionHint: number, tolerance1?: number, tolerance2Negative?: number, tolerance2Positive?: number): number | undefined;
1193
+ /**
1194
+ * 在指定位置插入字符串
1195
+ * @param content 原始字符串
1196
+ * @param insertString 需要插入的字符串
1197
+ * @param position 插入的位置
1198
+ * @return string 插入后的字符串
1199
+ */
1200
+ insertStringInPosition(content: string, insertString: string, position: number): string;
1201
+ getLodash(): _.LoDashStatic;
1202
+ getModLoadController(): ModLoadController;
1203
+ getModLoader(): ModLoader;
1204
+ getAddonPluginManager(): AddonPluginManager;
1205
+ getLogger(): LogWrapper;
1206
+ lazyRegisterNewModZipData(data: ArgumentTypes<JSZipLikeReadOnlyInterface['loadAsync']>[0], options?: any): Promise<boolean>;
1207
+ parseModPack(modPackBuffer: Uint8Array, password?: string | undefined): Promise<ModMeta>;
1208
+ getNowRunningModName(): string | undefined;
1209
+ getSemVerTools(): SemVerToolsType;
1210
+ getModZipReaderStaticClassRef: () => {
1211
+ LocalStorageLoader: typeof LocalStorageLoader;
1212
+ IndexDBLoader: typeof IndexDBLoader;
1213
+ LocalLoader: typeof LocalLoader;
1214
+ RemoteLoader: typeof RemoteLoader;
1215
+ };
1216
+ getImage(imagePath: string): Promise<string | undefined>;
1217
+ getLanguageManager(): LanguageManager;
1218
+ getNowMainLanguage(): 'en' | 'zh' | string;
1219
+ getIdbKeyValRef(): IdbKeyValRef;
1220
+ getIdbRef(): IdbRef;
1221
+ /**
1222
+ *
1223
+ * const modAddonPluginsParams = window.modUtils.getAddonParamsFromModInfo(modInfo, 'BeautySelectorAddon', 'BeautySelectorAddon');
1224
+ *
1225
+ * @param modInfo params 2 of registerMod callback
1226
+ * @param addonPluginModName params 1 of registerAddonPlugin
1227
+ * @param addonName params 2 of registerAddonPlugin
1228
+ */
1229
+ getAddonParamsFromModInfo<P>(modInfo: ModInfo, addonPluginModName: string, addonName: string): P | undefined;
1230
+ getAddonParamsFromModInfo(modInfo: ModInfo, addonPluginModName: string, addonName: string): ModBootJsonAddonPlugin['params'] | undefined;
1231
+ }
1232
+ type ArgumentTypes<F extends Function> = F extends ((...args: infer A) => any) ? A : never; //#endregion
1233
+ //#endregion
1234
+ //#region ../sugarcube-2-ModLoader/type-dist/DependenceChecker.d.ts
1235
+ //#region remote/BeforeSC2/DependenceChecker.d.ts
1236
+ declare class InfiniteSemVerApi {
1237
+ parseRange: typeof parseVersionRange;
1238
+ parseVersion: typeof parseInfiniteSemVer;
1239
+ satisfies: typeof isWithinRange;
1240
+ }
1241
+ declare class DependenceChecker {
1242
+ gSC2DataManager: SC2DataManager;
1243
+ gModUtils: ModUtils;
1244
+ log: LogWrapper;
1245
+ constructor(gSC2DataManager: SC2DataManager, gModUtils: ModUtils);
1246
+ getInfiniteSemVerApi(): InfiniteSemVerApi;
1247
+ /**
1248
+ * 检查指定mod是否满足指定mod集合作为前序mod的依赖关系
1249
+ *
1250
+ * check if the mod satisfies the dependencies of the specified mod set as the previous mod
1251
+ *
1252
+ * @param {ModInfo} mod - The mod to check for dependencies.
1253
+ * @param {ModOrderContainer[]} modCaches - An array of mod order containers.
1254
+ * @return {boolean} - Returns true if the mod satisfies its dependencies, false otherwise.
1255
+ */
1256
+ checkFor(mod: ModInfo, modCaches: ModOrderContainer[]): boolean;
1257
+ /**
1258
+ * 检查整个加载完毕的mod列表是否满足依赖约束
1259
+ *
1260
+ * Checks the dependencies of the mod order and verifies if they are satisfied.
1261
+ *
1262
+ * @return {boolean} - Returns true if all dependencies are satisfied, otherwise returns false.
1263
+ */
1264
+ check(): boolean;
1265
+ /**
1266
+ * this called by mod `CheckGameVersion`
1267
+ * because the game version only can get after game loaded
1268
+ * @param gameVersion
1269
+ */
1270
+ checkGameVersion(gameVersion: string): boolean;
1271
+ } //#endregion
1272
+ //#endregion
1273
+ //#region ../sugarcube-2-ModLoader/type-dist/PassageTracer.d.ts
1274
+ //#region remote/BeforeSC2/PassageTracer.d.ts
1275
+ type whenPassageCome = (passageName: string) => void;
1276
+ declare class PassageTracer {
1277
+ thisWin: Window;
1278
+ constructor(thisWin: Window);
1279
+ init(): void;
1280
+ private whenPassageComeCallback;
1281
+ addCallback(cb: whenPassageCome): void;
1282
+ newPassageCome(): void;
1283
+ } //#endregion
1284
+ //#endregion
1285
+ //#region ../sugarcube-2-ModLoader/type-dist/SC2JsEvalContext.d.ts
1286
+ //#region remote/BeforeSC2/SC2JsEvalContext.d.ts
1287
+ interface SC2JsEvalContextInfo {
1288
+ contextThis: object;
1289
+ }
1290
+ declare class SC2JsEvalContext {
1291
+ gSC2DataManager: SC2DataManager;
1292
+ constructor(gSC2DataManager: SC2DataManager);
1293
+ contextSet: SC2JsEvalContextInfo[];
1294
+ /**
1295
+ * call by SugarCube2 `Story.storyInit()`
1296
+ */
1297
+ newContext(id: string): object;
1298
+ } //#endregion
1299
+ //#endregion
1300
+ //#region ../sugarcube-2-ModLoader/type-dist/JsPreloader.d.ts
1301
+ //#region remote/BeforeSC2/JsPreloader.d.ts
1302
+ declare class StackLike<T> {
1303
+ private _data;
1304
+ push(v: T): void;
1305
+ pop(): T | undefined;
1306
+ peek(): T | undefined;
1307
+ get length(): number;
1308
+ get data(): T[];
1309
+ get empty(): boolean;
1310
+ clear(): void;
1311
+ }
1312
+ declare class JsPreloader {
1313
+ pSC2DataManager: SC2DataManager;
1314
+ modUtils: ModUtils;
1315
+ thisWin: Window;
1316
+ logger: LogWrapper;
1317
+ constructor(pSC2DataManager: SC2DataManager, modUtils: ModUtils, thisWin: Window);
1318
+ startLoadCalled: boolean;
1319
+ startLoad(): Promise<any>;
1320
+ runningMod: StackLike<string>;
1321
+ JsRunner(content: string, name: string, modName: string, stage: string, pSC2DataManager: SC2DataManager, thisWin: Window, logger: LogWrapper): Promise<any>;
1322
+ } //#endregion
1323
+ //#endregion
1324
+ //#region ../sugarcube-2-ModLoader/type-dist/HtmlTagSrcHook.d.ts
1325
+ //#region remote/BeforeSC2/HtmlTagSrcHook.d.ts
1326
+ type HtmlTagSrcHookType = (el: HTMLImageElement | HTMLElement, mlSrc: string, field: string) => Promise<boolean>;
1327
+ type HtmlTagSrcReturnModeHookType = (mlSrc: string) => Promise<[boolean, string]>;
1328
+ type HtmlTagSrcHookCheckModType = (mlSrc: string) => boolean | undefined;
1329
+ /**
1330
+ * this class replace html image tag src/href attribute ,
1331
+ * redirect the image request to a mod like `ImgLoaderHooker` to load the image.
1332
+ */
1333
+ declare class HtmlTagSrcHook {
1334
+ gSC2DataManager: SC2DataManager;
1335
+ logger: LogWrapper;
1336
+ constructor(gSC2DataManager: SC2DataManager);
1337
+ private hookTable;
1338
+ private hookReturnModeTable;
1339
+ private hookCheckExistTable;
1340
+ addHook(hookKey: string, hook: HtmlTagSrcHookType): void;
1341
+ addReturnModeHook(hookKey: string, hook: HtmlTagSrcReturnModeHookType): void;
1342
+ addCheckExistHook(hookKey: string, hook: HtmlTagSrcHookCheckModType): void;
1343
+ /**
1344
+ * check image exist
1345
+ *
1346
+ * @param src
1347
+ * @return true: exist ; false: not exist ; undefined: not exist but not sure (maybe exist but now not find.);
1348
+ */
1349
+ checkImageExist(src: string): boolean | undefined;
1350
+ /**
1351
+ * get image from mod
1352
+ * @param src image path
1353
+ * @return image base64 string
1354
+ */
1355
+ requestImageBySrc(src: string): Promise<string | undefined>;
1356
+ /**
1357
+ * 归一化路径为相对路径格式
1358
+ * @param path 待归一化的路径
1359
+ * @returns 归一化后的相对路径(去除前导 / 和 ./)
1360
+ */
1361
+ normalizePath(path: string): string;
1362
+ } //#endregion
1363
+ //#endregion
1364
+ //#region ../sugarcube-2-ModLoader/type-dist/SC2ApiRef.d.ts
1365
+ interface SC2Passage {
1366
+ title: string;
1367
+ tags: string[];
1368
+ element: any | undefined;
1369
+ domId: string;
1370
+ classes: string[];
1371
+ readonly className: string;
1372
+ readonly text: string;
1373
+ description: () => string;
1374
+ processText: () => string;
1375
+ render: (options: any) => DocumentFragment;
1376
+ }
1377
+ declare namespace SC2Passage {
1378
+ function getExcerptFromNode(node: Node, count: string): string;
1379
+ function getExcerptFromText(text: string, count: string): string;
1380
+ }
1381
+ //#endregion
1382
+ //#region ../sugarcube-2-ModLoader/type-dist/WikifyTracer.d.ts
1383
+ //#region remote/BeforeSC2/WikifyTracer.d.ts
1384
+ interface WikifyTracerCallback {
1385
+ /**
1386
+ * 可以修改输入文本内容
1387
+ * @param text 原始文本内容
1388
+ * @param passageTitle passage标题
1389
+ * @param passageObj passage对象
1390
+ * @return string 返回修改后的文本内容
1391
+ */
1392
+ beforePassage?: (text: string, passageTitle: string, passageObj: SC2Passage) => string;
1393
+ /**
1394
+ * 可以修改输出后的html树,只会在passage结束后调用
1395
+ * @param text 原始文本内容
1396
+ * @param passageTitle passage标题
1397
+ * @param passageObj passage对象
1398
+ * @param node 最终输出的html树
1399
+ */
1400
+ afterPassage?: (text: string, passageTitle: string, passageObj: SC2Passage, node: DocumentFragment) => void;
1401
+ beforeWikify?: (text: string) => string;
1402
+ /**
1403
+ * 可以修改输出后的html树,会在每一次wikify后调用,包括passage以及每个text节点
1404
+ * @param text 原始文本内容
1405
+ * @param node 最终输出的html树
1406
+ */
1407
+ afterWikify?: (text: string, node: DocumentFragment) => void;
1408
+ /**
1409
+ * 可以修改输入文本内容
1410
+ * @param text 原始文本内容
1411
+ * @param widgetName widget名称
1412
+ * @param passageTitle passage标题
1413
+ * @param passageObj passage对象
1414
+ */
1415
+ beforeWidget?: (text: string, widgetName: string, passageTitle?: string, passageObj?: SC2Passage) => string;
1416
+ /**
1417
+ * 可以修改输出后的html树,会在每一次widget后调用
1418
+ * @param text 原始文本内容
1419
+ * @param widgetName widget名称
1420
+ * @param passageTitle passage标题
1421
+ * @param passageObj passage对象
1422
+ * @param node 最终输出的html树
1423
+ */
1424
+ afterWidget?: (text: string, widgetName: string, passageTitle: string | undefined, passageObj: SC2Passage | undefined, node: DocumentFragment) => void;
1425
+ }
1426
+ declare class WikifyTracer {
1427
+ gSC2DataManager: SC2DataManager;
1428
+ private logger;
1429
+ constructor(gSC2DataManager: SC2DataManager);
1430
+ private callbackTable;
1431
+ private callbackOrder;
1432
+ private callbackCount;
1433
+ addCallback(key: string, callback: WikifyTracerCallback): void;
1434
+ beforePassage(text: string, passageTitle: string, passageObj: SC2Passage): string;
1435
+ afterPassage(text: string, passageTitle: string, passageObj: SC2Passage, node: DocumentFragment): void;
1436
+ beforeWikify(text: string): string;
1437
+ afterWikify(text: string, node: DocumentFragment): void;
1438
+ beforeWidget(text: string, widgetName: string, passageTitle?: string, passageObj?: SC2Passage): string;
1439
+ afterWidget(text: string, widgetName: string, passageTitle: string | undefined, passageObj: SC2Passage | undefined, node: DocumentFragment): void;
1440
+ } //#endregion
1441
+ //#endregion
1442
+ //#region ../sugarcube-2-ModLoader/type-dist/SC2DataManager.d.ts
1443
+ //#region remote/BeforeSC2/SC2DataManager.d.ts
1444
+ declare class SC2DataManager {
1445
+ thisWin: Window;
1446
+ constructor(thisWin: Window);
1447
+ private modUtils;
1448
+ getModUtils(): any;
1449
+ private modLoadController;
1450
+ getModLoadController(): ModLoadController;
1451
+ get rootNode(): Element;
1452
+ get styleNode(): HTMLCollectionOf<HTMLStyleElement>;
1453
+ get scriptNode(): HTMLCollectionOf<HTMLScriptElement>;
1454
+ get passageDataNodeList(): Element[];
1455
+ checkSC2Data(): boolean;
1456
+ createNewSC2DataInfoFromNow(): SC2DataInfo;
1457
+ /**
1458
+ * 用于缓存原始的没有经过任何修改的原始的原版SC2Data
1459
+ * never set it to undefined OR overwrite it
1460
+ * @private
1461
+ */
1462
+ private originSC2DataInfoCache?;
1463
+ earlyResetSC2DataInfoCache(): void;
1464
+ cleanAllCacheAfterModLoadEnd(): void;
1465
+ initSC2DataInfoCache(): void;
1466
+ /**
1467
+ * 读取原始的没有被修改过的SC2Data,
1468
+ * 对于mod来说,如无必要不要使用这里的数据,
1469
+ * 特别是合并时不要使用此处的数据作为数据源,而是使用 getSC2DataInfoAfterPatch(),否则会覆盖之前的mod的修改,导致之前的修改无效
1470
+ */
1471
+ getSC2DataInfoCache(): SC2DataInfoCache;
1472
+ private modLoader?;
1473
+ getModLoader(): ModLoader;
1474
+ private passageTracer;
1475
+ getPassageTracer(): PassageTracer;
1476
+ private languageManager;
1477
+ getLanguageManager(): LanguageManager;
1478
+ private sc2EventTracer;
1479
+ getSc2EventTracer(): Sc2EventTracer;
1480
+ private jsPreloader;
1481
+ getJsPreloader(): JsPreloader;
1482
+ private addonPluginManager;
1483
+ getAddonPluginManager(): AddonPluginManager;
1484
+ private sC2JsEvalContext;
1485
+ getSC2JsEvalContext(): SC2JsEvalContext;
1486
+ private dependenceChecker;
1487
+ getDependenceChecker(): DependenceChecker;
1488
+ private htmlTagSrcHook;
1489
+ getHtmlTagSrcHook(): HtmlTagSrcHook;
1490
+ private wikifyTracer;
1491
+ getWikifyTracer(): WikifyTracer;
1492
+ private conflictResult?;
1493
+ startInitOk: boolean;
1494
+ startInit(): Promise<void>;
1495
+ getConflictResult(): {
1496
+ mod: SC2DataInfo;
1497
+ result: SimulateMergeResult;
1498
+ }[] | undefined;
1499
+ private cSC2DataInfoAfterPatchCache?;
1500
+ /**
1501
+ * 获取最新的SC2Data,此处获得的是之前的mod修改后的最新的SC2Data数据,
1502
+ * 此处使用了缓存,如果修改了SC2Data,请调用 flushAfterPatchCache() 来清除缓存,重新从html中读取最新的SC2Data
1503
+ */
1504
+ getSC2DataInfoAfterPatch(): SC2DataInfoCache;
1505
+ flushAfterPatchCache(): void;
1506
+ applyReplacePatcher(modSC2DataInfoCache: SC2DataInfo): Promise<void>;
1507
+ patchModToGame(): Promise<void>;
1508
+ makePassageNode(T: PassageDataItem): HTMLElement;
1509
+ makeStyleNode(sc: SC2DataInfo): HTMLStyleElement;
1510
+ makeScriptNode(sc: SC2DataInfo): HTMLScriptElement;
1511
+ rePlacePassage(toRemovePassageDataNodeList: Element[], toAddPassageDataNodeList: Element[]): void;
1512
+ } //#endregion
1513
+ //#endregion
1514
+ export { LogWrapper as a, LifeTimeCircleHook as i, ModUtils as n, ModInfo as o, AddonPluginHookPointEx as r, ModZipReader as s, SC2DataManager as t };