@scml-dol-maplebirch/types 4.3.3 → 4.3.5
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/maplebirch.d.ts +68 -16
- package/package.json +1 -1
package/maplebirch.d.ts
CHANGED
|
@@ -2490,15 +2490,41 @@ interface PetOptions {
|
|
|
2490
2490
|
scale?: number;
|
|
2491
2491
|
}
|
|
2492
2492
|
type PetTarget = string | HTMLElement;
|
|
2493
|
-
|
|
2493
|
+
interface PetHost {
|
|
2494
|
+
mask(x?: number, rotation?: number): string;
|
|
2495
|
+
}
|
|
2496
|
+
interface FloatingPetConfig {
|
|
2497
|
+
elementId: string;
|
|
2498
|
+
storageKey: string;
|
|
2499
|
+
className: string;
|
|
2500
|
+
fallback(size: number): {
|
|
2501
|
+
left: number;
|
|
2502
|
+
top: number;
|
|
2503
|
+
};
|
|
2504
|
+
}
|
|
2505
|
+
declare abstract class FloatingPet {
|
|
2506
|
+
protected readonly host: PetHost;
|
|
2507
|
+
protected readonly petConfig: FloatingPetConfig;
|
|
2508
|
+
protected canvas?: HTMLCanvasElement;
|
|
2509
|
+
protected model?: CanvasModel;
|
|
2510
|
+
protected container?: HTMLElement;
|
|
2511
|
+
protected options: Required<PetOptions>;
|
|
2512
|
+
private cleanupDrag?;
|
|
2513
|
+
protected constructor(host: PetHost, petConfig: FloatingPetConfig);
|
|
2514
|
+
configure(options?: PetOptions): this;
|
|
2515
|
+
unmount(): void;
|
|
2516
|
+
refresh(): boolean;
|
|
2517
|
+
protected abstract draw(model: CanvasModel, context: CanvasRenderingContext2D): void;
|
|
2518
|
+
protected mount(container: HTMLElement, model: CanvasModel, canvas: HTMLCanvasElement): void;
|
|
2519
|
+
protected stopAnimation(): void;
|
|
2520
|
+
private get displaySize();
|
|
2521
|
+
private clearBox;
|
|
2522
|
+
private enableDrag;
|
|
2523
|
+
}
|
|
2524
|
+
declare class Pet extends FloatingPet {
|
|
2494
2525
|
private manager;
|
|
2495
2526
|
readonly modelName: string;
|
|
2496
|
-
private canvas?;
|
|
2497
|
-
private model?;
|
|
2498
|
-
private container?;
|
|
2499
|
-
private options;
|
|
2500
2527
|
private readonly layers;
|
|
2501
|
-
private cleanupDrag?;
|
|
2502
2528
|
private syncing;
|
|
2503
2529
|
private rendering;
|
|
2504
2530
|
private syncFrame;
|
|
@@ -2508,15 +2534,9 @@ declare class Pet {
|
|
|
2508
2534
|
capture(mainModel?: CanvasModelOptions): void;
|
|
2509
2535
|
render(target: PetTarget, options?: PetOptions): boolean;
|
|
2510
2536
|
unmount(): void;
|
|
2511
|
-
refresh(): boolean;
|
|
2512
|
-
configure(options?: PetOptions): this;
|
|
2513
2537
|
private cancel;
|
|
2514
|
-
private get displaySize();
|
|
2515
2538
|
private readSettings;
|
|
2516
|
-
|
|
2517
|
-
private clearBox;
|
|
2518
|
-
private enableDrag;
|
|
2519
|
-
private stopAnimation;
|
|
2539
|
+
protected draw(model: CanvasModel, context: CanvasRenderingContext2D): void;
|
|
2520
2540
|
}
|
|
2521
2541
|
//#endregion
|
|
2522
2542
|
//#region src/modules/CharacterAddon/TransformationConfig.d.ts
|
|
@@ -2777,10 +2797,20 @@ type Condition = boolean | string | (() => boolean) | Condition[];
|
|
|
2777
2797
|
interface WardrobeItem {
|
|
2778
2798
|
[part: string]: any;
|
|
2779
2799
|
}
|
|
2800
|
+
type WardrobeWetness = 'dry' | 'damp' | 'wet' | 'soaked';
|
|
2801
|
+
type WardrobeWetnessResolver = WardrobeWetness | (() => WardrobeWetness);
|
|
2802
|
+
interface WardrobeWearOptions {
|
|
2803
|
+
when?: Condition;
|
|
2804
|
+
wetness?: WardrobeWetnessResolver;
|
|
2805
|
+
}
|
|
2806
|
+
type WardrobeWeightedChoice = readonly [key: string, weight: number];
|
|
2807
|
+
type WardrobeChoice = string | readonly WardrobeWeightedChoice[];
|
|
2808
|
+
type WardrobeLayerResolver = string | (() => string);
|
|
2780
2809
|
interface WardrobeContext {
|
|
2781
2810
|
npcName: string;
|
|
2782
2811
|
location: string;
|
|
2783
2812
|
key: string;
|
|
2813
|
+
wetness: WardrobeWetness;
|
|
2784
2814
|
}
|
|
2785
2815
|
type WardrobeModifier = (clothes: WardrobeItem, context: WardrobeContext) => void;
|
|
2786
2816
|
declare class NPCSidebarWardrobe {
|
|
@@ -2790,15 +2820,26 @@ declare class NPCSidebarWardrobe {
|
|
|
2790
2820
|
constructor(manager: NPCManager);
|
|
2791
2821
|
init(): void;
|
|
2792
2822
|
load(modName: string, filePath: string): Promise<void>;
|
|
2793
|
-
|
|
2823
|
+
get(key: string): WardrobeItem | undefined;
|
|
2824
|
+
set(key: string, template: WardrobeItem): void;
|
|
2825
|
+
has(key: string): boolean;
|
|
2826
|
+
wear(npcName: string, location: string | readonly string[], choice: WardrobeChoice, options?: Condition | WardrobeWearOptions): void;
|
|
2827
|
+
wet(npcName: string, wetness: WardrobeWetnessResolver, cond?: Condition): void;
|
|
2828
|
+
layer(npcName: string, source: WardrobeLayerResolver, cond?: Condition): void;
|
|
2829
|
+
put(clothes: WardrobeItem, key: string): void;
|
|
2830
|
+
strip(clothes: WardrobeItem, slot: string | readonly string[]): void;
|
|
2794
2831
|
base(npcName: string, modifier: WardrobeModifier): void;
|
|
2795
2832
|
modify(npcName: string, modifier: WardrobeModifier): void;
|
|
2796
2833
|
worn(npcName: string): WardrobeItem;
|
|
2797
|
-
private
|
|
2834
|
+
private run;
|
|
2798
2835
|
private add;
|
|
2799
|
-
private
|
|
2836
|
+
private merge;
|
|
2800
2837
|
private select;
|
|
2801
2838
|
private find;
|
|
2839
|
+
private choose;
|
|
2840
|
+
private findWet;
|
|
2841
|
+
private resolveWet;
|
|
2842
|
+
private applyWet;
|
|
2802
2843
|
private profile;
|
|
2803
2844
|
private location;
|
|
2804
2845
|
}
|
|
@@ -2820,8 +2861,18 @@ interface NPCSidebarBootConfig {
|
|
|
2820
2861
|
}
|
|
2821
2862
|
declare function config(manager: NPCManager, modName: string, modZip: ModZipReader, config: NPCSidebarBootConfig): Promise<void>;
|
|
2822
2863
|
declare function loadFromMod(modZip: ModZipReader, npcNames: string[]): string[];
|
|
2864
|
+
declare class NPCPet {
|
|
2865
|
+
private readonly pets;
|
|
2866
|
+
private frame;
|
|
2867
|
+
private syncing;
|
|
2868
|
+
sync(): boolean;
|
|
2869
|
+
private render;
|
|
2870
|
+
reset(): void;
|
|
2871
|
+
private cancel;
|
|
2872
|
+
}
|
|
2823
2873
|
declare const NPCSidebar: {
|
|
2824
2874
|
new (): {};
|
|
2875
|
+
readonly pet: NPCPet;
|
|
2825
2876
|
get display(): Map<string, Set<string>>;
|
|
2826
2877
|
config: typeof config;
|
|
2827
2878
|
loadFromMod: typeof loadFromMod;
|
|
@@ -2984,6 +3035,7 @@ declare const NamedNPC: {
|
|
|
2984
3035
|
clear: (manager: NPCManager) => boolean;
|
|
2985
3036
|
update: (manager: NPCManager) => boolean;
|
|
2986
3037
|
setup: (manager: NPCManager) => void;
|
|
3038
|
+
proxy: (manager: NPCManager) => void;
|
|
2987
3039
|
convert: (manager: NPCManager) => void;
|
|
2988
3040
|
};
|
|
2989
3041
|
declare class NPCManager {
|