@scml-dol-maplebirch/types 5.0.4 → 5.1.1
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/compat/DoLPcompat.d.ts +55 -0
- package/compat/ModI18N.d.ts +10 -0
- package/compat/Prototype.d.ts +43 -0
- package/compat/SimpleFrameworks.d.ts +1 -0
- package/constants.d.ts +52 -0
- package/core.d.ts +143 -0
- package/host/DoL.d.ts +44 -0
- package/host/ModLoader.d.ts +37 -0
- package/host/Resources.d.ts +15 -0
- package/host/SugarCube.d.ts +25 -0
- package/index.d.ts +11 -30
- package/infra/Catalog.d.ts +14 -0
- package/infra/Diagnostics.d.ts +48 -0
- package/infra/Emitter.d.ts +18 -0
- package/infra/Hooks.d.ts +15 -0
- package/infra/Lifecycle.d.ts +24 -0
- package/infra/Logger.d.ts +15 -0
- package/macros/helpers.d.ts +54 -0
- package/macros/index.d.ts +8 -0
- package/macros/lanButton.d.ts +2 -0
- package/macros/lanLink.d.ts +2 -0
- package/macros/lanListbox.d.ts +2 -0
- package/macros/lanSwitch.d.ts +3 -0
- package/macros/language.d.ts +2 -0
- package/macros/macros.d.ts +14 -0
- package/macros/maplebirchReplace.d.ts +1 -0
- package/macros/radiobuttonsfrom.d.ts +2 -0
- package/main.d.ts +22 -0
- package/maplebirch.d.ts +11 -4439
- package/modules/Audio.d.ts +118 -0
- package/modules/AudioAddon/Ambience.d.ts +17 -0
- package/modules/AudioAddon/AudioBufferPlayer.d.ts +20 -0
- package/modules/AudioAddon/Playlist.d.ts +29 -0
- package/modules/AudioAddon/Track.d.ts +15 -0
- package/modules/Character.d.ts +39 -0
- package/modules/CharacterAddon/Pet.d.ts +61 -0
- package/modules/CharacterAddon/Transformation.d.ts +70 -0
- package/modules/CharacterAddon/TransformationConfig.d.ts +20 -0
- package/modules/Combat.d.ts +17 -0
- package/modules/CombatAddon/CombatAction.d.ts +63 -0
- package/modules/CombatAddon/CombatTypes.d.ts +4 -0
- package/modules/DoL/Config.d.ts +50 -0
- package/modules/DoL/Dynamic.d.ts +23 -0
- package/modules/DoL/Integration.d.ts +13 -0
- package/modules/DoL/Patches/Antiques.d.ts +17 -0
- package/modules/DoL/Patches/Bodywriting.d.ts +33 -0
- package/modules/DoL/Patches/Fishing.d.ts +32 -0
- package/modules/DoL/Patches/Foodstuff.d.ts +64 -0
- package/modules/DoL/Patches/Location.d.ts +36 -0
- package/modules/DoL/Patches/Tips.d.ts +7 -0
- package/modules/DoL/Patches/Traits.d.ts +24 -0
- package/modules/DoL/Patches/config.d.ts +2 -0
- package/modules/DoL/Patches/index.d.ts +86 -0
- package/modules/DoL/Replacements.d.ts +189 -0
- package/modules/DoL/ToolCollection.d.ts +17 -0
- package/modules/DoL/index.d.ts +1 -0
- package/modules/DoL/types.d.ts +20 -0
- package/modules/Dynamic.d.ts +10 -0
- package/modules/Event.d.ts +16 -0
- package/modules/Frameworks/ApplyLinkZone.d.ts +40 -0
- package/modules/Frameworks/ConsoleCheat.d.ts +43 -0
- package/modules/Frameworks/DoLConsole.d.ts +8 -0
- package/modules/Frameworks/DoLMacros.d.ts +6 -0
- package/modules/Frameworks/HtmlTools.d.ts +49 -0
- package/modules/Frameworks/ImageLoader.d.ts +6 -0
- package/modules/Frameworks/OptionEvents.d.ts +15 -0
- package/modules/Frameworks/Patch.d.ts +24 -0
- package/modules/Frameworks/RandSystem.d.ts +27 -0
- package/modules/Frameworks/TextStore.d.ts +7 -0
- package/modules/Frameworks/TimeTravelCheat.d.ts +17 -0
- package/modules/Frameworks/ZonesManager.d.ts +69 -0
- package/modules/Frameworks/macros.d.ts +27 -0
- package/modules/Frameworks/migration.d.ts +33 -0
- package/modules/NamedNPC.d.ts +164 -0
- package/modules/NamedNPCAddon/NPCClothes/Condition.d.ts +3 -0
- package/modules/NamedNPCAddon/NPCClothes/NPCOutfitSets.d.ts +38 -0
- package/modules/NamedNPCAddon/NPCClothes/NPCSidebarArt.d.ts +25 -0
- package/modules/NamedNPCAddon/NPCClothes/NPCSidebarWardrobe.d.ts +60 -0
- package/modules/NamedNPCAddon/NPCClothes.d.ts +12 -0
- package/modules/NamedNPCAddon/NPCFluids.d.ts +17 -0
- package/modules/NamedNPCAddon/NPCPregnancy.d.ts +127 -0
- package/modules/NamedNPCAddon/NPCSchedules.d.ts +77 -0
- package/modules/NamedNPCAddon/NPCSidebar.d.ts +28 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/base_layers.d.ts +212 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/face_layers.d.ts +220 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/feet_layers.d.ts +274 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/fluids_layers.d.ts +109 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/functions.d.ts +509 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/handheld_layers.d.ts +292 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/hands_layers.d.ts +381 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/head_layers.d.ts +490 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/legs_layers.d.ts +274 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/lower_layers.d.ts +800 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/neck_layers.d.ts +112 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/transformation_layers.d.ts +1672 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/types.d.ts +130 -0
- package/modules/NamedNPCAddon/NPCSidebarConfig/upper_layers.d.ts +1516 -0
- package/modules/NamedNPCAddon/NPCTransformation.d.ts +51 -0
- package/modules/NamedNPCAddon/NPCUtils.d.ts +8 -0
- package/modules/State.d.ts +46 -0
- package/modules/TimeStateWeather/DateTime.d.ts +4 -0
- package/modules/TimeStateWeather/Time.d.ts +14 -0
- package/modules/TimeStateWeather/TimeEvents.d.ts +130 -0
- package/modules/TimeStateWeather/WeatherEvents.d.ts +56 -0
- package/modules/ToolCollection.d.ts +33 -0
- package/modules/Variables.d.ts +32 -0
- package/package.d.ts +30 -0
- package/package.json +5 -7
- package/services/AddonPlugin.d.ts +92 -0
- package/services/CloudSave.d.ts +124 -0
- package/services/CredentialVault.d.ts +80 -0
- package/services/GUIControl.d.ts +54 -0
- package/services/IndexedDB.d.ts +28 -0
- package/services/Modules.d.ts +75 -0
- package/services/Translator.d.ts +60 -0
- package/types/global.d.ts +123 -0
- package/types/twine-sugarcube.d.ts +456 -0
- package/utils/array.d.ts +10 -0
- package/utils/binary.d.ts +8 -0
- package/utils/condition.d.ts +1 -0
- package/utils/index.d.ts +22 -0
- package/utils/object.d.ts +16 -0
- package/utils/selector.d.ts +20 -0
- package/utils/string.d.ts +8 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type ModLoader from '../host/ModLoader.js';
|
|
2
|
+
import Diagnostics from '../infra/Diagnostics.js';
|
|
3
|
+
import type Emitter from '../infra/Emitter.js';
|
|
4
|
+
import type IndexedDB from './IndexedDB.js';
|
|
5
|
+
import type { InputFileFormat } from '@scml/types/sugarcube-2-ModLoader/JSZipLikeReadOnlyInterface';
|
|
6
|
+
export type CredentialPeriod = 'day' | 'month';
|
|
7
|
+
export interface AuthConfig {
|
|
8
|
+
key: string;
|
|
9
|
+
subject?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
publicKey: JsonWebKey | string;
|
|
12
|
+
prompt?: {
|
|
13
|
+
title?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
hint?: string;
|
|
17
|
+
};
|
|
18
|
+
date?: {
|
|
19
|
+
period?: CredentialPeriod;
|
|
20
|
+
timezone?: string;
|
|
21
|
+
graceDays?: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface AuthPayload {
|
|
25
|
+
subject: string;
|
|
26
|
+
key: string;
|
|
27
|
+
date?: string;
|
|
28
|
+
password: string;
|
|
29
|
+
expiresAt?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface CryptContext {
|
|
32
|
+
modName: string;
|
|
33
|
+
credential?: string;
|
|
34
|
+
payload?: AuthPayload;
|
|
35
|
+
}
|
|
36
|
+
export interface CryptResult {
|
|
37
|
+
data: Awaited<InputFileFormat>;
|
|
38
|
+
auth?: AuthConfig | boolean | void;
|
|
39
|
+
}
|
|
40
|
+
export interface CryptOptions {
|
|
41
|
+
modName?: string;
|
|
42
|
+
cache?: {
|
|
43
|
+
subject: string;
|
|
44
|
+
key: string;
|
|
45
|
+
};
|
|
46
|
+
password?: string;
|
|
47
|
+
prompt?: AuthConfig['prompt'] & {
|
|
48
|
+
name?: string;
|
|
49
|
+
};
|
|
50
|
+
lazyOptions?: unknown;
|
|
51
|
+
decrypt(password: string, context: CryptContext): Promise<CryptResult | Awaited<InputFileFormat>>;
|
|
52
|
+
}
|
|
53
|
+
export declare class CredentialVault {
|
|
54
|
+
readonly idb: IndexedDB;
|
|
55
|
+
readonly modloader: ModLoader;
|
|
56
|
+
readonly events: Emitter;
|
|
57
|
+
readonly diagnostics: Diagnostics;
|
|
58
|
+
readonly translate: (key: string) => string;
|
|
59
|
+
private static readonly STORE;
|
|
60
|
+
private static readonly TOKEN_PREFIX;
|
|
61
|
+
private dialogQueue;
|
|
62
|
+
private storageKey;
|
|
63
|
+
constructor(idb: IndexedDB, modloader: ModLoader, events: Emitter, diagnostics: Diagnostics, translate: (key: string) => string);
|
|
64
|
+
loadCrypt(options: CryptOptions): Promise<boolean>;
|
|
65
|
+
private loadCredential;
|
|
66
|
+
private decryptAndLoad;
|
|
67
|
+
private decodeCredential;
|
|
68
|
+
private verify;
|
|
69
|
+
private credentialDate;
|
|
70
|
+
private readStored;
|
|
71
|
+
private storeStored;
|
|
72
|
+
private forget;
|
|
73
|
+
private ensurePromptStyle;
|
|
74
|
+
private promptCredential;
|
|
75
|
+
private ensureStorageKey;
|
|
76
|
+
private loadStorageKey;
|
|
77
|
+
private encryptRecord;
|
|
78
|
+
private decryptRecord;
|
|
79
|
+
}
|
|
80
|
+
export default CredentialVault;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type ModLoader from '../host/ModLoader.js';
|
|
2
|
+
import type Emitter from '../infra/Emitter.js';
|
|
3
|
+
import type IndexedDB from './IndexedDB.js';
|
|
4
|
+
import Modules from './Modules.js';
|
|
5
|
+
import type Translator from './Translator.js';
|
|
6
|
+
type ModuleType = 'protected' | 'mounted' | 'exposed' | 'module';
|
|
7
|
+
interface ModuleInfo {
|
|
8
|
+
name: string;
|
|
9
|
+
type: ModuleType;
|
|
10
|
+
source: string;
|
|
11
|
+
protected: boolean;
|
|
12
|
+
lifecycle: boolean;
|
|
13
|
+
dependencies: string[];
|
|
14
|
+
}
|
|
15
|
+
interface ModulesSettings {
|
|
16
|
+
enabled: ModuleInfo[];
|
|
17
|
+
disabled: ModuleInfo[];
|
|
18
|
+
}
|
|
19
|
+
interface ScriptSource {
|
|
20
|
+
jsFiles: Array<{
|
|
21
|
+
modName: string;
|
|
22
|
+
filePath: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export declare class GUIControl {
|
|
26
|
+
readonly idb: IndexedDB;
|
|
27
|
+
readonly modloader: ModLoader;
|
|
28
|
+
readonly events: Emitter;
|
|
29
|
+
readonly modules: Modules;
|
|
30
|
+
readonly translator: Translator;
|
|
31
|
+
private readonly addon;
|
|
32
|
+
enabledModules: ModuleInfo[];
|
|
33
|
+
disabledModules: ModuleInfo[];
|
|
34
|
+
enabledScripts: string[];
|
|
35
|
+
disabledScripts: string[];
|
|
36
|
+
private modSubUiAngularJsService;
|
|
37
|
+
constructor(idb: IndexedDB, modloader: ModLoader, events: Emitter, modules: Modules, translator: Translator, addon: () => ScriptSource | undefined);
|
|
38
|
+
private initSettings;
|
|
39
|
+
init(): Promise<void>;
|
|
40
|
+
private loadSettings;
|
|
41
|
+
private modNames;
|
|
42
|
+
private currentModules;
|
|
43
|
+
typeLabel(type: ModuleType): string;
|
|
44
|
+
private modulesStore;
|
|
45
|
+
private scriptsStore;
|
|
46
|
+
saveModules(enabled: ModuleInfo[], disabled: ModuleInfo[]): Promise<void>;
|
|
47
|
+
setModuleStates(states: Readonly<Record<string, boolean>>): Promise<boolean>;
|
|
48
|
+
saveScripts(enabled: string[], disabled: string[]): Promise<void>;
|
|
49
|
+
cascadeModules(action: 'enable' | 'disable', moduleName: string, modules: ModulesSettings): string[];
|
|
50
|
+
private moduleLinks;
|
|
51
|
+
get moduleList(): string;
|
|
52
|
+
private whenCreate;
|
|
53
|
+
}
|
|
54
|
+
export default GUIControl;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type IDBPTransaction } from 'idb';
|
|
2
|
+
import Catalog from '../infra/Catalog.js';
|
|
3
|
+
import type ModLoader from '../host/ModLoader.js';
|
|
4
|
+
export interface StoreIndex {
|
|
5
|
+
name: string;
|
|
6
|
+
keyPath: string | string[];
|
|
7
|
+
options?: IDBIndexParameters;
|
|
8
|
+
}
|
|
9
|
+
interface StoreDefinition {
|
|
10
|
+
options: IDBObjectStoreParameters;
|
|
11
|
+
indexes: StoreIndex[];
|
|
12
|
+
}
|
|
13
|
+
export type Transaction<Mode extends IDBTransactionMode = IDBTransactionMode> = IDBPTransaction<unknown, string[], Mode>;
|
|
14
|
+
export declare class IndexedDB extends Catalog<string, StoreDefinition> {
|
|
15
|
+
static readonly DATABASE_NAME = "maplebirch";
|
|
16
|
+
static readonly DATABASE_VERSION: number;
|
|
17
|
+
private db;
|
|
18
|
+
private opening;
|
|
19
|
+
constructor(modloader?: ModLoader);
|
|
20
|
+
define(name: string, options?: IDBObjectStoreParameters, indexes?: StoreIndex[]): boolean;
|
|
21
|
+
loadLogLevel(): Promise<string | boolean | undefined>;
|
|
22
|
+
init(): Promise<void>;
|
|
23
|
+
private open;
|
|
24
|
+
with<T, Mode extends IDBTransactionMode>(storeNames: string | string[], mode: Mode, callback: (tx: Transaction<Mode>) => T | Promise<T>): Promise<T>;
|
|
25
|
+
clearStore(storeName: string): Promise<void>;
|
|
26
|
+
deleteDatabase(): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
export default IndexedDB;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ModuleState } from '../constants.js';
|
|
2
|
+
import type ModLoader from '../host/ModLoader.js';
|
|
3
|
+
import { type ScopedLog } from '../infra/Diagnostics.js';
|
|
4
|
+
import Lifecycle from '../infra/Lifecycle.js';
|
|
5
|
+
import type IndexedDB from './IndexedDB.js';
|
|
6
|
+
export interface Module {
|
|
7
|
+
log?: ScopedLog;
|
|
8
|
+
dependencies?: string[];
|
|
9
|
+
exposed?: boolean | 'window';
|
|
10
|
+
preInit?(): void | Promise<void>;
|
|
11
|
+
Init?(): void;
|
|
12
|
+
loadInit?(): void;
|
|
13
|
+
postInit?(): void;
|
|
14
|
+
}
|
|
15
|
+
interface ModuleRegistry {
|
|
16
|
+
modules: Map<string, Module>;
|
|
17
|
+
states: Map<string, ModuleState>;
|
|
18
|
+
sources: Map<string, string>;
|
|
19
|
+
dependencies: Map<string, Set<string>>;
|
|
20
|
+
dependents: Map<string, Set<string>>;
|
|
21
|
+
}
|
|
22
|
+
export interface DependencyInfo {
|
|
23
|
+
protected: boolean;
|
|
24
|
+
mounted: boolean;
|
|
25
|
+
exposed: boolean;
|
|
26
|
+
lifecycle: boolean;
|
|
27
|
+
dependencies: string[];
|
|
28
|
+
dependents: string[];
|
|
29
|
+
allDependencies: string[];
|
|
30
|
+
state: string;
|
|
31
|
+
source: string;
|
|
32
|
+
}
|
|
33
|
+
export type DependencyGraph = Record<string, DependencyInfo>;
|
|
34
|
+
export interface ModulesMeta {
|
|
35
|
+
core: readonly string[];
|
|
36
|
+
protected: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
export declare class Modules extends Lifecycle<string, Module> {
|
|
39
|
+
readonly owner: Record<string, unknown>;
|
|
40
|
+
readonly meta: ModulesMeta;
|
|
41
|
+
readonly idb: IndexedDB;
|
|
42
|
+
readonly registry: ModuleRegistry;
|
|
43
|
+
readonly initPhase: {
|
|
44
|
+
preInitCompleted: boolean;
|
|
45
|
+
mainInitCompleted: boolean;
|
|
46
|
+
};
|
|
47
|
+
private readonly sourceStack;
|
|
48
|
+
private readonly preInitialized;
|
|
49
|
+
private disabledNames;
|
|
50
|
+
private preInitTask;
|
|
51
|
+
private late;
|
|
52
|
+
private preRunning;
|
|
53
|
+
private preQueued;
|
|
54
|
+
constructor(owner: Record<string, unknown>, meta: ModulesMeta, idb: IndexedDB, modloader?: ModLoader);
|
|
55
|
+
static traverse(roots: Iterable<string>, links: ReadonlyMap<string, Iterable<string>>, excluded?: ReadonlySet<string>): Set<string>;
|
|
56
|
+
with<T>(source: string, callback: () => T | Promise<T>): Promise<T>;
|
|
57
|
+
register<T extends object>(name: string, module: T & Module, dependencies?: string[]): boolean;
|
|
58
|
+
get(name: string): Module | undefined;
|
|
59
|
+
get dependencyGraph(): DependencyGraph;
|
|
60
|
+
run(phase: 'pre'): Promise<void>;
|
|
61
|
+
run(phase: 'init' | 'load' | 'post'): void;
|
|
62
|
+
private prepare;
|
|
63
|
+
private queuePre;
|
|
64
|
+
private disable;
|
|
65
|
+
private pre;
|
|
66
|
+
private init;
|
|
67
|
+
private phase;
|
|
68
|
+
private ready;
|
|
69
|
+
private flush;
|
|
70
|
+
private topologicalOrder;
|
|
71
|
+
private collect;
|
|
72
|
+
private circular;
|
|
73
|
+
private hasLifecycle;
|
|
74
|
+
}
|
|
75
|
+
export default Modules;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type LanguageCode } from '../constants.js';
|
|
2
|
+
import type ModLoader from '../host/ModLoader.js';
|
|
3
|
+
import Catalog from '../infra/Catalog.js';
|
|
4
|
+
import type Emitter from '../infra/Emitter.js';
|
|
5
|
+
import type IndexedDB from './IndexedDB.js';
|
|
6
|
+
export type Translation = Record<string, string>;
|
|
7
|
+
interface ImportProgress {
|
|
8
|
+
type: 'process' | 'complete' | 'error' | 'not_found';
|
|
9
|
+
language: LanguageCode;
|
|
10
|
+
progress?: number;
|
|
11
|
+
current?: number;
|
|
12
|
+
total?: number;
|
|
13
|
+
count?: number;
|
|
14
|
+
error?: Error | null;
|
|
15
|
+
}
|
|
16
|
+
interface TranslationAddon {
|
|
17
|
+
hook<T>(name: string, handler: (task: {
|
|
18
|
+
modName: string;
|
|
19
|
+
config: T;
|
|
20
|
+
}) => void | Promise<void>): boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare class Translator extends Catalog<string, Translation> {
|
|
23
|
+
readonly idb: IndexedDB;
|
|
24
|
+
readonly events: Emitter;
|
|
25
|
+
private readonly addon;
|
|
26
|
+
static readonly DEFAULT_LANGS: readonly LanguageCode[];
|
|
27
|
+
static readonly BATCH_SIZE = 500;
|
|
28
|
+
language: LanguageCode;
|
|
29
|
+
private readonly STORE;
|
|
30
|
+
private readonly cache;
|
|
31
|
+
private readonly sourceOrders;
|
|
32
|
+
private preloaded;
|
|
33
|
+
constructor(idb: IndexedDB, modloader: ModLoader, events: Emitter, addon: () => TranslationAddon | undefined);
|
|
34
|
+
private initDB;
|
|
35
|
+
setLanguage(language?: string): Promise<LanguageCode>;
|
|
36
|
+
import(modName: string, languages?: readonly LanguageCode[]): AsyncGenerator<ImportProgress>;
|
|
37
|
+
importFile(modName: string, language: LanguageCode, paths: string | readonly string[]): AsyncGenerator<ImportProgress>;
|
|
38
|
+
t(translationKey: string, space?: boolean): string;
|
|
39
|
+
auto(text: string): string;
|
|
40
|
+
has(translationKey: string): boolean;
|
|
41
|
+
set(translationKey: string, translations: Record<string, unknown>): boolean;
|
|
42
|
+
preload(): Promise<void>;
|
|
43
|
+
clearStorage(): Promise<void>;
|
|
44
|
+
private loadBundledTranslations;
|
|
45
|
+
private writeTranslations;
|
|
46
|
+
private writeBatch;
|
|
47
|
+
private removeOldTranslations;
|
|
48
|
+
private updateSource;
|
|
49
|
+
private activeSources;
|
|
50
|
+
private visibleTranslations;
|
|
51
|
+
private syncTranslation;
|
|
52
|
+
private readFileRecord;
|
|
53
|
+
private writeFileRecord;
|
|
54
|
+
private loadTranslation;
|
|
55
|
+
private parseTranslations;
|
|
56
|
+
private computeHash;
|
|
57
|
+
private getModFile;
|
|
58
|
+
private rebuild;
|
|
59
|
+
}
|
|
60
|
+
export default Translator;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { LinksAPI } from '@scml/sc2-verlnir/src/links';
|
|
2
|
+
import { SC2DataManager } from '@scml/types/sugarcube-2-ModLoader/SC2DataManager';
|
|
3
|
+
import { GameOriginalImagePack } from '@scml/types/GameOriginalImagePackMod/GameOriginalImagePack';
|
|
4
|
+
import { BeautySelectorAddon } from '@scml/types/AddonMod_BeautySelector/BeautySelectorAddon';
|
|
5
|
+
import { ImgLoaderHooker } from '@scml/types/Hook_ImgLoader/ImgLoaderHooker';
|
|
6
|
+
import { Gui } from '@scml/types/Mod_LoaderGui/Gui';
|
|
7
|
+
import { ModUtils } from '@scml/types/sugarcube-2-ModLoader/Utils';
|
|
8
|
+
import { _languageSwitch } from '../macros/index.js';
|
|
9
|
+
import ImageLoader from '../modules/Frameworks/ImageLoader.js';
|
|
10
|
+
import type { ActionType, ActionValue } from '../modules/CombatAddon/CombatAction.js';
|
|
11
|
+
import type { NPCChildRecord, NPCPregnancyOrifice, NPCPregnancyRecord, NPCPregnancySpecies, NPCTryConceiveOptions } from '../modules/NamedNPCAddon/NPCPregnancy.js';
|
|
12
|
+
declare global {
|
|
13
|
+
interface Window {
|
|
14
|
+
modSC2DataManager: SC2DataManager;
|
|
15
|
+
modGameOriginalImagePack: GameOriginalImagePack;
|
|
16
|
+
modImgLoaderHooker: ImgLoaderHooker;
|
|
17
|
+
modLoaderGui: Gui;
|
|
18
|
+
modUtils: ModUtils;
|
|
19
|
+
addonBeautySelectorAddon: BeautySelectorAddon;
|
|
20
|
+
readonly Time: typeof Time;
|
|
21
|
+
DateTime: typeof DateTime;
|
|
22
|
+
closeOverlay(): void;
|
|
23
|
+
updateOptions(): void;
|
|
24
|
+
lanSwitch: typeof _languageSwitch;
|
|
25
|
+
readonly loadImage: typeof ImageLoader.load;
|
|
26
|
+
readonly V: typeof V;
|
|
27
|
+
readonly C: typeof C;
|
|
28
|
+
readonly T: typeof T;
|
|
29
|
+
DefaultActions: {
|
|
30
|
+
get(type: unknown, person: unknown, part: ActionType): ActionValue[];
|
|
31
|
+
};
|
|
32
|
+
pregnancyDaysEta: typeof pregnancyDaysEta;
|
|
33
|
+
getChildDays: typeof getChildDays;
|
|
34
|
+
}
|
|
35
|
+
const lanSwitch: typeof _languageSwitch;
|
|
36
|
+
const Links: LinksAPI;
|
|
37
|
+
const StartConfig: {
|
|
38
|
+
version: string;
|
|
39
|
+
};
|
|
40
|
+
interface ErrorsConfig {
|
|
41
|
+
debug: boolean;
|
|
42
|
+
maxLogs: number;
|
|
43
|
+
showReporterSelector: string;
|
|
44
|
+
}
|
|
45
|
+
interface ErrorLogEntry {
|
|
46
|
+
message: string;
|
|
47
|
+
copyData?: unknown;
|
|
48
|
+
}
|
|
49
|
+
interface ErrorsReporter {
|
|
50
|
+
visible(): boolean;
|
|
51
|
+
reporterContainer(): HTMLElement;
|
|
52
|
+
messagesContainer(): HTMLElement;
|
|
53
|
+
paneContainer(): HTMLElement;
|
|
54
|
+
copyArea(): HTMLTextAreaElement;
|
|
55
|
+
toggle(): void;
|
|
56
|
+
show(): void;
|
|
57
|
+
update(): void;
|
|
58
|
+
hide(andClear?: boolean): void;
|
|
59
|
+
createEntry(error: ErrorLogEntry): HTMLElement;
|
|
60
|
+
copyAll(): void;
|
|
61
|
+
}
|
|
62
|
+
interface Errors {
|
|
63
|
+
config: ErrorsConfig;
|
|
64
|
+
log: ErrorLogEntry[];
|
|
65
|
+
registerMessage(message: string, copyData?: unknown, noClone?: boolean): ErrorLogEntry;
|
|
66
|
+
report(message: string, copyData?: unknown, noClone?: boolean): void;
|
|
67
|
+
Reporter: ErrorsReporter;
|
|
68
|
+
}
|
|
69
|
+
const Errors: Errors;
|
|
70
|
+
const Weather: {
|
|
71
|
+
rain: boolean;
|
|
72
|
+
thunder: boolean;
|
|
73
|
+
snow: boolean;
|
|
74
|
+
cloud: boolean;
|
|
75
|
+
windy: boolean;
|
|
76
|
+
fog: boolean;
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
};
|
|
79
|
+
function getFormattedDate(date: any, includeWeekday?: boolean): string;
|
|
80
|
+
function getShortFormattedDate(date: any): string;
|
|
81
|
+
function ordinalSuffixOf(i: number): string;
|
|
82
|
+
const Dynamic: {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
};
|
|
85
|
+
function hairLengthStringToNumber(lengthStr: string): number;
|
|
86
|
+
const Renderer: {
|
|
87
|
+
CanvasModels: {
|
|
88
|
+
main: any;
|
|
89
|
+
};
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
};
|
|
92
|
+
const ZIndices: {
|
|
93
|
+
[key: string]: number;
|
|
94
|
+
};
|
|
95
|
+
function wikifier(widget: string, ...args: any): DocumentFragment;
|
|
96
|
+
function playerNormalPregnancyType(): string;
|
|
97
|
+
function getActivePregnancies(carrier: string): NPCPregnancyRecord[];
|
|
98
|
+
function getChildrenOf(pregnancyId: number): NPCChildRecord[];
|
|
99
|
+
function pregnancyProgress(record: NPCPregnancyRecord): number;
|
|
100
|
+
function getDueDate(record: NPCPregnancyRecord): number;
|
|
101
|
+
function npcMenstrualFertility(npcName: string): number;
|
|
102
|
+
function npcBellySize(npcName: string): number;
|
|
103
|
+
function pregnancyDaysEta(record: NPCPregnancyRecord): number;
|
|
104
|
+
function pregnancyDaysEta(record: null | undefined): null;
|
|
105
|
+
function getChildDays(childId: number): number;
|
|
106
|
+
function setKnowsPregnancy(pregnancyId: number, who: string): void;
|
|
107
|
+
function setKnowsDonor(pregnancyId: number, who: string): void;
|
|
108
|
+
function npcPregnancyRoll(carrier: string, carrierSpecies: NPCPregnancySpecies, donor: string, donorSpecies: NPCPregnancySpecies, orifice: NPCPregnancyOrifice, depth?: NPCTryConceiveOptions['depth'], location?: string, donorFertility?: number, slot?: number | null): number | null;
|
|
109
|
+
function hasSexStat(input: string, required: number, modifiers?: boolean): boolean;
|
|
110
|
+
function clothesIndex(slot: string, itemToIndex: object): number;
|
|
111
|
+
function integrityKeyword(worn: object, slot: string): string;
|
|
112
|
+
function between(value: number, min: number, max: number): boolean;
|
|
113
|
+
let isPossibleLoveInterest: (name: string) => boolean;
|
|
114
|
+
let combatListColor: (name: any, value: any, type?: any) => any;
|
|
115
|
+
const combatActionColours: CombatActionColours;
|
|
116
|
+
function gwylanSchedule(): string;
|
|
117
|
+
interface CombatActionColours {
|
|
118
|
+
[category: string]: {
|
|
119
|
+
[attitude: string]: string[];
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export {};
|