bc-deeplib 1.0.5 → 1.1.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/CREDITS.md +13 -0
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/dist/3rd_party_types/bcmodsdk.d.ts +184 -0
- package/dist/3rd_party_types/declarations.d.ts +4 -0
- package/dist/deeplib.d.ts +538 -0
- package/dist/deeplib.js +2582 -0
- package/dist/deeplib.js.map +7 -0
- package/dist/index.js +2556 -0
- package/dist/index.js.map +7 -0
- package/dist/public/dl_images/arrow_left.svg +1 -0
- package/dist/public/dl_images/arrow_right.svg +1 -0
- package/dist/public/dl_images/bug.svg +1 -0
- package/dist/public/dl_images/clipboard_export.svg +19 -0
- package/dist/public/dl_images/clipboard_import.svg +19 -0
- package/dist/public/dl_images/cog.svg +1 -0
- package/dist/public/dl_images/exit.svg +1 -0
- package/dist/public/dl_images/file_export.svg +12 -0
- package/dist/public/dl_images/file_import.svg +12 -0
- package/dist/public/dl_images/git.svg +10 -0
- package/dist/public/dl_images/notebook.svg +1 -0
- package/dist/public/dl_images/round_arrow_left.svg +1 -0
- package/dist/public/dl_images/round_arrow_right.svg +1 -0
- package/dist/public/dl_images/round_transfer.svg +7 -0
- package/dist/public/dl_images/transfer.svg +1 -0
- package/dist/public/dl_images/trash_bin.svg +1 -0
- package/dist/public/dl_translations/en.lang +17 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vendored_types/bcmodsdk.d.ts +184 -0
- package/dist/vendored_types/declarations.d.ts +5 -0
- package/lib/build.d.ts +32 -0
- package/lib/build.js +236 -0
- package/package.json +41 -24
- package/.types/declarations.d.ts +0 -15
- package/.types/elements.d.ts +0 -38
- package/.types/type-override.d.ts +0 -3
- package/public/styles/DeepLib.css +0 -206
- package/public/styles/Gratitude.css +0 -23
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
declare module 'bc-deeplib/base/base_module' {
|
|
2
|
+
import { BaseSettingsModel, Subscreen } from 'bc-deeplib/deeplib';
|
|
3
|
+
export abstract class BaseModule {
|
|
4
|
+
get settingsScreen(): Subscreen | null;
|
|
5
|
+
get settingsStorage(): string | null;
|
|
6
|
+
get settings(): BaseSettingsModel;
|
|
7
|
+
set settings(value: BaseSettingsModel);
|
|
8
|
+
init(): void;
|
|
9
|
+
registerDefaultSettings(): void;
|
|
10
|
+
get defaultSettings(): BaseSettingsModel | null;
|
|
11
|
+
load(): void;
|
|
12
|
+
run(): void;
|
|
13
|
+
unload(): void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
declare module 'bc-deeplib/base/base_subscreen' {
|
|
18
|
+
import { BaseModule, BaseSettingsModel } from 'bc-deeplib/deeplib';
|
|
19
|
+
import { SettingElement } from 'bc-deeplib/base/elements_typings';
|
|
20
|
+
type SubscreenOptions = {
|
|
21
|
+
drawCharacter?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type Subscreen = new (subscreenOptions?: SubscreenOptions, module?: BaseModule) => BaseSubscreen;
|
|
24
|
+
export function getCurrentSubscreen(): BaseSubscreen | null;
|
|
25
|
+
export function setSubscreen(subscreen: BaseSubscreen | string | null): BaseSubscreen | null;
|
|
26
|
+
export abstract class BaseSubscreen {
|
|
27
|
+
static currentElements: [HTMLElement, SettingElement][];
|
|
28
|
+
static currentPage: number;
|
|
29
|
+
readonly options: SubscreenOptions;
|
|
30
|
+
readonly module: BaseModule;
|
|
31
|
+
constructor(subscreenOptions?: SubscreenOptions, module?: BaseModule);
|
|
32
|
+
get name(): string;
|
|
33
|
+
get icon(): string;
|
|
34
|
+
get subscreenName(): string;
|
|
35
|
+
setSubscreen(screen: BaseSubscreen | string | null): BaseSubscreen | null;
|
|
36
|
+
get settings(): BaseSettingsModel;
|
|
37
|
+
set settings(value: BaseSettingsModel);
|
|
38
|
+
get pageStructure(): SettingElement[][];
|
|
39
|
+
get currentPage(): SettingElement[];
|
|
40
|
+
changePage(page: number, setLabel: (label: string) => void): void;
|
|
41
|
+
managePageElementsVisibility(): void;
|
|
42
|
+
load(): void;
|
|
43
|
+
run(): void;
|
|
44
|
+
click(): void;
|
|
45
|
+
exit(): void;
|
|
46
|
+
resize(onLoad?: boolean): void;
|
|
47
|
+
unload(): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
declare module 'bc-deeplib/base/elements_typings' {
|
|
53
|
+
export type SettingElement = Button | Checkbox | Input | Label | Custom;
|
|
54
|
+
export type BaseElementModel = {
|
|
55
|
+
id: string;
|
|
56
|
+
size?: [width: number | null, height: number | null] | (() => [width: number | null, height: number | null]);
|
|
57
|
+
position?: [x: number, y: number] | (() => [x: number, y: number]);
|
|
58
|
+
disabled?: boolean | (() => boolean);
|
|
59
|
+
};
|
|
60
|
+
type CustomButtonOptions = {
|
|
61
|
+
id?: Parameters<typeof ElementButton.Create>[0];
|
|
62
|
+
onClick?: Parameters<typeof ElementButton.Create>[1];
|
|
63
|
+
options?: Parameters<typeof ElementButton.Create>[2];
|
|
64
|
+
htmlOptions?: Parameters<typeof ElementButton.Create>[3];
|
|
65
|
+
};
|
|
66
|
+
export type Button = BaseElementModel & {
|
|
67
|
+
type: 'button';
|
|
68
|
+
image?: string;
|
|
69
|
+
label?: string;
|
|
70
|
+
tooltip?: string;
|
|
71
|
+
onClick?: () => void;
|
|
72
|
+
htmlOptions?: CustomButtonOptions;
|
|
73
|
+
};
|
|
74
|
+
export type Checkbox = BaseElementModel & {
|
|
75
|
+
type: 'checkbox';
|
|
76
|
+
label?: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
setElementValue?: () => boolean;
|
|
79
|
+
setSettingValue?: (val: boolean) => void;
|
|
80
|
+
htmlOptions?: Omit<HTMLOptions<any>, 'tag'>;
|
|
81
|
+
};
|
|
82
|
+
export type Input = BaseElementModel & {
|
|
83
|
+
type: 'text' | 'number' | 'color';
|
|
84
|
+
label?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
setElementValue?: () => string;
|
|
87
|
+
setSettingValue?: (val: string) => void;
|
|
88
|
+
htmlOptions?: Omit<HTMLOptions<any>, 'tag'>;
|
|
89
|
+
};
|
|
90
|
+
export type Label = BaseElementModel & {
|
|
91
|
+
type: 'label';
|
|
92
|
+
label?: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
htmlOptions?: Omit<HTMLOptions<any>, 'tag'>;
|
|
95
|
+
};
|
|
96
|
+
export type Custom = BaseElementModel & {
|
|
97
|
+
type: 'custom';
|
|
98
|
+
htmlOptions: HTMLOptions<keyof HTMLElementTagNameMap>;
|
|
99
|
+
};
|
|
100
|
+
export {};
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
declare module 'bc-deeplib/base/initialization' {
|
|
104
|
+
import { BaseModule, ModSdkManager, BaseMigrator, ModStorage, MainMenuOptions } from 'bc-deeplib/deeplib';
|
|
105
|
+
interface InitOptions {
|
|
106
|
+
modInfo: {
|
|
107
|
+
info: ModSDKModInfo;
|
|
108
|
+
options?: ModSDKModOptions;
|
|
109
|
+
};
|
|
110
|
+
modules?: BaseModule[];
|
|
111
|
+
migrators?: BaseMigrator[];
|
|
112
|
+
mainMenuOptions?: MainMenuOptions;
|
|
113
|
+
beforeLogin?: () => (void);
|
|
114
|
+
initFunction?: () => (void | Promise<void>);
|
|
115
|
+
pathToTranslationsFolder?: string;
|
|
116
|
+
}
|
|
117
|
+
export let modStorage: ModStorage;
|
|
118
|
+
export function initMod(options: InitOptions): {
|
|
119
|
+
sdk: ModSdkManager;
|
|
120
|
+
};
|
|
121
|
+
export function init(options: InitOptions): Promise<void>;
|
|
122
|
+
export function unloadMod(): true;
|
|
123
|
+
export {};
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
declare module 'bc-deeplib/base/modules' {
|
|
127
|
+
import { BaseModule } from 'bc-deeplib/deeplib';
|
|
128
|
+
export const modulesMap: Map<string, BaseModule>;
|
|
129
|
+
export function modules(): BaseModule[];
|
|
130
|
+
export function registerModule<T extends BaseModule>(module: T): T;
|
|
131
|
+
export function getModule<T extends BaseModule>(moduleType: string): T;
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
declare module 'bc-deeplib/deeplib' {
|
|
135
|
+
export * from 'bc-deeplib/base/base_module';
|
|
136
|
+
export * from 'bc-deeplib/base/base_subscreen';
|
|
137
|
+
export * from 'bc-deeplib/base/initialization';
|
|
138
|
+
export * from 'bc-deeplib/base/modules';
|
|
139
|
+
export * from 'bc-deeplib/migrators/base_migrator';
|
|
140
|
+
export * from 'bc-deeplib/models/base';
|
|
141
|
+
export * from 'bc-deeplib/models/settings';
|
|
142
|
+
export * from 'bc-deeplib/modules/gui';
|
|
143
|
+
export * from 'bc-deeplib/modules/version';
|
|
144
|
+
export * from 'bc-deeplib/screens/debug';
|
|
145
|
+
export * from 'bc-deeplib/screens/main_menu';
|
|
146
|
+
export * from 'bc-deeplib/screens/import_export';
|
|
147
|
+
export * from 'bc-deeplib/utilities/data';
|
|
148
|
+
export * from 'bc-deeplib/utilities/elements/advanced_elements';
|
|
149
|
+
export * from 'bc-deeplib/utilities/elements/element_helpers';
|
|
150
|
+
export * from 'bc-deeplib/utilities/elements/layout_elements';
|
|
151
|
+
export * from 'bc-deeplib/utilities/common';
|
|
152
|
+
export * from 'bc-deeplib/utilities/logger';
|
|
153
|
+
export * from 'bc-deeplib/utilities/messages';
|
|
154
|
+
export * from 'bc-deeplib/utilities/sdk';
|
|
155
|
+
export * from 'bc-deeplib/utilities/style';
|
|
156
|
+
export * from 'bc-deeplib/utilities/translation';
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
declare module 'bc-deeplib/migrators/base_migrator' {
|
|
160
|
+
export abstract class BaseMigrator {
|
|
161
|
+
abstract get MigrationVersion(): string;
|
|
162
|
+
abstract Migrate(): boolean;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
declare module 'bc-deeplib/models/base' {
|
|
167
|
+
export type BaseSettingsModel = {
|
|
168
|
+
modEnabled: boolean;
|
|
169
|
+
doShowNewVersionMessage: boolean;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
declare module 'bc-deeplib/models/settings' {
|
|
174
|
+
import { BaseSettingsModel } from 'bc-deeplib/deeplib';
|
|
175
|
+
export type SettingsModel = {
|
|
176
|
+
[x: string]: any;
|
|
177
|
+
GlobalModule: BaseSettingsModel;
|
|
178
|
+
Version: string;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
declare module 'bc-deeplib/modules/gui' {
|
|
183
|
+
import { BaseModule, BaseSubscreen, MainMenu } from 'bc-deeplib/deeplib';
|
|
184
|
+
type ModButtonOptions = {
|
|
185
|
+
Identifier: string;
|
|
186
|
+
ButtonText: string | (() => string);
|
|
187
|
+
Image: string | (() => string);
|
|
188
|
+
load?: () => void;
|
|
189
|
+
click?: () => void;
|
|
190
|
+
run?: () => void;
|
|
191
|
+
unload?: () => void;
|
|
192
|
+
exit?: () => boolean | void;
|
|
193
|
+
};
|
|
194
|
+
export class GUI extends BaseModule {
|
|
195
|
+
static instance: GUI | null;
|
|
196
|
+
private _subscreens;
|
|
197
|
+
private _mainMenu;
|
|
198
|
+
private _currentSubscreen;
|
|
199
|
+
private _modButtonOptions;
|
|
200
|
+
get subscreens(): BaseSubscreen[];
|
|
201
|
+
get mainMenu(): MainMenu;
|
|
202
|
+
get currentSubscreen(): BaseSubscreen | null;
|
|
203
|
+
set currentSubscreen(subscreen: BaseSubscreen | string | null);
|
|
204
|
+
constructor(modButtonOptions: ModButtonOptions);
|
|
205
|
+
get defaultSettings(): null;
|
|
206
|
+
load(): void;
|
|
207
|
+
}
|
|
208
|
+
export {};
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
declare module 'bc-deeplib/modules/version' {
|
|
212
|
+
import { BaseMigrator, BaseModule } from 'bc-deeplib/deeplib';
|
|
213
|
+
export class VersionModule extends BaseModule {
|
|
214
|
+
private static isItNewVersion;
|
|
215
|
+
static Version: string;
|
|
216
|
+
static NewVersionMessage: string;
|
|
217
|
+
private static Migrators;
|
|
218
|
+
load(): void;
|
|
219
|
+
static checkVersionUpdate(): void;
|
|
220
|
+
private static checkVersionMigration;
|
|
221
|
+
static registerMigrator(migrator: BaseMigrator): void;
|
|
222
|
+
static setNewVersionMessage(newVersionMessage: string): void;
|
|
223
|
+
static sendNewVersionMessage(): void;
|
|
224
|
+
private static isNewVersion;
|
|
225
|
+
private static saveVersion;
|
|
226
|
+
private static loadVersion;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
declare module 'bc-deeplib/screens/debug' {
|
|
231
|
+
import { SettingElement } from 'bc-deeplib/base/elements_typings';
|
|
232
|
+
import { BaseSubscreen } from 'bc-deeplib/deeplib';
|
|
233
|
+
export class GuiDebug extends BaseSubscreen {
|
|
234
|
+
get name(): string;
|
|
235
|
+
get pageStructure(): SettingElement[][];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
declare module 'bc-deeplib/screens/import_export' {
|
|
240
|
+
import { BaseSubscreen } from 'bc-deeplib/deeplib';
|
|
241
|
+
export type ImportExportOptions = {
|
|
242
|
+
customFileExtension: string;
|
|
243
|
+
onImport?: () => void;
|
|
244
|
+
onExport?: () => void;
|
|
245
|
+
};
|
|
246
|
+
type DataTransferMethod = 'clipboard' | 'file';
|
|
247
|
+
export class GuiImportExport extends BaseSubscreen {
|
|
248
|
+
private importExportOptions;
|
|
249
|
+
get name(): string;
|
|
250
|
+
constructor(importExportOptions: ImportExportOptions);
|
|
251
|
+
load(): void;
|
|
252
|
+
resize(): void;
|
|
253
|
+
dataExport(transferMethod: DataTransferMethod): Promise<void>;
|
|
254
|
+
dataImport(transferMethod: DataTransferMethod): Promise<void>;
|
|
255
|
+
exportToFile(data: string, defaultFileName: string): Promise<void>;
|
|
256
|
+
importFromFile(): Promise<string | null>;
|
|
257
|
+
exportToClipboard(data: string): Promise<void>;
|
|
258
|
+
importFromClipboard(): Promise<string | null>;
|
|
259
|
+
}
|
|
260
|
+
export {};
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
declare module 'bc-deeplib/screens/main_menu' {
|
|
264
|
+
import { BaseSubscreen, GUI } from 'bc-deeplib/deeplib';
|
|
265
|
+
import { GuiImportExport } from 'bc-deeplib/screens/import_export';
|
|
266
|
+
export type MainMenuOptions = {
|
|
267
|
+
repoLink?: string;
|
|
268
|
+
wikiLink?: string;
|
|
269
|
+
resetSubscreen?: BaseSubscreen;
|
|
270
|
+
importExportSubscreen?: GuiImportExport;
|
|
271
|
+
};
|
|
272
|
+
export class MainMenu extends BaseSubscreen {
|
|
273
|
+
subscreens: BaseSubscreen[];
|
|
274
|
+
private static options;
|
|
275
|
+
get name(): string;
|
|
276
|
+
constructor(module: GUI);
|
|
277
|
+
load(): void;
|
|
278
|
+
run(): void;
|
|
279
|
+
click(): void;
|
|
280
|
+
exit(): void;
|
|
281
|
+
resize(): void;
|
|
282
|
+
static setOptions(mainMenuOptions: MainMenuOptions): void;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
}
|
|
286
|
+
declare module 'bc-deeplib/utilities/common' {
|
|
287
|
+
export function deepMerge(target: any, source: any): any;
|
|
288
|
+
export function shuffleArray(array: string[]): string[];
|
|
289
|
+
export function exportToGlobal(name: string, value: any): void;
|
|
290
|
+
export function deepMergeMatchingProperties<T extends object>(mergeTo: T, mergeFrom: T): T;
|
|
291
|
+
export function hasGetter<T extends object>(obj: T, prop: keyof T | string): boolean;
|
|
292
|
+
export function hasSetter<T extends object>(obj: T, prop: keyof T | string): boolean;
|
|
293
|
+
|
|
294
|
+
}
|
|
295
|
+
declare module 'bc-deeplib/utilities/data' {
|
|
296
|
+
import { SettingsModel } from 'bc-deeplib/deeplib';
|
|
297
|
+
export class ModStorage<T extends SettingsModel = SettingsModel> {
|
|
298
|
+
private static _instance;
|
|
299
|
+
private modName;
|
|
300
|
+
constructor(modName: string);
|
|
301
|
+
get playerStorage(): T;
|
|
302
|
+
set playerStorage(value: T);
|
|
303
|
+
get extensionStorage(): string;
|
|
304
|
+
set extensionStorage(value: string);
|
|
305
|
+
setLocalStorage(key: string, value: object): void;
|
|
306
|
+
getLocalStorage(key: string): object | null;
|
|
307
|
+
load(): void;
|
|
308
|
+
save(): void;
|
|
309
|
+
static dataDecompress<T = object>(string: string): T | null;
|
|
310
|
+
static dataCompress(object: object): string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
}
|
|
314
|
+
declare module 'bc-deeplib/utilities/elements/advanced_elements' {
|
|
315
|
+
import { Button, Checkbox, Custom, Input, Label } from 'bc-deeplib/base/elements_typings';
|
|
316
|
+
export const advancedElement: {
|
|
317
|
+
createButton: typeof elementCreateButton;
|
|
318
|
+
createCheckbox: typeof elementCreateCheckbox;
|
|
319
|
+
createInput: typeof elementCreateInput;
|
|
320
|
+
createLabel: typeof elementCreateLabel;
|
|
321
|
+
createCustom: typeof elementCreateCustom;
|
|
322
|
+
createTooltip: typeof elementCreateTooltip;
|
|
323
|
+
getTooltip: typeof elementGetTooltip;
|
|
324
|
+
setTooltip: typeof elementSetTooltip;
|
|
325
|
+
createBackNext: typeof elementPrevNext;
|
|
326
|
+
};
|
|
327
|
+
function elementCreateButton(options: Omit<Button, 'type'>): HTMLButtonElement;
|
|
328
|
+
function elementCreateCheckbox(options: Omit<Checkbox, 'type'>): HTMLElement;
|
|
329
|
+
function elementCreateCustom(options: Omit<Custom, 'type'>): HTMLElement;
|
|
330
|
+
function elementCreateInput(options: Input): HTMLElement;
|
|
331
|
+
function elementCreateLabel(options: Omit<Label, 'type'>): HTMLElement;
|
|
332
|
+
function elementCreateTooltip(): HTMLDivElement;
|
|
333
|
+
function elementGetTooltip(): HTMLElement | undefined;
|
|
334
|
+
function elementSetTooltip(text: string): boolean;
|
|
335
|
+
interface PrevNext {
|
|
336
|
+
id: string;
|
|
337
|
+
initialLabel?: string;
|
|
338
|
+
back: (arg0: PrevNextCallbacks) => void;
|
|
339
|
+
initialPrevTooltip?: string;
|
|
340
|
+
next: (arg0: PrevNextCallbacks) => void;
|
|
341
|
+
initialNextTooltip?: string;
|
|
342
|
+
}
|
|
343
|
+
interface PrevNextCallbacks {
|
|
344
|
+
setLabel: (label: string) => void;
|
|
345
|
+
setBackTooltip: (tooltip: string) => void;
|
|
346
|
+
setNextTooltip: (tooltip: string) => void;
|
|
347
|
+
}
|
|
348
|
+
function elementPrevNext(options: PrevNext): HTMLElement;
|
|
349
|
+
export type ModalButton<T extends string = string> = {
|
|
350
|
+
text: string;
|
|
351
|
+
action: T;
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
};
|
|
354
|
+
export type ModalInputOptions = {
|
|
355
|
+
defaultValue?: string;
|
|
356
|
+
readOnly?: boolean;
|
|
357
|
+
placeholder?: string;
|
|
358
|
+
type: 'input' | 'textarea';
|
|
359
|
+
validate?: (value: string) => string | null;
|
|
360
|
+
};
|
|
361
|
+
export type ModalOptions<T extends string = string> = {
|
|
362
|
+
prompt: string | Node;
|
|
363
|
+
input?: ModalInputOptions;
|
|
364
|
+
buttons?: ModalButton<T>[];
|
|
365
|
+
custom?: readonly (string | Node | HTMLOptions<keyof HTMLElementTagNameMap> | null | undefined)[] | undefined;
|
|
366
|
+
closeOnBackdrop?: boolean;
|
|
367
|
+
timeoutMs?: number;
|
|
368
|
+
};
|
|
369
|
+
export class Modal<T extends string = string> {
|
|
370
|
+
private opts;
|
|
371
|
+
private dialog;
|
|
372
|
+
private blocker;
|
|
373
|
+
private inputEl?;
|
|
374
|
+
private timeoutId?;
|
|
375
|
+
private static queue;
|
|
376
|
+
private static processing;
|
|
377
|
+
constructor(opts: ModalOptions<T>);
|
|
378
|
+
show(): Promise<[T, string | null]>;
|
|
379
|
+
static alert(msg: string, timeoutMs?: number): Promise<void>;
|
|
380
|
+
static confirm(msg: string): Promise<boolean>;
|
|
381
|
+
static prompt(msg: string, defaultValue?: string): Promise<string | null>;
|
|
382
|
+
private renderInput;
|
|
383
|
+
private renderButtons;
|
|
384
|
+
private createBlocker;
|
|
385
|
+
private setupFocusTrap;
|
|
386
|
+
private close;
|
|
387
|
+
private resolve;
|
|
388
|
+
private static enqueue;
|
|
389
|
+
private static dequeue;
|
|
390
|
+
}
|
|
391
|
+
export {};
|
|
392
|
+
|
|
393
|
+
}
|
|
394
|
+
declare module 'bc-deeplib/utilities/elements/element_helpers' {
|
|
395
|
+
import { SettingElement } from 'bc-deeplib/base/elements_typings';
|
|
396
|
+
export const domUtil: {
|
|
397
|
+
autoSetPosition: typeof autoSetPosition;
|
|
398
|
+
autoSetSize: typeof autoSetSize;
|
|
399
|
+
hide: typeof hide;
|
|
400
|
+
unhide: typeof unhide;
|
|
401
|
+
hasOverflow: typeof hasOverflow;
|
|
402
|
+
};
|
|
403
|
+
function autoSetPosition(_: ElementHelp.ElementOrId, position: SettingElement['position']): void;
|
|
404
|
+
function autoSetSize(_: ElementHelp.ElementOrId, size: SettingElement['size']): void;
|
|
405
|
+
function hide(_: ElementHelp.ElementOrId): void;
|
|
406
|
+
function unhide(_: ElementHelp.ElementOrId): void;
|
|
407
|
+
function hasOverflow(el: ElementHelp.ElementOrId): {
|
|
408
|
+
any: boolean;
|
|
409
|
+
vertical: boolean;
|
|
410
|
+
horizontal: boolean;
|
|
411
|
+
} | null;
|
|
412
|
+
export {};
|
|
413
|
+
|
|
414
|
+
}
|
|
415
|
+
declare module 'bc-deeplib/utilities/elements/layout_elements' {
|
|
416
|
+
export const layoutElement: {
|
|
417
|
+
createSubscreenDiv: typeof elementCreateSubscreenDiv;
|
|
418
|
+
getSubscreenDiv: typeof elementGetSubscreenDiv;
|
|
419
|
+
appendToSubscreenDiv: typeof elementAppendToSubscreenDiv;
|
|
420
|
+
removeSubscreenDiv: typeof elementRemoveSubscreenDiv;
|
|
421
|
+
createSettingsDiv: typeof elementCreateSettingsDiv;
|
|
422
|
+
getSettingsDiv: typeof elementGetSettingsDiv;
|
|
423
|
+
appendToSettingsDiv: typeof elementAppendToSettingsDiv;
|
|
424
|
+
removeSettingsDiv: typeof elementRemoveSettingsDiv;
|
|
425
|
+
createMiscDiv: typeof elementCreateMiscDiv;
|
|
426
|
+
getMiscDiv: typeof elementGetMiscDiv;
|
|
427
|
+
appendToMiscDiv: typeof elementAppendToMiscDiv;
|
|
428
|
+
removeMiscDiv: typeof elementRemoveMiscDiv;
|
|
429
|
+
};
|
|
430
|
+
function elementCreateSubscreenDiv(): HTMLElement;
|
|
431
|
+
function elementGetSubscreenDiv(): HTMLElement | undefined;
|
|
432
|
+
function elementRemoveSubscreenDiv(): void | undefined;
|
|
433
|
+
function elementAppendToSubscreenDiv(...element: HTMLElement[]): void | undefined;
|
|
434
|
+
function elementCreateSettingsDiv(): HTMLElement;
|
|
435
|
+
function elementGetSettingsDiv(): HTMLElement | undefined;
|
|
436
|
+
function elementAppendToSettingsDiv(...element: HTMLElement[]): void | undefined;
|
|
437
|
+
function elementRemoveSettingsDiv(): void | undefined;
|
|
438
|
+
function elementCreateMiscDiv(): HTMLElement;
|
|
439
|
+
function elementGetMiscDiv(): HTMLElement | null;
|
|
440
|
+
function elementAppendToMiscDiv(...element: HTMLElement[]): void | undefined;
|
|
441
|
+
function elementRemoveMiscDiv(): void | undefined;
|
|
442
|
+
export {};
|
|
443
|
+
|
|
444
|
+
}
|
|
445
|
+
declare module 'bc-deeplib/utilities/logger' {
|
|
446
|
+
type LogLevel = 'info' | 'log' | 'warn' | 'error' | 'debug';
|
|
447
|
+
interface LogEntry {
|
|
448
|
+
readonly args: readonly any[];
|
|
449
|
+
readonly date: Date;
|
|
450
|
+
readonly logLevel: LogLevel;
|
|
451
|
+
}
|
|
452
|
+
export class Logger extends Array<LogEntry> {
|
|
453
|
+
private ModName;
|
|
454
|
+
constructor(modName?: string);
|
|
455
|
+
private _Log;
|
|
456
|
+
info(...args: any[]): void;
|
|
457
|
+
log(...args: any[]): void;
|
|
458
|
+
warn(...args: any[]): void;
|
|
459
|
+
error(...args: any[]): void;
|
|
460
|
+
debug(...args: any[]): void;
|
|
461
|
+
static colorizeLog(logLevel: LogLevel): string;
|
|
462
|
+
}
|
|
463
|
+
export const deepLibLogger: Logger;
|
|
464
|
+
export {};
|
|
465
|
+
|
|
466
|
+
}
|
|
467
|
+
declare module 'bc-deeplib/utilities/messages' {
|
|
468
|
+
export function sendLocalMessage(id: string | null, message: string, timeoutInSeconds?: number): void;
|
|
469
|
+
export function sendActionMessage(msg: string, target?: undefined | number, dictionary?: ChatMessageDictionaryEntry[]): void;
|
|
470
|
+
|
|
471
|
+
}
|
|
472
|
+
declare module 'bc-deeplib/utilities/sdk' {
|
|
473
|
+
export const HookPriority: {
|
|
474
|
+
Observe: number;
|
|
475
|
+
AddBehavior: number;
|
|
476
|
+
ModifyBehavior: number;
|
|
477
|
+
OverrideBehavior: number;
|
|
478
|
+
Top: number;
|
|
479
|
+
};
|
|
480
|
+
export type ModuleCategory = number | string;
|
|
481
|
+
interface IPatchedFunctionData {
|
|
482
|
+
name: string;
|
|
483
|
+
hooks: {
|
|
484
|
+
hook: PatchHook;
|
|
485
|
+
priority: number;
|
|
486
|
+
module: ModuleCategory | null;
|
|
487
|
+
removeCallback: () => void;
|
|
488
|
+
}[];
|
|
489
|
+
}
|
|
490
|
+
export class ModSdkManager {
|
|
491
|
+
private static SDK;
|
|
492
|
+
private static patchedFunctions;
|
|
493
|
+
static ModInfo: ModSDKModInfo;
|
|
494
|
+
constructor(info: ModSDKModInfo, options?: ModSDKModOptions);
|
|
495
|
+
initPatchableFunction(target: string): IPatchedFunctionData;
|
|
496
|
+
hookFunction<TargetName extends string>(target: TargetName, priority: number, hook: PatchHook<GetDotedPathType<typeof globalThis, TargetName>>, module?: ModuleCategory | null): () => void;
|
|
497
|
+
patchFunction(target: string, patches: Record<string, string>): void;
|
|
498
|
+
unpatchFunction(target: string): void;
|
|
499
|
+
removeHookByModule(target: string, module: ModuleCategory): boolean;
|
|
500
|
+
removeAllHooksByModule(module: ModuleCategory): boolean;
|
|
501
|
+
}
|
|
502
|
+
export {};
|
|
503
|
+
|
|
504
|
+
}
|
|
505
|
+
declare module 'bc-deeplib/utilities/style' {
|
|
506
|
+
export const Style: {
|
|
507
|
+
injectInline(styleId: string, styleSource: string): void;
|
|
508
|
+
injectEmbed(styleId: string, styleLink: string): void;
|
|
509
|
+
eject(id: string): void;
|
|
510
|
+
reload(styleId: string, styleSource: string): void;
|
|
511
|
+
fetch(link: string): Promise<string>;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
}
|
|
515
|
+
declare module 'bc-deeplib/utilities/translation' {
|
|
516
|
+
interface InitOptions {
|
|
517
|
+
pathToTranslationsFolder: string;
|
|
518
|
+
}
|
|
519
|
+
export class Localization {
|
|
520
|
+
private static LibTranslation;
|
|
521
|
+
private static ModTranslation;
|
|
522
|
+
private static PathToModTranslation;
|
|
523
|
+
private static PathToLibTranslation;
|
|
524
|
+
private static initialized;
|
|
525
|
+
static init(initOptions: InitOptions): Promise<void>;
|
|
526
|
+
static getTextMod(srcTag: string): string | undefined;
|
|
527
|
+
static getTextLib(srcTag: string): string | undefined;
|
|
528
|
+
private static fetchLanguageFile;
|
|
529
|
+
private static parseLanguageFile;
|
|
530
|
+
}
|
|
531
|
+
export const getText: (srcTag: string) => string;
|
|
532
|
+
export {};
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
declare module 'bc-deeplib' {
|
|
536
|
+
import main = require('bc-deeplib/src/deeplib');
|
|
537
|
+
export = main;
|
|
538
|
+
}
|