@scml/addon-mod-time-wrapper 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.
- package/README.md +9 -0
- package/package.json +33 -0
- package/type-dist/DoLTimeWrapperAddon.d.ts +25 -0
- package/type-dist/DoLTimeWrapperAddonPlugin.d.ts +28 -0
- package/type-dist/OldTimeFunctionHook.d.ts +53 -0
- package/type-dist/SC2DataManager-D7dvpJzz.d.ts +1514 -0
- package/type-dist/TimeProxyManager.d.ts +84 -0
- package/type-dist/global.ts +6 -0
- package/type-dist/init.d.ts +1 -0
- package/type-dist/winDef.d.ts +18 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@scml/addon-mod-time-wrapper",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "SugarCube 2 Mod Loader Workspace",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Rikka",
|
|
9
|
+
"email": "admin@rikka.cc",
|
|
10
|
+
"url": "https://github.com/Muromi-Rikka"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"type-dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"types": "./type-dist/global.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./OldTimeFunctionHook": "./type-dist/OldTimeFunctionHook.d.ts",
|
|
20
|
+
"./TimeProxyManager": "./type-dist/TimeProxyManager.d.ts",
|
|
21
|
+
"./DoLTimeWrapperAddonPlugin": "./type-dist/DoLTimeWrapperAddonPlugin.d.ts",
|
|
22
|
+
"./DoLTimeWrapperAddon": "./type-dist/DoLTimeWrapperAddon.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@scml/sc2-modloader": "1.0.0",
|
|
26
|
+
"@scml/utils": "1.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"download": "tsx src/download.ts",
|
|
30
|
+
"build": "tsdown && tsx src/after-build.ts",
|
|
31
|
+
"typecheck": "tsc --noEmit"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { n as ModUtils, t as SC2DataManager } from "./SC2DataManager-D7dvpJzz.js";
|
|
2
|
+
import { InfinityLoopChecker, TimeHookType } from "./TimeProxyManager.js";
|
|
3
|
+
import { OldTimeFunctionRefType } from "./OldTimeFunctionHook.js";
|
|
4
|
+
|
|
5
|
+
//#region remote/DoLTimeWrapperAddon.d.ts
|
|
6
|
+
declare class DoLTimeWrapperAddon {
|
|
7
|
+
gSC2DataManager: SC2DataManager;
|
|
8
|
+
gModUtils: ModUtils;
|
|
9
|
+
private logger;
|
|
10
|
+
private timeWrapperAddonPlugin;
|
|
11
|
+
infinityLoopChecker: InfinityLoopChecker;
|
|
12
|
+
constructor(gSC2DataManager: SC2DataManager, gModUtils: ModUtils);
|
|
13
|
+
addTimeHook(hook: TimeHookType): void;
|
|
14
|
+
addFunctionHook(hook: TimeHookType): void;
|
|
15
|
+
private _timeProxyManager;
|
|
16
|
+
get timeProxyManager(): TimeProxyManager;
|
|
17
|
+
private _timeHookManager;
|
|
18
|
+
get timeHookManager(): TimeHookManager;
|
|
19
|
+
private _isInit;
|
|
20
|
+
get isInit(): boolean;
|
|
21
|
+
makeCatchCode(): string;
|
|
22
|
+
init(oldTimeFunctionRef: OldTimeFunctionRefType): string | undefined;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DoLTimeWrapperAddon };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { a as ModInfo, n as ModUtils, o as ModZipReader, r as AddonPluginHookPointEx, t as SC2DataManager } from "./SC2DataManager-D7dvpJzz.js";
|
|
2
|
+
import { TimeHookType } from "./TimeProxyManager.js";
|
|
3
|
+
import { DoLTimeWrapperAddon } from "./DoLTimeWrapperAddon.js";
|
|
4
|
+
|
|
5
|
+
//#region remote/DoLTimeWrapperAddonPlugin.d.ts
|
|
6
|
+
interface DoLTimeWrapperParams {
|
|
7
|
+
level: 'LocalFunction' | 'TimeObject';
|
|
8
|
+
key: string;
|
|
9
|
+
pos: 'before' | 'after';
|
|
10
|
+
type: 'call' | 'get' | 'set';
|
|
11
|
+
js?: string;
|
|
12
|
+
wiki?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function checkParams(a: any): a is DoLTimeWrapperParams;
|
|
15
|
+
interface TimeHookTypeEx extends TimeHookType {
|
|
16
|
+
modName: string;
|
|
17
|
+
originParams: DoLTimeWrapperParams;
|
|
18
|
+
}
|
|
19
|
+
declare class DoLTimeWrapperAddonPlugin implements AddonPluginHookPointEx {
|
|
20
|
+
gSC2DataManager: SC2DataManager;
|
|
21
|
+
gModUtils: ModUtils;
|
|
22
|
+
timeWrapperAddon: DoLTimeWrapperAddon;
|
|
23
|
+
private logger;
|
|
24
|
+
constructor(gSC2DataManager: SC2DataManager, gModUtils: ModUtils, timeWrapperAddon: DoLTimeWrapperAddon);
|
|
25
|
+
registerMod(addonName: string, mod: ModInfo, modZip: ModZipReader): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DoLTimeWrapperAddonPlugin, DoLTimeWrapperParams, TimeHookTypeEx, checkParams };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { n as ModUtils, t as SC2DataManager } from "./SC2DataManager-D7dvpJzz.js";
|
|
2
|
+
import { HookManagerCore, InfinityLoopChecker, TimeHookType } from "./TimeProxyManager.js";
|
|
3
|
+
|
|
4
|
+
//#region remote/OldTimeFunctionHook.d.ts
|
|
5
|
+
interface OldTimeFunctionRefType {
|
|
6
|
+
yearPassed?: () => DocumentFragment;
|
|
7
|
+
weekPassed?: () => DocumentFragment;
|
|
8
|
+
dayPassed?: () => DocumentFragment;
|
|
9
|
+
hourPassed?: (hours: number) => DocumentFragment;
|
|
10
|
+
minutePassed?: (minutes: number) => DocumentFragment;
|
|
11
|
+
noonCheck?: () => DocumentFragment;
|
|
12
|
+
dawnCheck?: () => DocumentFragment;
|
|
13
|
+
dailyNPCEffects?: () => DocumentFragment;
|
|
14
|
+
dailyPlayerEffects?: () => DocumentFragment;
|
|
15
|
+
dailyTransformationEffects?: () => DocumentFragment;
|
|
16
|
+
dailyLiquidEffects?: () => DocumentFragment;
|
|
17
|
+
yearlyEventChecks?: () => DocumentFragment;
|
|
18
|
+
moonState?: () => DocumentFragment;
|
|
19
|
+
dailySchoolEffects?: () => DocumentFragment;
|
|
20
|
+
dailyMasochismSadismEffects?: () => DocumentFragment;
|
|
21
|
+
dailyFarmEvents?: () => DocumentFragment;
|
|
22
|
+
passWater?: (passMinutes: number) => DocumentFragment;
|
|
23
|
+
passArousalWetness?: (passMinutes: number) => DocumentFragment;
|
|
24
|
+
getArousal?: (passMinutes: number) => number;
|
|
25
|
+
earSlimeDaily?: () => void;
|
|
26
|
+
getTimeString?: (...args: any[]) => void;
|
|
27
|
+
passTime: (time?: number, type?: string) => DocumentFragment;
|
|
28
|
+
passTimeUntil: (hour: number, minute?: number) => DocumentFragment;
|
|
29
|
+
advanceToHour: () => DocumentFragment;
|
|
30
|
+
timeAfterXHours: (hours: number) => string;
|
|
31
|
+
ampm: (hour: number, minute: number) => string;
|
|
32
|
+
schoolTerm: () => string;
|
|
33
|
+
}
|
|
34
|
+
declare const OldTimeFunctionRefTypeNameList: (keyof OldTimeFunctionRefType)[];
|
|
35
|
+
type OldTimeFunctionArgsType = { [K in keyof OldTimeFunctionRefType]: OldTimeFunctionRefType[K] extends ((...args: infer A) => any) ? A : never };
|
|
36
|
+
type OldTimeFunctionReturnType = { [K in keyof OldTimeFunctionRefType]: OldTimeFunctionRefType[K] extends ((...args: any[]) => infer R) ? R : never };
|
|
37
|
+
type EnsureTuple<T> = T extends void ? [] : (T extends any[] ? T : [T]);
|
|
38
|
+
declare function isEmptyArray(value: any[]): value is [];
|
|
39
|
+
declare class TimeHookManager extends HookManagerCore {
|
|
40
|
+
thisWin: Window;
|
|
41
|
+
gModUtils: ModUtils;
|
|
42
|
+
gSC2DataManager: SC2DataManager;
|
|
43
|
+
infinityLoopChecker: InfinityLoopChecker;
|
|
44
|
+
oldTimeFunctionRef?: OldTimeFunctionRefType;
|
|
45
|
+
constructor(thisWin: Window, gModUtils: ModUtils, gSC2DataManager: SC2DataManager, infinityLoopChecker: InfinityLoopChecker);
|
|
46
|
+
addCallableHook(key: string, hook: TimeHookType): void;
|
|
47
|
+
invokeOldTimeFunctionRef<K extends keyof OldTimeFunctionRefType>(key: K, args: []): any;
|
|
48
|
+
invokeOldTimeFunctionRef<K extends keyof OldTimeFunctionRefType>(key: K, args: OldTimeFunctionArgsType[K]): any;
|
|
49
|
+
createWrapperForOldTimeFunctionRef<K extends keyof OldTimeFunctionRefType>(key: K): ((...args: any[]) => OldTimeFunctionReturnType[K]) | undefined;
|
|
50
|
+
init(oldTimeFunctionRef: OldTimeFunctionRefType): void;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { EnsureTuple, OldTimeFunctionArgsType, OldTimeFunctionRefType, OldTimeFunctionRefTypeNameList, OldTimeFunctionReturnType, TimeHookManager, isEmptyArray };
|