bc-deeplib 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deeplib.d.ts +62 -12
- package/dist/deeplib.js +17 -2720
- package/dist/deeplib.js.map +4 -4
- package/dist/public/dl_translations/en.lang +4 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/index.js +0 -2626
package/dist/deeplib.d.ts
CHANGED
|
@@ -46,7 +46,6 @@ declare module 'bc-deeplib/base/base_module' {
|
|
|
46
46
|
set settings(value: BaseSettingsModel | null);
|
|
47
47
|
/**
|
|
48
48
|
* Initializes the module.
|
|
49
|
-
* Default implementation registers default settings immediately.
|
|
50
49
|
* Subclasses can override to perform additional setup.
|
|
51
50
|
*/
|
|
52
51
|
init(): void;
|
|
@@ -271,7 +270,7 @@ declare module 'bc-deeplib/base/elements_typings' {
|
|
|
271
270
|
export type Checkbox = Prettify<{
|
|
272
271
|
type: 'checkbox';
|
|
273
272
|
label?: string;
|
|
274
|
-
description?:
|
|
273
|
+
description?: ElementButton.StaticNode;
|
|
275
274
|
setElementValue?: () => boolean;
|
|
276
275
|
setSettingValue?: (val: boolean) => void;
|
|
277
276
|
htmlOptions?: Partial<Record<'container' | 'checkbox' | 'label', Omit<HTMLOptions<any>, 'tag'>>> | null | undefined;
|
|
@@ -279,7 +278,7 @@ declare module 'bc-deeplib/base/elements_typings' {
|
|
|
279
278
|
export type Input = Prettify<{
|
|
280
279
|
type: 'text' | 'number' | 'color';
|
|
281
280
|
label?: string;
|
|
282
|
-
description?:
|
|
281
|
+
description?: ElementButton.StaticNode;
|
|
283
282
|
setElementValue?: () => string;
|
|
284
283
|
setSettingValue?: (val: string) => void;
|
|
285
284
|
htmlOptions?: Partial<Record<'container' | 'input' | 'label', Omit<HTMLOptions<any>, 'tag'>>> | null | undefined;
|
|
@@ -288,7 +287,7 @@ declare module 'bc-deeplib/base/elements_typings' {
|
|
|
288
287
|
id: Parameters<typeof ElementCreateDropdown>[0];
|
|
289
288
|
type: 'dropdown';
|
|
290
289
|
label?: string;
|
|
291
|
-
description?:
|
|
290
|
+
description?: ElementButton.StaticNode;
|
|
292
291
|
optionsList: Parameters<typeof ElementCreateDropdown>[1];
|
|
293
292
|
setElementValue?: () => string;
|
|
294
293
|
setSettingValue?: (val: string) => void;
|
|
@@ -302,7 +301,7 @@ declare module 'bc-deeplib/base/elements_typings' {
|
|
|
302
301
|
export type Label = Prettify<{
|
|
303
302
|
type: 'label';
|
|
304
303
|
label?: string;
|
|
305
|
-
description?:
|
|
304
|
+
description?: ElementButton.StaticNode;
|
|
306
305
|
htmlOptions?: Omit<HTMLOptions<any>, 'tag'>;
|
|
307
306
|
} & BaseElementModel>;
|
|
308
307
|
export type Custom = Prettify<{
|
|
@@ -312,7 +311,7 @@ declare module 'bc-deeplib/base/elements_typings' {
|
|
|
312
311
|
|
|
313
312
|
}
|
|
314
313
|
declare module 'bc-deeplib/base/initialization' {
|
|
315
|
-
import {
|
|
314
|
+
import { ModSdkManager, ModStorage, MainMenuOptions, TranslationOptions, Logger, ModulesList } from 'bc-deeplib/deeplib';
|
|
316
315
|
/** Configuration object for initializing a mod via `initMod`. */
|
|
317
316
|
interface InitOptions {
|
|
318
317
|
/**
|
|
@@ -329,7 +328,7 @@ declare module 'bc-deeplib/base/initialization' {
|
|
|
329
328
|
* List of modules (`BaseModule` subclasses) to register with the mod system.
|
|
330
329
|
* Modules are initialized, loaded, and run in order.
|
|
331
330
|
*/
|
|
332
|
-
modules?:
|
|
331
|
+
modules?: Partial<ModulesList>;
|
|
333
332
|
/**
|
|
334
333
|
* Configuration for customizing the main menu when the mod is active.
|
|
335
334
|
* Does nothing if GUI module is not loaded.
|
|
@@ -381,7 +380,14 @@ declare module 'bc-deeplib/base/initialization' {
|
|
|
381
380
|
|
|
382
381
|
}
|
|
383
382
|
declare module 'bc-deeplib/base/modules' {
|
|
384
|
-
import {
|
|
383
|
+
import { GUI, VersionModule } from 'bc-deeplib/deeplib';
|
|
384
|
+
import { DebugModule } from 'bc-deeplib/modules/debug';
|
|
385
|
+
export interface ModulesList {
|
|
386
|
+
VersionModule: VersionModule;
|
|
387
|
+
GUI: GUI;
|
|
388
|
+
DebugModule: DebugModule;
|
|
389
|
+
}
|
|
390
|
+
export type ModuleKey = Prettify<keyof ModulesList>;
|
|
385
391
|
/**
|
|
386
392
|
* Retrieves all registered module instances.
|
|
387
393
|
*
|
|
@@ -398,7 +404,7 @@ declare module 'bc-deeplib/base/modules' {
|
|
|
398
404
|
* }
|
|
399
405
|
* ```
|
|
400
406
|
*/
|
|
401
|
-
export function modules():
|
|
407
|
+
export function modules(): ModulesList[ModuleKey][];
|
|
402
408
|
/**
|
|
403
409
|
* Registers a module instance in the global registry.
|
|
404
410
|
*
|
|
@@ -414,7 +420,7 @@ declare module 'bc-deeplib/base/modules' {
|
|
|
414
420
|
* registerModule(new MyGlobalModule());
|
|
415
421
|
* ```
|
|
416
422
|
*/
|
|
417
|
-
export function registerModule<
|
|
423
|
+
export function registerModule<K extends ModuleKey>(key: K, module: ModulesList[K]): ModulesList[K];
|
|
418
424
|
/**
|
|
419
425
|
* Retrieves a registered module by its type name.
|
|
420
426
|
*
|
|
@@ -430,7 +436,7 @@ declare module 'bc-deeplib/base/modules' {
|
|
|
430
436
|
* themeModule?.reloadTheme();
|
|
431
437
|
* ```
|
|
432
438
|
*/
|
|
433
|
-
export function getModule<
|
|
439
|
+
export function getModule<K extends ModuleKey>(key: K): ModulesList[K];
|
|
434
440
|
|
|
435
441
|
}
|
|
436
442
|
declare module 'bc-deeplib/deeplib' {
|
|
@@ -444,6 +450,7 @@ declare module 'bc-deeplib/deeplib' {
|
|
|
444
450
|
export * from 'bc-deeplib/models/settings';
|
|
445
451
|
export * from 'bc-deeplib/modules/gui';
|
|
446
452
|
export * from 'bc-deeplib/modules/version';
|
|
453
|
+
export * from 'bc-deeplib/modules/debug';
|
|
447
454
|
export * from 'bc-deeplib/screens/debug';
|
|
448
455
|
export * from 'bc-deeplib/screens/main_menu';
|
|
449
456
|
export * from 'bc-deeplib/screens/import_export';
|
|
@@ -518,6 +525,29 @@ declare module 'bc-deeplib/models/settings' {
|
|
|
518
525
|
Version: string;
|
|
519
526
|
};
|
|
520
527
|
|
|
528
|
+
}
|
|
529
|
+
declare module 'bc-deeplib/modules/debug' {
|
|
530
|
+
import { BaseModule } from 'bc-deeplib/deeplib';
|
|
531
|
+
interface DebugSettings {
|
|
532
|
+
showRawTranslations: boolean;
|
|
533
|
+
showFileNames: boolean;
|
|
534
|
+
showIncomingServerTransactions: boolean;
|
|
535
|
+
incomingMessageFilterMode: 'include' | 'exclude';
|
|
536
|
+
incomingMessageTypes: string;
|
|
537
|
+
showOutcomingServerTransactions: boolean;
|
|
538
|
+
outcomingMessageFilterMode: 'include' | 'exclude';
|
|
539
|
+
outcomingMessageTypes: string;
|
|
540
|
+
showRawActivityNames: boolean;
|
|
541
|
+
showRawAssetNames: boolean;
|
|
542
|
+
}
|
|
543
|
+
export class DebugModule extends BaseModule {
|
|
544
|
+
debugSettings: DebugSettings;
|
|
545
|
+
load(): void;
|
|
546
|
+
unload(): void;
|
|
547
|
+
saveDebugSettings(): void;
|
|
548
|
+
}
|
|
549
|
+
export {};
|
|
550
|
+
|
|
521
551
|
}
|
|
522
552
|
declare module 'bc-deeplib/modules/gui' {
|
|
523
553
|
import { BaseModule, BaseSubscreen, MainMenu } from 'bc-deeplib/deeplib';
|
|
@@ -663,9 +693,12 @@ declare module 'bc-deeplib/modules/version' {
|
|
|
663
693
|
declare module 'bc-deeplib/screens/debug' {
|
|
664
694
|
import { SettingElement } from 'bc-deeplib/base/elements_typings';
|
|
665
695
|
import { BaseSubscreen, SubscreenOptions } from 'bc-deeplib/deeplib';
|
|
696
|
+
import { DebugModule } from 'bc-deeplib/modules/debug';
|
|
666
697
|
export class GuiDebug extends BaseSubscreen {
|
|
667
698
|
protected static subscreenOptions: SubscreenOptions;
|
|
699
|
+
readonly module: DebugModule;
|
|
668
700
|
get pageStructure(): SettingElement[][];
|
|
701
|
+
exit(): void;
|
|
669
702
|
}
|
|
670
703
|
|
|
671
704
|
}
|
|
@@ -801,6 +834,17 @@ declare module 'bc-deeplib/utilities/common' {
|
|
|
801
834
|
* Converts bytes to kilobytes.
|
|
802
835
|
*/
|
|
803
836
|
export const byteToKB: (nByte: number) => number;
|
|
837
|
+
export type Ok<T> = {
|
|
838
|
+
ok: true;
|
|
839
|
+
value: T;
|
|
840
|
+
};
|
|
841
|
+
export type Err<E = unknown> = {
|
|
842
|
+
ok: false;
|
|
843
|
+
error: E;
|
|
844
|
+
};
|
|
845
|
+
export type Result<T, E = unknown> = Ok<T> | Err<E>;
|
|
846
|
+
export function tryCatch<T, E = unknown>(fn: () => T, mapError?: (e: unknown) => E): Result<T, E>;
|
|
847
|
+
export function tryCatchAsync<T, E = unknown>(fn: () => Promise<T>, mapError?: (e: unknown) => E): Promise<Result<T, E>>;
|
|
804
848
|
|
|
805
849
|
}
|
|
806
850
|
declare module 'bc-deeplib/utilities/data' {
|
|
@@ -861,7 +905,7 @@ declare module 'bc-deeplib/utilities/elements/elements' {
|
|
|
861
905
|
function elementCreateDropdown(options: Omit<Dropdown, 'type'>): HTMLLabelElement;
|
|
862
906
|
function elementCreateTooltip(): HTMLDivElement;
|
|
863
907
|
function elementGetTooltip(): HTMLElement | undefined;
|
|
864
|
-
function elementSetTooltip(text:
|
|
908
|
+
function elementSetTooltip(text: ElementButton.StaticNode, position?: 'top' | 'bottom'): boolean;
|
|
865
909
|
interface PrevNext {
|
|
866
910
|
id: string;
|
|
867
911
|
initialLabel?: string;
|
|
@@ -911,6 +955,11 @@ declare module 'bc-deeplib/utilities/elements/helpers' {
|
|
|
911
955
|
* Returns null if the element is not found.
|
|
912
956
|
*/
|
|
913
957
|
hasOverflow: typeof hasOverflow;
|
|
958
|
+
/**
|
|
959
|
+
* Checks if two rectangles overlap.
|
|
960
|
+
* Returns true if the rectangles overlap, false otherwise.
|
|
961
|
+
*/
|
|
962
|
+
doRectsOverlap: typeof doRectsOverlap;
|
|
914
963
|
};
|
|
915
964
|
function autoSetPosition(_: ElementHelp.ElementOrId, position: SettingElement['position']): void;
|
|
916
965
|
function autoSetSize(_: ElementHelp.ElementOrId, size: SettingElement['size']): void;
|
|
@@ -921,6 +970,7 @@ declare module 'bc-deeplib/utilities/elements/helpers' {
|
|
|
921
970
|
vertical: boolean;
|
|
922
971
|
horizontal: boolean;
|
|
923
972
|
} | null;
|
|
973
|
+
function doRectsOverlap(rect1: DOMRect, rect2: DOMRect): boolean;
|
|
924
974
|
export {};
|
|
925
975
|
|
|
926
976
|
}
|