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