@phantomclient/plugin 0.1.1 → 0.1.2
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/lib/chunks/{api-Cu4nKe7h.js → api-DhaU9Jsd.js} +327 -307
- package/dist/lib/chunks/sdk-permissions-CyDMa4we.js +429 -0
- package/dist/lib/chunks/{state-kAlKf5xt.js → state-BGYMFLti.js} +9 -8
- package/dist/lib/guest.js +1126 -851
- package/dist/lib/index.js +33 -27
- package/dist/lib/styles.css +1 -1
- package/dist/lib/vue.js +3 -3
- package/dist/runtime/chunks/api-DCkkcNDr.js +1 -0
- package/dist/runtime/chunks/sdk-permissions-AYsXGgro.js +1 -0
- package/dist/runtime/chunks/{state-BjAtxWlm.js → state-CyERnsrb.js} +1 -1
- package/dist/runtime/frame.html +3 -3
- package/dist/runtime/runtime.css +1 -1
- package/dist/runtime/runtime.js +4 -1
- package/dist/runtime/sdk-vue.js +1 -1
- package/dist/runtime/sdk.js +1 -1
- package/dist/types/index.d.ts +1519 -288
- package/dist/types/vue.d.ts +1260 -217
- package/package.json +1 -1
- package/dist/lib/chunks/sdk-permissions-DPyveeLR.js +0 -250
- package/dist/runtime/chunks/api-ByZmAFMe.js +0 -1
- package/dist/runtime/chunks/sdk-permissions-BKJgZYgg.js +0 -1
package/dist/types/vue.d.ts
CHANGED
|
@@ -2477,15 +2477,37 @@ declare class Side {
|
|
|
2477
2477
|
private read;
|
|
2478
2478
|
private checked;
|
|
2479
2479
|
}
|
|
2480
|
+
type LicensePlan = "monthly" | "lifetime";
|
|
2481
|
+
type PhantomPerks = {
|
|
2482
|
+
mark: boolean;
|
|
2483
|
+
planMark: boolean;
|
|
2484
|
+
title: string[];
|
|
2485
|
+
accent: string;
|
|
2486
|
+
phantomLook: boolean;
|
|
2487
|
+
tint: number;
|
|
2488
|
+
pet: PerkPet | null;
|
|
2489
|
+
};
|
|
2490
|
+
type PerkPet = {
|
|
2491
|
+
name: string[];
|
|
2492
|
+
animal: number | null;
|
|
2493
|
+
tint: number;
|
|
2494
|
+
};
|
|
2480
2495
|
type HiddenPlayer = {
|
|
2481
2496
|
screenName: string;
|
|
2482
2497
|
};
|
|
2498
|
+
type NearbyPhantomUser = {
|
|
2499
|
+
screenName: string;
|
|
2500
|
+
perks: PhantomPerks;
|
|
2501
|
+
plan: LicensePlan | null;
|
|
2502
|
+
};
|
|
2483
2503
|
type CommunityChannel = {
|
|
2484
2504
|
hidden(): Promise<readonly HiddenPlayer[]>;
|
|
2485
2505
|
onHidden(listener: (hidden: readonly HiddenPlayer[]) => void): Unsubscribe;
|
|
2486
2506
|
hide(screenName: string): Promise<void>;
|
|
2487
2507
|
unhide(screenName: string): Promise<void>;
|
|
2488
2508
|
report(screenName: string, reason: string): Promise<void>;
|
|
2509
|
+
nearby(): readonly NearbyPhantomUser[];
|
|
2510
|
+
onNearby(listener: (nearby: readonly NearbyPhantomUser[]) => void): Unsubscribe;
|
|
2489
2511
|
};
|
|
2490
2512
|
declare class CommunityApi {
|
|
2491
2513
|
private readonly channel;
|
|
@@ -2493,9 +2515,12 @@ declare class CommunityApi {
|
|
|
2493
2515
|
get available(): boolean;
|
|
2494
2516
|
hidden(): Promise<readonly HiddenPlayer[]>;
|
|
2495
2517
|
onHidden(listener: (hidden: readonly HiddenPlayer[]) => void): Unsubscribe;
|
|
2518
|
+
watchHidden(listener: (hidden: readonly HiddenPlayer[]) => void): Unsubscribe;
|
|
2496
2519
|
hide(screenName: string): Promise<void>;
|
|
2497
2520
|
unhide(screenName: string): Promise<void>;
|
|
2498
2521
|
report(screenName: string, reason?: string): Promise<void>;
|
|
2522
|
+
nearby(): readonly NearbyPhantomUser[];
|
|
2523
|
+
onNearby(listener: (nearby: readonly NearbyPhantomUser[]) => void): Unsubscribe;
|
|
2499
2524
|
private reach;
|
|
2500
2525
|
}
|
|
2501
2526
|
type ContentMatch = {
|
|
@@ -2599,6 +2624,24 @@ declare class ContentApi {
|
|
|
2599
2624
|
private whenLoaded;
|
|
2600
2625
|
private reach;
|
|
2601
2626
|
}
|
|
2627
|
+
type RealtimeChannelSpec = {
|
|
2628
|
+
scope: "room";
|
|
2629
|
+
} | {
|
|
2630
|
+
scope: "plugin";
|
|
2631
|
+
} | {
|
|
2632
|
+
scope: "named";
|
|
2633
|
+
name: string;
|
|
2634
|
+
split?: boolean;
|
|
2635
|
+
};
|
|
2636
|
+
type RealtimeScope = RealtimeChannelSpec["scope"];
|
|
2637
|
+
type RealtimeObject = Record<string, unknown>;
|
|
2638
|
+
type RealtimeMember<Presence = RealtimeObject> = {
|
|
2639
|
+
id: string;
|
|
2640
|
+
screenName: string;
|
|
2641
|
+
presence?: Presence;
|
|
2642
|
+
};
|
|
2643
|
+
type RealtimeCloseReason = "left" | "banned" | "killed" | "rate-limited" | "offline";
|
|
2644
|
+
type RealtimeAskFailure = "no-handler" | "failed";
|
|
2602
2645
|
type CustomRoomPicture = string | Uint8Array;
|
|
2603
2646
|
type CustomRoomMotion = {
|
|
2604
2647
|
pulse?: {
|
|
@@ -2643,7 +2686,10 @@ type CustomRoomProp = {
|
|
|
2643
2686
|
y: number;
|
|
2644
2687
|
width?: number;
|
|
2645
2688
|
height?: number;
|
|
2646
|
-
layer?: "floor" | "standing" | "front";
|
|
2689
|
+
layer?: "floor" | "standing" | "front" | "top";
|
|
2690
|
+
sortHeight?: number;
|
|
2691
|
+
scaleX?: number;
|
|
2692
|
+
scaleY?: number;
|
|
2647
2693
|
motion?: CustomRoomMotion;
|
|
2648
2694
|
frames?: CustomRoomFrames;
|
|
2649
2695
|
solid?: boolean;
|
|
@@ -2651,6 +2697,8 @@ type CustomRoomProp = {
|
|
|
2651
2697
|
clickable?: boolean;
|
|
2652
2698
|
nearDistance?: number;
|
|
2653
2699
|
bounce?: boolean;
|
|
2700
|
+
changeable?: boolean;
|
|
2701
|
+
shared?: boolean;
|
|
2654
2702
|
};
|
|
2655
2703
|
type CustomRoomExit = {
|
|
2656
2704
|
id: string;
|
|
@@ -2658,6 +2706,73 @@ type CustomRoomExit = {
|
|
|
2658
2706
|
y: number;
|
|
2659
2707
|
radius: number;
|
|
2660
2708
|
};
|
|
2709
|
+
type CustomRoomDestination = {
|
|
2710
|
+
room: string;
|
|
2711
|
+
} | {
|
|
2712
|
+
jamaa: string;
|
|
2713
|
+
};
|
|
2714
|
+
type CustomRoomDoorway = {
|
|
2715
|
+
id: string;
|
|
2716
|
+
x: number;
|
|
2717
|
+
y: number;
|
|
2718
|
+
radius: number;
|
|
2719
|
+
to: CustomRoomDestination;
|
|
2720
|
+
spawn?: string;
|
|
2721
|
+
};
|
|
2722
|
+
type CustomRoomSpawn = {
|
|
2723
|
+
name: string;
|
|
2724
|
+
x: number;
|
|
2725
|
+
y: number;
|
|
2726
|
+
radius?: number;
|
|
2727
|
+
walkTo?: string;
|
|
2728
|
+
};
|
|
2729
|
+
type CustomRoomVolume = {
|
|
2730
|
+
name: string;
|
|
2731
|
+
area: CustomRoomArea;
|
|
2732
|
+
kind?: number;
|
|
2733
|
+
message?: string;
|
|
2734
|
+
walkTo?: boolean;
|
|
2735
|
+
};
|
|
2736
|
+
type CustomRoomScroll = {
|
|
2737
|
+
xmin: number;
|
|
2738
|
+
xmax: number;
|
|
2739
|
+
ymin: number;
|
|
2740
|
+
ymax: number;
|
|
2741
|
+
};
|
|
2742
|
+
type CustomRoomCharacterLook = {
|
|
2743
|
+
animal?: number;
|
|
2744
|
+
customAnimal?: number;
|
|
2745
|
+
colors?: [
|
|
2746
|
+
number,
|
|
2747
|
+
number,
|
|
2748
|
+
number
|
|
2749
|
+
];
|
|
2750
|
+
eyes?: number;
|
|
2751
|
+
pattern?: number;
|
|
2752
|
+
wearing?: Array<{
|
|
2753
|
+
defId: number;
|
|
2754
|
+
color?: number;
|
|
2755
|
+
}>;
|
|
2756
|
+
member?: boolean;
|
|
2757
|
+
phantom?: boolean;
|
|
2758
|
+
tint?: number;
|
|
2759
|
+
};
|
|
2760
|
+
type CustomRoomCharacter = {
|
|
2761
|
+
id: string;
|
|
2762
|
+
name: string;
|
|
2763
|
+
x: number;
|
|
2764
|
+
y: number;
|
|
2765
|
+
flipped?: boolean;
|
|
2766
|
+
look?: CustomRoomCharacterLook;
|
|
2767
|
+
greeting?: string;
|
|
2768
|
+
says?: string[];
|
|
2769
|
+
path?: Array<{
|
|
2770
|
+
x: number;
|
|
2771
|
+
y: number;
|
|
2772
|
+
}>;
|
|
2773
|
+
pace?: number;
|
|
2774
|
+
clickable?: boolean;
|
|
2775
|
+
};
|
|
2661
2776
|
type CustomRoomSpec = {
|
|
2662
2777
|
name: string;
|
|
2663
2778
|
width: number;
|
|
@@ -2665,16 +2780,136 @@ type CustomRoomSpec = {
|
|
|
2665
2780
|
background: CustomRoomPicture;
|
|
2666
2781
|
walkable?: CustomRoomArea[];
|
|
2667
2782
|
blocked?: CustomRoomArea[];
|
|
2783
|
+
landWalls?: CustomRoomArea[];
|
|
2784
|
+
airWalls?: CustomRoomArea[];
|
|
2668
2785
|
spawn: {
|
|
2669
2786
|
x: number;
|
|
2670
2787
|
y: number;
|
|
2671
2788
|
};
|
|
2672
2789
|
props?: CustomRoomProp[];
|
|
2673
2790
|
exits?: CustomRoomExit[];
|
|
2791
|
+
characters?: CustomRoomCharacter[];
|
|
2674
2792
|
music?: {
|
|
2675
2793
|
track: string;
|
|
2676
2794
|
volume?: number;
|
|
2677
2795
|
};
|
|
2796
|
+
spawns?: CustomRoomSpawn[];
|
|
2797
|
+
doorways?: CustomRoomDoorway[];
|
|
2798
|
+
volumes?: CustomRoomVolume[];
|
|
2799
|
+
scroll?: CustomRoomScroll;
|
|
2800
|
+
};
|
|
2801
|
+
type CustomRoomPropState = {
|
|
2802
|
+
id: string;
|
|
2803
|
+
room: string;
|
|
2804
|
+
x: number;
|
|
2805
|
+
y: number;
|
|
2806
|
+
shown: boolean;
|
|
2807
|
+
changed: boolean;
|
|
2808
|
+
};
|
|
2809
|
+
type CustomRoomPropChange = {
|
|
2810
|
+
x?: number;
|
|
2811
|
+
y?: number;
|
|
2812
|
+
shown?: boolean;
|
|
2813
|
+
art?: CustomRoomPicture | null;
|
|
2814
|
+
reset?: boolean;
|
|
2815
|
+
};
|
|
2816
|
+
type CustomRoomPropHandle = {
|
|
2817
|
+
readonly id: string;
|
|
2818
|
+
move(x: number, y: number): Promise<CustomRoomPropState | null>;
|
|
2819
|
+
hide(): Promise<CustomRoomPropState | null>;
|
|
2820
|
+
show(): Promise<CustomRoomPropState | null>;
|
|
2821
|
+
art(picture: CustomRoomPicture | null): Promise<CustomRoomPropState | null>;
|
|
2822
|
+
change(change: CustomRoomPropChange): Promise<CustomRoomPropState | null>;
|
|
2823
|
+
reset(): Promise<CustomRoomPropState | null>;
|
|
2824
|
+
now(): Promise<CustomRoomPropState | null>;
|
|
2825
|
+
};
|
|
2826
|
+
type CustomRoomPropCalls = {
|
|
2827
|
+
changeProp(propId: string, change: CustomRoomPropChange, roomId?: string): Promise<CustomRoomPropState | null>;
|
|
2828
|
+
propState(propId: string, roomId?: string): Promise<CustomRoomPropState | null>;
|
|
2829
|
+
};
|
|
2830
|
+
type CustomRoomCharacterState = {
|
|
2831
|
+
id: string;
|
|
2832
|
+
room: string;
|
|
2833
|
+
name: string;
|
|
2834
|
+
x: number;
|
|
2835
|
+
y: number;
|
|
2836
|
+
shown: boolean;
|
|
2837
|
+
said: number;
|
|
2838
|
+
};
|
|
2839
|
+
type CustomRoomCharacterChange = {
|
|
2840
|
+
say?: string;
|
|
2841
|
+
x?: number;
|
|
2842
|
+
y?: number;
|
|
2843
|
+
walk?: boolean;
|
|
2844
|
+
shown?: boolean;
|
|
2845
|
+
};
|
|
2846
|
+
type CustomRoomCharacterHandle = {
|
|
2847
|
+
readonly id: string;
|
|
2848
|
+
say(text: string): Promise<CustomRoomCharacterState | null>;
|
|
2849
|
+
walk(x: number, y: number): Promise<CustomRoomCharacterState | null>;
|
|
2850
|
+
put(x: number, y: number): Promise<CustomRoomCharacterState | null>;
|
|
2851
|
+
hide(): Promise<CustomRoomCharacterState | null>;
|
|
2852
|
+
show(): Promise<CustomRoomCharacterState | null>;
|
|
2853
|
+
change(change: CustomRoomCharacterChange): Promise<CustomRoomCharacterState | null>;
|
|
2854
|
+
now(): Promise<CustomRoomCharacterState | null>;
|
|
2855
|
+
};
|
|
2856
|
+
type CustomRoomCharacterCalls = {
|
|
2857
|
+
changeCharacter(characterId: string, change: CustomRoomCharacterChange, roomId?: string): Promise<CustomRoomCharacterState | null>;
|
|
2858
|
+
characterState(characterId: string, roomId?: string): Promise<CustomRoomCharacterState | null>;
|
|
2859
|
+
};
|
|
2860
|
+
type CustomRoomLimits = {
|
|
2861
|
+
objects: number;
|
|
2862
|
+
objectTag: number;
|
|
2863
|
+
};
|
|
2864
|
+
type CustomRoomObjectState = {
|
|
2865
|
+
id: string;
|
|
2866
|
+
room: string;
|
|
2867
|
+
holder: string | null;
|
|
2868
|
+
mine: boolean;
|
|
2869
|
+
x: number;
|
|
2870
|
+
y: number;
|
|
2871
|
+
shown: boolean;
|
|
2872
|
+
tag: string | null;
|
|
2873
|
+
changed: boolean;
|
|
2874
|
+
};
|
|
2875
|
+
type CustomRoomObjectChange = {
|
|
2876
|
+
take?: boolean;
|
|
2877
|
+
drop?: boolean;
|
|
2878
|
+
reset?: boolean;
|
|
2879
|
+
x?: number;
|
|
2880
|
+
y?: number;
|
|
2881
|
+
shown?: boolean;
|
|
2882
|
+
tag?: string | null;
|
|
2883
|
+
};
|
|
2884
|
+
type CustomRoomObjectEvent = {
|
|
2885
|
+
room: CustomRoomInfo;
|
|
2886
|
+
objects: CustomRoomObjectState[];
|
|
2887
|
+
by: string | null;
|
|
2888
|
+
yours: boolean;
|
|
2889
|
+
took: boolean;
|
|
2890
|
+
dropped: boolean;
|
|
2891
|
+
};
|
|
2892
|
+
type CustomRoomObjectHandle = {
|
|
2893
|
+
readonly id: string;
|
|
2894
|
+
take(change?: CustomRoomObjectChange): Promise<CustomRoomObjectState>;
|
|
2895
|
+
drop(change?: CustomRoomObjectChange): Promise<CustomRoomObjectState>;
|
|
2896
|
+
move(x: number, y: number): Promise<CustomRoomObjectState>;
|
|
2897
|
+
hide(): Promise<CustomRoomObjectState>;
|
|
2898
|
+
show(): Promise<CustomRoomObjectState>;
|
|
2899
|
+
mark(word: string | null): Promise<CustomRoomObjectState>;
|
|
2900
|
+
reset(): Promise<CustomRoomObjectState>;
|
|
2901
|
+
change(change: CustomRoomObjectChange): Promise<CustomRoomObjectState>;
|
|
2902
|
+
now(): Promise<CustomRoomObjectState | null>;
|
|
2903
|
+
onTaken(listener: (event: CustomRoomObjectTurn) => void): Unsubscribe;
|
|
2904
|
+
onDropped(listener: (event: CustomRoomObjectTurn) => void): Unsubscribe;
|
|
2905
|
+
onChanged(listener: (event: CustomRoomObjectTurn) => void): Unsubscribe;
|
|
2906
|
+
};
|
|
2907
|
+
type CustomRoomObjectTurn = {
|
|
2908
|
+
object: CustomRoomObjectState;
|
|
2909
|
+
by: string | null;
|
|
2910
|
+
yours: boolean;
|
|
2911
|
+
took: boolean;
|
|
2912
|
+
dropped: boolean;
|
|
2678
2913
|
};
|
|
2679
2914
|
type CustomRoomEnterOptions = {
|
|
2680
2915
|
shared?: boolean;
|
|
@@ -2706,13 +2941,24 @@ type CustomRoomEvent = {
|
|
|
2706
2941
|
kind: "propEnter" | "propLeave" | "propNear" | "propClick";
|
|
2707
2942
|
room: CustomRoomInfo;
|
|
2708
2943
|
prop: string;
|
|
2709
|
-
}
|
|
2944
|
+
} | {
|
|
2945
|
+
kind: "characterClick";
|
|
2946
|
+
room: CustomRoomInfo;
|
|
2947
|
+
character: string;
|
|
2948
|
+
said: string | null;
|
|
2949
|
+
} | ({
|
|
2950
|
+
kind: "objects";
|
|
2951
|
+
} & CustomRoomObjectEvent);
|
|
2710
2952
|
type SharedRoomListing = {
|
|
2711
2953
|
name: string;
|
|
2712
2954
|
title: string;
|
|
2713
2955
|
people: number;
|
|
2714
2956
|
};
|
|
2715
|
-
type CustomRoomsChannel = {
|
|
2957
|
+
type CustomRoomsChannel = CustomRoomPropCalls & CustomRoomCharacterCalls & {
|
|
2958
|
+
characters(roomId?: string): Promise<CustomRoomCharacterState[]>;
|
|
2959
|
+
changeObject(objectId: string, change: CustomRoomObjectChange, roomId?: string): Promise<CustomRoomObjectState>;
|
|
2960
|
+
objectState(objectId: string, roomId?: string): Promise<CustomRoomObjectState | null>;
|
|
2961
|
+
objects(roomId?: string): Promise<CustomRoomObjectState[]>;
|
|
2716
2962
|
define(spec: CustomRoomSpec): Promise<string>;
|
|
2717
2963
|
shared(): Promise<SharedRoomListing[]>;
|
|
2718
2964
|
remove(roomId: string): Promise<boolean>;
|
|
@@ -2729,7 +2975,27 @@ declare class CustomRoomsApi {
|
|
|
2729
2975
|
remove(roomId: string): Promise<boolean>;
|
|
2730
2976
|
enter(roomId: string, options?: CustomRoomEnterOptions): Promise<void>;
|
|
2731
2977
|
shared(): Promise<SharedRoomListing[]>;
|
|
2978
|
+
prop(id: string, roomId?: string): CustomRoomPropHandle;
|
|
2979
|
+
changeProp(propId: string, change: CustomRoomPropChange, roomId?: string): Promise<CustomRoomPropState | null>;
|
|
2980
|
+
propState(propId: string, roomId?: string): Promise<CustomRoomPropState | null>;
|
|
2981
|
+
character(id: string, roomId?: string): CustomRoomCharacterHandle;
|
|
2982
|
+
changeCharacter(characterId: string, change: CustomRoomCharacterChange, roomId?: string): Promise<CustomRoomCharacterState | null>;
|
|
2983
|
+
characterState(characterId: string, roomId?: string): Promise<CustomRoomCharacterState | null>;
|
|
2984
|
+
characters(roomId?: string): Promise<CustomRoomCharacterState[]>;
|
|
2985
|
+
onCharacterClick(listener: (event: {
|
|
2986
|
+
room: CustomRoomInfo;
|
|
2987
|
+
character: string;
|
|
2988
|
+
said: string | null;
|
|
2989
|
+
}) => void): Unsubscribe;
|
|
2990
|
+
get limits(): CustomRoomLimits;
|
|
2991
|
+
object(id: string, roomId?: string): CustomRoomObjectHandle;
|
|
2992
|
+
changeObject(objectId: string, change: CustomRoomObjectChange, roomId?: string): Promise<CustomRoomObjectState>;
|
|
2993
|
+
objectState(objectId: string, roomId?: string): Promise<CustomRoomObjectState | null>;
|
|
2994
|
+
objects(roomId?: string): Promise<CustomRoomObjectState[]>;
|
|
2995
|
+
onObject(listener: (event: CustomRoomObjectEvent) => void): Unsubscribe;
|
|
2732
2996
|
leave(): Promise<boolean>;
|
|
2997
|
+
private readonly opened;
|
|
2998
|
+
open(spec: CustomRoomSpec, options?: CustomRoomEnterOptions): Promise<string>;
|
|
2733
2999
|
get current(): CustomRoomInfo | null;
|
|
2734
3000
|
onEnter(listener: (room: CustomRoomInfo) => void): Unsubscribe;
|
|
2735
3001
|
onLeave(listener: (event: {
|
|
@@ -2766,24 +3032,16 @@ declare class CustomRoomsApi {
|
|
|
2766
3032
|
private on;
|
|
2767
3033
|
private reach;
|
|
2768
3034
|
}
|
|
2769
|
-
type
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
type RealtimeScope = RealtimeChannelSpec["scope"];
|
|
2779
|
-
type RealtimeObject = Record<string, unknown>;
|
|
2780
|
-
type RealtimeMember<Presence = RealtimeObject> = {
|
|
2781
|
-
id: string;
|
|
2782
|
-
screenName: string;
|
|
2783
|
-
presence?: Presence;
|
|
3035
|
+
type RealtimeLimits = {
|
|
3036
|
+
messageBytes: number;
|
|
3037
|
+
stateBytes: number;
|
|
3038
|
+
presenceBytes: number;
|
|
3039
|
+
messagesPerSecond: number;
|
|
3040
|
+
updatesPerSecond: number;
|
|
3041
|
+
members: number;
|
|
3042
|
+
channels: number;
|
|
3043
|
+
nameLength: number;
|
|
2784
3044
|
};
|
|
2785
|
-
type RealtimeCloseReason = "left" | "banned" | "killed" | "rate-limited" | "offline";
|
|
2786
|
-
type RealtimeAskFailure = "no-handler" | "failed";
|
|
2787
3045
|
type RealtimeState = "off" | "connecting" | "online" | "offline" | "refused";
|
|
2788
3046
|
type RealtimeStatus = {
|
|
2789
3047
|
state: RealtimeState;
|
|
@@ -2830,6 +3088,12 @@ type RealtimeHostEvent<Presence extends RealtimeObject = RealtimeObject> = {
|
|
|
2830
3088
|
you: boolean;
|
|
2831
3089
|
hosted: boolean;
|
|
2832
3090
|
};
|
|
3091
|
+
type RealtimeHosting<Presence extends RealtimeObject = RealtimeObject> = {
|
|
3092
|
+
host: RealtimeMember<Presence> | null;
|
|
3093
|
+
you: boolean;
|
|
3094
|
+
hosted: boolean;
|
|
3095
|
+
hidden: boolean;
|
|
3096
|
+
};
|
|
2833
3097
|
type RealtimeAsk<Question = unknown> = {
|
|
2834
3098
|
channel: string;
|
|
2835
3099
|
id: string;
|
|
@@ -2926,8 +3190,19 @@ declare class RealtimeChannel<Data = unknown, State extends RealtimeObject = Rea
|
|
|
2926
3190
|
private hostAt;
|
|
2927
3191
|
private hostIsHidden;
|
|
2928
3192
|
private closedWith;
|
|
3193
|
+
private queued;
|
|
3194
|
+
private waiting;
|
|
3195
|
+
private publishing;
|
|
3196
|
+
private publishTimer;
|
|
3197
|
+
private publishedAt;
|
|
2929
3198
|
private answers;
|
|
2930
3199
|
private readonly heard;
|
|
3200
|
+
private queuedPresence;
|
|
3201
|
+
private presenceWaiting;
|
|
3202
|
+
private publishingPresence;
|
|
3203
|
+
private presenceTimer;
|
|
3204
|
+
private presencePublishedAt;
|
|
3205
|
+
private watchingClose;
|
|
2931
3206
|
private stop;
|
|
2932
3207
|
constructor(info: RealtimeChannelInfo, calls: RealtimeCalls);
|
|
2933
3208
|
get you(): RealtimeMember<Presence>;
|
|
@@ -2936,11 +3211,17 @@ declare class RealtimeChannel<Data = unknown, State extends RealtimeObject = Rea
|
|
|
2936
3211
|
host(): RealtimeMember<Presence> | null;
|
|
2937
3212
|
get isHost(): boolean;
|
|
2938
3213
|
get hosted(): boolean;
|
|
3214
|
+
get hostHidden(): boolean;
|
|
3215
|
+
hosting(): RealtimeHosting<Presence>;
|
|
2939
3216
|
giveHost(memberId: string): Promise<void>;
|
|
2940
3217
|
state(): State | null;
|
|
2941
3218
|
setState(state: State | null): Promise<void>;
|
|
3219
|
+
publish(state: State | null): Promise<void>;
|
|
3220
|
+
private pump;
|
|
2942
3221
|
presence(): Presence | null;
|
|
2943
3222
|
setPresence(presence: Presence | null): Promise<void>;
|
|
3223
|
+
publishPresence(presence: Presence | null): Promise<void>;
|
|
3224
|
+
private pumpPresence;
|
|
2944
3225
|
send(data: Data): Promise<void>;
|
|
2945
3226
|
sendTo(memberId: string, data: Data): Promise<void>;
|
|
2946
3227
|
ask<Answer = unknown>(memberId: string, question: unknown, options?: RealtimeAskOptions): Promise<Answer>;
|
|
@@ -2951,6 +3232,7 @@ declare class RealtimeChannel<Data = unknown, State extends RealtimeObject = Rea
|
|
|
2951
3232
|
onLeave(listener: (member: RealtimeMember<Presence>) => void): Unsubscribe;
|
|
2952
3233
|
onState(listener: (event: RealtimeStateEvent<State>) => void): Unsubscribe;
|
|
2953
3234
|
onPresence(listener: (member: RealtimeMember<Presence>) => void): Unsubscribe;
|
|
3235
|
+
onMembers(listener: (members: readonly RealtimeMember<Presence>[]) => void): Unsubscribe;
|
|
2954
3236
|
onHost(listener: (event: RealtimeHostEvent<Presence>) => void): Unsubscribe;
|
|
2955
3237
|
onClose(listener: (close: RealtimeClose) => void): Unsubscribe;
|
|
2956
3238
|
hear(event: Heard): void;
|
|
@@ -2961,13 +3243,18 @@ declare class RealtimeChannel<Data = unknown, State extends RealtimeObject = Rea
|
|
|
2961
3243
|
private tell;
|
|
2962
3244
|
private refuse;
|
|
2963
3245
|
}
|
|
3246
|
+
type RealtimeStayOptions<Presence extends RealtimeObject = RealtimeObject> = RealtimeJoinOptions<Presence> & {
|
|
3247
|
+
onProblem?: (error: unknown) => void;
|
|
3248
|
+
};
|
|
2964
3249
|
declare class RealtimeApi {
|
|
2965
3250
|
private readonly link;
|
|
2966
3251
|
constructor(game: GameContext);
|
|
2967
3252
|
get available(): boolean;
|
|
3253
|
+
get limits(): RealtimeLimits;
|
|
2968
3254
|
get status(): RealtimeStatus;
|
|
2969
3255
|
onStatus(listener: (status: RealtimeStatus) => void): Unsubscribe;
|
|
2970
3256
|
join<Data = unknown, State extends RealtimeObject = RealtimeObject, Presence extends RealtimeObject = RealtimeObject>(spec: RealtimeChannelSpec, options?: RealtimeJoinOptions<Presence>): Promise<RealtimeChannel<Data, State, Presence>>;
|
|
3257
|
+
stayIn<Data = unknown, State extends RealtimeObject = RealtimeObject, Presence extends RealtimeObject = RealtimeObject>(spec: RealtimeChannelSpec, ready: (channel: RealtimeChannel<Data, State, Presence>) => void, options?: RealtimeStayOptions<Presence>): Promise<Unsubscribe>;
|
|
2971
3258
|
open(spec: RealtimeChannelSpec, options?: RealtimeJoinOptions): Promise<RealtimeChannelInfo>;
|
|
2972
3259
|
leave(channelId: string): Promise<boolean>;
|
|
2973
3260
|
send(channelId: string, data: unknown): Promise<void>;
|
|
@@ -3038,6 +3325,45 @@ type CachedStat = {
|
|
|
3038
3325
|
value: number;
|
|
3039
3326
|
type: number;
|
|
3040
3327
|
};
|
|
3328
|
+
type AchievementBookEntry = {
|
|
3329
|
+
defId: number;
|
|
3330
|
+
name: string;
|
|
3331
|
+
description: string;
|
|
3332
|
+
type: number;
|
|
3333
|
+
typeName: string;
|
|
3334
|
+
userVarId: number;
|
|
3335
|
+
target: number;
|
|
3336
|
+
value: number;
|
|
3337
|
+
earned: boolean;
|
|
3338
|
+
fraction: number;
|
|
3339
|
+
iconMediaId: number;
|
|
3340
|
+
baseMediaId: number;
|
|
3341
|
+
};
|
|
3342
|
+
type AchievementBookGroup = {
|
|
3343
|
+
type: number;
|
|
3344
|
+
name: string;
|
|
3345
|
+
total: number;
|
|
3346
|
+
earned: number;
|
|
3347
|
+
left: number;
|
|
3348
|
+
entries: AchievementBookEntry[];
|
|
3349
|
+
};
|
|
3350
|
+
type AchievementBook = {
|
|
3351
|
+
total: number;
|
|
3352
|
+
earned: number;
|
|
3353
|
+
left: number;
|
|
3354
|
+
fraction: number;
|
|
3355
|
+
entries: AchievementBookEntry[];
|
|
3356
|
+
groups: AchievementBookGroup[];
|
|
3357
|
+
};
|
|
3358
|
+
type AchievementProgress = {
|
|
3359
|
+
defId: number;
|
|
3360
|
+
name: string;
|
|
3361
|
+
userVarId: number;
|
|
3362
|
+
target: number;
|
|
3363
|
+
value: number;
|
|
3364
|
+
earned: boolean;
|
|
3365
|
+
fraction: number;
|
|
3366
|
+
};
|
|
3041
3367
|
type EarnAnswer = {
|
|
3042
3368
|
defId: number;
|
|
3043
3369
|
userVarId: number;
|
|
@@ -3085,6 +3411,8 @@ declare class AchievementsApi {
|
|
|
3085
3411
|
readStats(): Promise<CachedStat[]>;
|
|
3086
3412
|
statBit(userVarId: number, bit: number): Promise<boolean>;
|
|
3087
3413
|
statType(userVarId: number): Promise<number>;
|
|
3414
|
+
progress(): Promise<AchievementProgress[]>;
|
|
3415
|
+
book(): Promise<AchievementBook>;
|
|
3088
3416
|
private translate;
|
|
3089
3417
|
private typeName;
|
|
3090
3418
|
private achievementsOf;
|
|
@@ -3107,6 +3435,17 @@ type AvatarColorGridOptions = {
|
|
|
3107
3435
|
width?: number;
|
|
3108
3436
|
height?: number;
|
|
3109
3437
|
};
|
|
3438
|
+
type NameBar = {
|
|
3439
|
+
data: number;
|
|
3440
|
+
color: number;
|
|
3441
|
+
badge: number;
|
|
3442
|
+
showLevel: boolean;
|
|
3443
|
+
};
|
|
3444
|
+
type NameBarLook = {
|
|
3445
|
+
color?: number;
|
|
3446
|
+
badge?: number;
|
|
3447
|
+
showLevel?: boolean;
|
|
3448
|
+
};
|
|
3110
3449
|
type Point = {
|
|
3111
3450
|
x: number;
|
|
3112
3451
|
y: number;
|
|
@@ -3157,6 +3496,11 @@ type AvatarSummary = {
|
|
|
3157
3496
|
userId: number;
|
|
3158
3497
|
enviroTypeFlag: number;
|
|
3159
3498
|
};
|
|
3499
|
+
type RoomPlayerProfile = AvatarSummary & {
|
|
3500
|
+
self: boolean;
|
|
3501
|
+
standing: AvatarStanding | null;
|
|
3502
|
+
nameBar: NameBar | null;
|
|
3503
|
+
};
|
|
3160
3504
|
type NewAvatar = {
|
|
3161
3505
|
avTypeId: number;
|
|
3162
3506
|
nameIds: AvatarNameIds;
|
|
@@ -3208,6 +3552,12 @@ declare class AvatarApi {
|
|
|
3208
3552
|
teleport(x: number, y: number): Promise<void>;
|
|
3209
3553
|
userId(): Promise<number>;
|
|
3210
3554
|
view(): Promise<FlashHandle>;
|
|
3555
|
+
viewOf(userId: number): Promise<FlashHandle | null>;
|
|
3556
|
+
tintOf(userId: number, color: number | null, options?: {
|
|
3557
|
+
amount?: number;
|
|
3558
|
+
keep?: boolean;
|
|
3559
|
+
}): Promise<boolean>;
|
|
3560
|
+
asPhantom(userId: number, on?: boolean): Promise<boolean>;
|
|
3211
3561
|
standing(): Promise<AvatarStanding | null>;
|
|
3212
3562
|
private standingOfView;
|
|
3213
3563
|
placeAt(position: Point, options?: {
|
|
@@ -3275,6 +3625,7 @@ declare class AvatarApi {
|
|
|
3275
3625
|
private summarise;
|
|
3276
3626
|
private summaryOf;
|
|
3277
3627
|
inRoom(userId: number): Promise<AvatarSummary | null>;
|
|
3628
|
+
whoIs(userId: number): Promise<RoomPlayerProfile | null>;
|
|
3278
3629
|
findInRoom(query: {
|
|
3279
3630
|
userName: string;
|
|
3280
3631
|
perUserAvId?: number;
|
|
@@ -3291,6 +3642,8 @@ declare class AvatarApi {
|
|
|
3291
3642
|
isHostingAdventure(): Promise<boolean>;
|
|
3292
3643
|
suitsEnvironment(enviroType: number): Promise<boolean>;
|
|
3293
3644
|
roomState(): Promise<AvatarRoomState>;
|
|
3645
|
+
nameBar(): Promise<NameBar>;
|
|
3646
|
+
setNameBar(look?: NameBarLook): Promise<boolean>;
|
|
3294
3647
|
lastNameBar(userId: number): number | null;
|
|
3295
3648
|
onList(listener: (list: PacketOf<typeof AvatarList>) => void): () => void;
|
|
3296
3649
|
onRemoved(listener: (result: PacketOf<typeof AvatarKilled>) => void): () => void;
|
|
@@ -3332,6 +3685,7 @@ type AdventureActorChange = {
|
|
|
3332
3685
|
kind: AdventureActorChangeKind;
|
|
3333
3686
|
actor: AdventureActor;
|
|
3334
3687
|
};
|
|
3688
|
+
type AdventureActorKind = "attacker" | "bouncer" | "camera" | "circleClocker" | "circleTrigger" | "destructible" | "droppedTreasure" | "factory" | "groupItem" | "gui" | "item" | "lightBeam" | "npc" | "placedTreasure" | "plant" | "platform" | "spawn" | "speaker" | "tile" | "timer" | "variable" | "volumeBlocker" | "volumeFallingPhantom" | "volumeHealth" | "volumeInteraction" | "volumePlacement" | "volumeTrigger";
|
|
3335
3689
|
type RewardPreference = "item" | "gems" | "none" | readonly AdventurePrizeKind[];
|
|
3336
3690
|
type AdventureDefinition = {
|
|
3337
3691
|
defId: number;
|
|
@@ -3466,6 +3820,26 @@ type AdventureEnd = {
|
|
|
3466
3820
|
scriptDefId: number;
|
|
3467
3821
|
reason: AdventureEndReason;
|
|
3468
3822
|
};
|
|
3823
|
+
type AdventurePhase = "idle" | "lobby" | "playing" | "rewards" | "ended";
|
|
3824
|
+
type AdventurePhaseChange = {
|
|
3825
|
+
phase: AdventurePhase;
|
|
3826
|
+
was: AdventurePhase;
|
|
3827
|
+
scriptDefId: number | null;
|
|
3828
|
+
reason: AdventureEndReason | null;
|
|
3829
|
+
offer: AdventureRewardOffer | null;
|
|
3830
|
+
at: number;
|
|
3831
|
+
};
|
|
3832
|
+
type AdventureContents = {
|
|
3833
|
+
scriptDefId: number | null;
|
|
3834
|
+
treasure: AdventureActor[];
|
|
3835
|
+
items: AdventureActor[];
|
|
3836
|
+
crystals: CrystalActor[];
|
|
3837
|
+
fighters: AdventureActor[];
|
|
3838
|
+
npcs: AdventureActor[];
|
|
3839
|
+
plants: AdventureActor[];
|
|
3840
|
+
byKind: Partial<Record<AdventureActorKind, AdventureActor[]>>;
|
|
3841
|
+
goals: CrystalGoal[];
|
|
3842
|
+
};
|
|
3469
3843
|
type AdventureStepAction = "trigger" | "pickUp" | "treasureChoice";
|
|
3470
3844
|
type AdventureStep = {
|
|
3471
3845
|
action: AdventureStepAction;
|
|
@@ -3633,6 +4007,16 @@ type AdventureClientStatus = {
|
|
|
3633
4007
|
crystalCount: number;
|
|
3634
4008
|
maxGoals: number;
|
|
3635
4009
|
};
|
|
4010
|
+
type AdventureRunning = {
|
|
4011
|
+
scriptDefId: number;
|
|
4012
|
+
difficulty: number;
|
|
4013
|
+
startingPlayerCount: number;
|
|
4014
|
+
timeStamp: string;
|
|
4015
|
+
};
|
|
4016
|
+
type AdventureObjective = {
|
|
4017
|
+
stringId: number;
|
|
4018
|
+
text: string;
|
|
4019
|
+
};
|
|
3636
4020
|
declare class AdventuresApi {
|
|
3637
4021
|
readonly [STATE_FIELDS]: readonly [
|
|
3638
4022
|
"lobbyState",
|
|
@@ -3705,6 +4089,7 @@ declare class AdventuresApi {
|
|
|
3705
4089
|
private readonly defeatedUserIds;
|
|
3706
4090
|
private readonly awardList;
|
|
3707
4091
|
private readonly givenItemIds;
|
|
4092
|
+
private actorKindsRead;
|
|
3708
4093
|
private exitAnswered;
|
|
3709
4094
|
private lastBundleMessages;
|
|
3710
4095
|
private readonly iconByActor;
|
|
@@ -3831,6 +4216,10 @@ declare class AdventuresApi {
|
|
|
3831
4216
|
onRewardChoice(listener: (offer: AdventureRewardOffer) => void): () => void;
|
|
3832
4217
|
onComplete(listener: (offer: AdventureRewardOffer) => void): () => void;
|
|
3833
4218
|
onEnd(listener: (end: AdventureEnd) => void): () => void;
|
|
4219
|
+
get phase(): AdventurePhase;
|
|
4220
|
+
onPhase(listener: (change: AdventurePhaseChange) => void): () => void;
|
|
4221
|
+
contents(): Promise<AdventureContents>;
|
|
4222
|
+
private actorKinds;
|
|
3834
4223
|
onStep(listener: (step: AdventureStep) => void): () => void;
|
|
3835
4224
|
private comm;
|
|
3836
4225
|
private questActor;
|
|
@@ -3972,12 +4361,24 @@ declare class AdventuresApi {
|
|
|
3972
4361
|
}): Promise<void>;
|
|
3973
4362
|
finishRoomMinigame(roomName: string, result: number): Promise<void>;
|
|
3974
4363
|
reportSideScroll(at: Point, flags?: number): Promise<void>;
|
|
4364
|
+
running(): Promise<AdventureRunning | null>;
|
|
4365
|
+
objective(): Promise<string>;
|
|
4366
|
+
onObjective(listener: (objective: AdventureObjective) => void): () => void;
|
|
4367
|
+
openList(): Promise<void>;
|
|
4368
|
+
actorTypeNames(): Promise<Record<number, AdventureActorKind>>;
|
|
4369
|
+
private translate;
|
|
3975
4370
|
private forgetRun;
|
|
3976
4371
|
private plantOf;
|
|
3977
4372
|
private respawnPoint;
|
|
3978
4373
|
private targetOf;
|
|
3979
4374
|
private manager;
|
|
3980
4375
|
}
|
|
4376
|
+
type MediaPictureOptions = {
|
|
4377
|
+
scale?: number;
|
|
4378
|
+
background?: number | null;
|
|
4379
|
+
maxSize?: number;
|
|
4380
|
+
timeoutMs?: number;
|
|
4381
|
+
};
|
|
3981
4382
|
declare const DEF_PACK_IDS: {
|
|
3982
4383
|
readonly item: 1000;
|
|
3983
4384
|
readonly avatar: 1003;
|
|
@@ -4013,8 +4414,16 @@ declare class AssetsApi {
|
|
|
4013
4414
|
constructor(game: GameContext, flash: PhantomFlash);
|
|
4014
4415
|
deployVersion(): Promise<string>;
|
|
4015
4416
|
buildVersion(): Promise<string>;
|
|
4417
|
+
url(assetPath: string, options?: {
|
|
4418
|
+
cdnRoot?: string;
|
|
4419
|
+
deployVersion?: boolean;
|
|
4420
|
+
}): Promise<string>;
|
|
4016
4421
|
requestDefPack(packId: DefPackId, timeoutMs?: number): Promise<unknown>;
|
|
4017
4422
|
loadMedia(mediaId: number, timeoutMs?: number): Promise<LoadedMediaInfo>;
|
|
4423
|
+
picture(mediaId: number, options?: MediaPictureOptions): Promise<string>;
|
|
4424
|
+
whenLoaded(id: string | number, options?: {
|
|
4425
|
+
timeoutMs?: number;
|
|
4426
|
+
}): Promise<LoadedAsset>;
|
|
4018
4427
|
onLoaded(listener: (asset: LoadedAsset) => void): Unsubscribe;
|
|
4019
4428
|
}
|
|
4020
4429
|
type BuddySighting = {
|
|
@@ -4074,6 +4483,31 @@ type BuddyCardTradeItem = {
|
|
|
4074
4483
|
itemType: number;
|
|
4075
4484
|
name: string;
|
|
4076
4485
|
};
|
|
4486
|
+
type OpenBuddyCard = {
|
|
4487
|
+
userName: string;
|
|
4488
|
+
moderatedUserName: string;
|
|
4489
|
+
accountType: number;
|
|
4490
|
+
isBuddy: boolean;
|
|
4491
|
+
isBlocked: boolean;
|
|
4492
|
+
isOnline: boolean;
|
|
4493
|
+
isArchived: boolean;
|
|
4494
|
+
roomName: string;
|
|
4495
|
+
roomDisplayName: string;
|
|
4496
|
+
node: string;
|
|
4497
|
+
};
|
|
4498
|
+
type BuddiesOnline = {
|
|
4499
|
+
online: Buddy[];
|
|
4500
|
+
cameOnline: Buddy[];
|
|
4501
|
+
wentOffline: Buddy[];
|
|
4502
|
+
};
|
|
4503
|
+
type PersonSeen = {
|
|
4504
|
+
userName: string;
|
|
4505
|
+
how: "room" | "online" | "located";
|
|
4506
|
+
userId: number | null;
|
|
4507
|
+
avatarName: string | null;
|
|
4508
|
+
where: BuddySighting | null;
|
|
4509
|
+
at: number;
|
|
4510
|
+
};
|
|
4077
4511
|
type BuddyWhereabouts = {
|
|
4078
4512
|
roomName: string;
|
|
4079
4513
|
displayName: string;
|
|
@@ -4134,8 +4568,18 @@ declare class BuddiesApi {
|
|
|
4134
4568
|
cardTradeList(): Promise<BuddyCardTradeItem[] | null>;
|
|
4135
4569
|
showCard(userName: string, online?: boolean): Promise<void>;
|
|
4136
4570
|
closeCard(): Promise<void>;
|
|
4571
|
+
openCard(): Promise<OpenBuddyCard | null>;
|
|
4572
|
+
isListOpen(): Promise<boolean>;
|
|
4573
|
+
closeList(): Promise<void>;
|
|
4137
4574
|
joinBuddyQuest(): Promise<boolean>;
|
|
4138
4575
|
pendingSent(): Promise<SentBuddyRequest[]>;
|
|
4576
|
+
watchOnline(listener: (change: BuddiesOnline) => void, options?: {
|
|
4577
|
+
refresh?: boolean;
|
|
4578
|
+
timeoutMs?: number;
|
|
4579
|
+
}): Unsubscribe;
|
|
4580
|
+
watchFor(userName: string, listener: (seen: PersonSeen) => void, options?: {
|
|
4581
|
+
quietMs?: number;
|
|
4582
|
+
}): Unsubscribe;
|
|
4139
4583
|
private emit;
|
|
4140
4584
|
}
|
|
4141
4585
|
declare const PHRASE_TREES: {
|
|
@@ -4166,6 +4610,25 @@ type ModerationEvent = {
|
|
|
4166
4610
|
action: string;
|
|
4167
4611
|
extra: string[];
|
|
4168
4612
|
};
|
|
4613
|
+
type Said = {
|
|
4614
|
+
room: number;
|
|
4615
|
+
userId: number;
|
|
4616
|
+
userName: string;
|
|
4617
|
+
avatarName: string;
|
|
4618
|
+
text: string;
|
|
4619
|
+
raw: string;
|
|
4620
|
+
kind: number;
|
|
4621
|
+
level: number | null;
|
|
4622
|
+
at: {
|
|
4623
|
+
x: number;
|
|
4624
|
+
y: number;
|
|
4625
|
+
} | null;
|
|
4626
|
+
};
|
|
4627
|
+
type BalloonOptions = {
|
|
4628
|
+
colour?: number;
|
|
4629
|
+
seconds?: number;
|
|
4630
|
+
most?: number;
|
|
4631
|
+
};
|
|
4169
4632
|
declare class ChatApi {
|
|
4170
4633
|
readonly [STATE_FIELDS]: readonly [
|
|
4171
4634
|
"history",
|
|
@@ -4173,12 +4636,14 @@ declare class ChatApi {
|
|
|
4173
4636
|
"moderationNotice"
|
|
4174
4637
|
];
|
|
4175
4638
|
private readonly flash;
|
|
4639
|
+
private readonly client;
|
|
4640
|
+
private readonly balloons;
|
|
4176
4641
|
private readonly server;
|
|
4177
4642
|
private readonly history;
|
|
4178
4643
|
private readonly listeners;
|
|
4179
4644
|
private adminNotice;
|
|
4180
4645
|
private moderationNotice;
|
|
4181
|
-
constructor(game: GameContext);
|
|
4646
|
+
constructor(game: GameContext, typed?: PhantomFlash);
|
|
4182
4647
|
get recent(): readonly ChatMessage[];
|
|
4183
4648
|
say(text: string): Promise<void>;
|
|
4184
4649
|
emote(id: number): Promise<void>;
|
|
@@ -4199,12 +4664,26 @@ declare class ChatApi {
|
|
|
4199
4664
|
petAction(action: number, value?: number): Promise<void>;
|
|
4200
4665
|
attachmentEmote(id: number, extra?: string): Promise<void>;
|
|
4201
4666
|
isEmote(text: string): Promise<boolean>;
|
|
4667
|
+
balloon(userId: number, text: string, options?: BalloonOptions): Promise<Unsubscribe>;
|
|
4668
|
+
private hushBalloon;
|
|
4202
4669
|
showBalloon(userId: number, text: string, level?: number): Promise<void>;
|
|
4203
4670
|
log(text: string, from?: string): Promise<void>;
|
|
4204
4671
|
clearLog(): Promise<void>;
|
|
4205
4672
|
onJamAGram(listener: (card: JamAGram) => void): Unsubscribe;
|
|
4206
4673
|
get lastAdminMessage(): AdminNotice | null;
|
|
4207
4674
|
get lastModeration(): ModerationEvent | null;
|
|
4675
|
+
typed(): Promise<string>;
|
|
4676
|
+
setTyped(text: string): Promise<void>;
|
|
4677
|
+
isTyping(): Promise<boolean>;
|
|
4678
|
+
clearTyped(): Promise<void>;
|
|
4679
|
+
onTyped(listener: (text: string) => void): Unsubscribe;
|
|
4680
|
+
onSaid(listener: (said: Said) => void): Unsubscribe;
|
|
4681
|
+
transcript(options?: {
|
|
4682
|
+
room?: number;
|
|
4683
|
+
}): Promise<Said[]>;
|
|
4684
|
+
private wordsOf;
|
|
4685
|
+
private roomSpeakers;
|
|
4686
|
+
private chatBar;
|
|
4208
4687
|
private phraseNodes;
|
|
4209
4688
|
}
|
|
4210
4689
|
declare const DIAMOND_TYPE: {
|
|
@@ -4228,9 +4707,17 @@ type CurrencyRef = {
|
|
|
4228
4707
|
currency: number;
|
|
4229
4708
|
name: CurrencyKind | null;
|
|
4230
4709
|
};
|
|
4710
|
+
type CurrencyAmountSet = CurrencyRef & {
|
|
4711
|
+
amount: number;
|
|
4712
|
+
};
|
|
4231
4713
|
type CurrencyAmount = CurrencyRef & {
|
|
4232
4714
|
amount: number | null;
|
|
4233
4715
|
};
|
|
4716
|
+
type Purse = Record<CurrencyKind, number | null>;
|
|
4717
|
+
type PurseChange = {
|
|
4718
|
+
currency: number;
|
|
4719
|
+
name: CurrencyKind;
|
|
4720
|
+
};
|
|
4234
4721
|
type PricePart = CurrencyRef & {
|
|
4235
4722
|
amount: number;
|
|
4236
4723
|
};
|
|
@@ -4255,10 +4742,13 @@ declare class CurrencyApi {
|
|
|
4255
4742
|
"balances"
|
|
4256
4743
|
];
|
|
4257
4744
|
private readonly flash;
|
|
4745
|
+
private readonly typedFlash;
|
|
4258
4746
|
private readonly server;
|
|
4259
4747
|
private readonly balances;
|
|
4260
4748
|
private readonly listeners;
|
|
4261
|
-
|
|
4749
|
+
private readonly clientListeners;
|
|
4750
|
+
private clientHook;
|
|
4751
|
+
constructor(game: GameContext, flash: PhantomFlash);
|
|
4262
4752
|
get gems(): number | null;
|
|
4263
4753
|
get tickets(): number | null;
|
|
4264
4754
|
get diamonds(): number | null;
|
|
@@ -4273,12 +4763,15 @@ declare class CurrencyApi {
|
|
|
4273
4763
|
diamondsLoaded(): Promise<boolean>;
|
|
4274
4764
|
diamondDefinitionId(refDefId: number, type: DiamondType | number): Promise<number | null>;
|
|
4275
4765
|
onChange(listener: (change: CurrencyChange) => void): () => void;
|
|
4766
|
+
watch(listener: (purse: Purse, moved: PurseChange | null) => void): Unsubscribe;
|
|
4276
4767
|
onExchange(listener: (result: ExchangeResult) => void): () => void;
|
|
4277
4768
|
onDonate(listener: (success: boolean) => void): () => void;
|
|
4278
4769
|
donateGems(amount: number, timeoutMs?: number): Promise<boolean>;
|
|
4279
4770
|
redeemCode(code: string, timeoutMs?: number): Promise<RedeemCodeAnswer>;
|
|
4280
4771
|
onRedeemResult(listener: (answer: RedeemCodeAnswer) => void): () => void;
|
|
4281
4772
|
onMembershipRedeemed(listener: (membership: PacketOf<typeof MembershipRedeemed>) => void): () => void;
|
|
4773
|
+
onClientBalance(listener: (balance: CurrencyAmountSet) => void): Unsubscribe;
|
|
4774
|
+
private tellClientListeners;
|
|
4282
4775
|
private update;
|
|
4283
4776
|
}
|
|
4284
4777
|
type OpenDailyGift = {
|
|
@@ -4286,6 +4779,17 @@ type OpenDailyGift = {
|
|
|
4286
4779
|
gems: number;
|
|
4287
4780
|
diamonds: number;
|
|
4288
4781
|
};
|
|
4782
|
+
type DailyGiftStatus = {
|
|
4783
|
+
ready: boolean;
|
|
4784
|
+
gift: OpenDailyGift | null;
|
|
4785
|
+
wheel: boolean;
|
|
4786
|
+
taken: number;
|
|
4787
|
+
daysInCycle: number;
|
|
4788
|
+
nextDay: number | null;
|
|
4789
|
+
};
|
|
4790
|
+
type DailyGiftReady = {
|
|
4791
|
+
kind: "gift" | "wheel";
|
|
4792
|
+
};
|
|
4289
4793
|
declare class DailyGiftApi {
|
|
4290
4794
|
private readonly flash;
|
|
4291
4795
|
private readonly client;
|
|
@@ -4308,6 +4812,8 @@ declare class DailyGiftApi {
|
|
|
4308
4812
|
wheelOpen(): Promise<boolean>;
|
|
4309
4813
|
spinWheel(): Promise<boolean>;
|
|
4310
4814
|
onWheelOpen(listener: () => void): Unsubscribe;
|
|
4815
|
+
status(): Promise<DailyGiftStatus>;
|
|
4816
|
+
onReady(listener: (ready: DailyGiftReady) => void): Unsubscribe;
|
|
4311
4817
|
private hookExit;
|
|
4312
4818
|
private press;
|
|
4313
4819
|
private popup;
|
|
@@ -4315,6 +4821,15 @@ declare class DailyGiftApi {
|
|
|
4315
4821
|
type AvatarEditorColorTab = "colors" | "patterns" | "eyes";
|
|
4316
4822
|
type PetCreatorTab = "colors" | "traits" | "eyes";
|
|
4317
4823
|
type PetCreatorColorWheel = "color1" | "color2";
|
|
4824
|
+
type PetCreatorPet = {
|
|
4825
|
+
defId: number;
|
|
4826
|
+
index: number;
|
|
4827
|
+
eye: number;
|
|
4828
|
+
};
|
|
4829
|
+
type PetCreatorLook = PetCreatorPet & {
|
|
4830
|
+
color1: number;
|
|
4831
|
+
color2: number;
|
|
4832
|
+
};
|
|
4318
4833
|
type PetCreatorColorState = {
|
|
4319
4834
|
current: number;
|
|
4320
4835
|
indexes: readonly number[];
|
|
@@ -4338,9 +4853,13 @@ declare class EditorApi {
|
|
|
4338
4853
|
isPetCreatorOpen(): Promise<boolean>;
|
|
4339
4854
|
petCreatorTab(): Promise<PetCreatorTab | null>;
|
|
4340
4855
|
openPetCreatorTab(tab: PetCreatorTab): Promise<boolean>;
|
|
4856
|
+
petCreatorPet(): Promise<PetCreatorPet | null>;
|
|
4341
4857
|
petCreatorColor(wheel: PetCreatorColorWheel): Promise<PetCreatorColorState | null>;
|
|
4342
4858
|
pickPetCreatorColor(wheel: PetCreatorColorWheel, index: number): Promise<boolean>;
|
|
4343
4859
|
onPetCreatorColorChange(listener: (tableId: number, index: number) => void): () => void;
|
|
4860
|
+
onPetCreatorPet(listener: (pet: PetCreatorPet) => void): () => void;
|
|
4861
|
+
petCreatorLook(): Promise<PetCreatorLook | null>;
|
|
4862
|
+
onPetCreatorLook(listener: (look: PetCreatorLook) => void): () => void;
|
|
4344
4863
|
onPetCreatorOpen(listener: () => void): () => void;
|
|
4345
4864
|
onPetCreatorClose(listener: (created: boolean) => void): () => void;
|
|
4346
4865
|
private avatarEditor;
|
|
@@ -4369,6 +4888,20 @@ type PopupClosed = {
|
|
|
4369
4888
|
message: string | null;
|
|
4370
4889
|
modal: boolean;
|
|
4371
4890
|
};
|
|
4891
|
+
type AutoAnswerRule = {
|
|
4892
|
+
choice: PopupAnswer;
|
|
4893
|
+
match: string | null;
|
|
4894
|
+
times: number | null;
|
|
4895
|
+
};
|
|
4896
|
+
type AutoAnswer = {
|
|
4897
|
+
match?: string;
|
|
4898
|
+
when?: (popup: Popup) => boolean;
|
|
4899
|
+
times?: number;
|
|
4900
|
+
};
|
|
4901
|
+
type PopupWait = {
|
|
4902
|
+
timeoutMs?: number;
|
|
4903
|
+
everyMs?: number;
|
|
4904
|
+
};
|
|
4372
4905
|
declare const OWN_POPUPS: {
|
|
4373
4906
|
readonly barrier: "_barrierPopup";
|
|
4374
4907
|
readonly daysRemaining: "_expiringDaysPopup";
|
|
@@ -4378,6 +4911,8 @@ declare const OWN_POPUPS: {
|
|
|
4378
4911
|
type OwnPopupName = keyof typeof OWN_POPUPS;
|
|
4379
4912
|
type LoginPopup = "newspaper" | "holidayBanner" | "adoptAPetIntro";
|
|
4380
4913
|
declare class PopupsApi {
|
|
4914
|
+
private readonly answering;
|
|
4915
|
+
private nextRule;
|
|
4381
4916
|
private readonly flash;
|
|
4382
4917
|
private readonly client;
|
|
4383
4918
|
private readonly loginSkips;
|
|
@@ -4388,8 +4923,14 @@ declare class PopupsApi {
|
|
|
4388
4923
|
answer(choice: PopupAnswer, match?: string): Promise<boolean>;
|
|
4389
4924
|
onOpen(listener: (popup: Popup) => void): () => void;
|
|
4390
4925
|
onClose(listener: (popup: PopupClosed) => void): () => void;
|
|
4926
|
+
waitFor(match?: string, options?: PopupWait): Promise<Popup | null>;
|
|
4927
|
+
autoAnswer(choice: PopupAnswer, options?: AutoAnswer): Promise<void>;
|
|
4928
|
+
stopAutoAnswering(choice?: PopupAnswer): Promise<number>;
|
|
4929
|
+
get autoAnswering(): AutoAnswerRule[];
|
|
4930
|
+
private endRule;
|
|
4391
4931
|
isOpen(popup: OwnPopupName): Promise<boolean>;
|
|
4392
4932
|
close(popup: OwnPopupName): Promise<boolean>;
|
|
4933
|
+
onOwn(popup: OwnPopupName, listener: (open: boolean) => void): () => void;
|
|
4393
4934
|
skipAtLogin(popups?: readonly LoginPopup[]): Promise<LoginPopup[]>;
|
|
4394
4935
|
stopSkippingAtLogin(): Promise<void>;
|
|
4395
4936
|
get skippingAtLogin(): LoginPopup[];
|
|
@@ -4429,10 +4970,14 @@ declare class ScreensApi {
|
|
|
4429
4970
|
private readonly flash;
|
|
4430
4971
|
private readonly client;
|
|
4431
4972
|
constructor(game: GameContext, flash: PhantomFlash);
|
|
4973
|
+
list(): ScreenName[];
|
|
4432
4974
|
isOpen(screen: ScreenName): Promise<boolean>;
|
|
4433
4975
|
close(screen: ScreenName): Promise<boolean>;
|
|
4434
4976
|
onOpen(screen: ScreenName, listener: () => void): () => void;
|
|
4435
4977
|
onClose(screen: ScreenName, listener: () => void): () => void;
|
|
4978
|
+
waitFor(screen: ScreenName, options?: {
|
|
4979
|
+
timeoutMs?: number;
|
|
4980
|
+
}): Promise<boolean>;
|
|
4436
4981
|
denSwitcherIndex(): Promise<number | null>;
|
|
4437
4982
|
serverName(shardId: number): Promise<string>;
|
|
4438
4983
|
private hookVoid;
|
|
@@ -4489,6 +5034,11 @@ type DenShopStand = {
|
|
|
4489
5034
|
storeInvId: number;
|
|
4490
5035
|
defId: number;
|
|
4491
5036
|
};
|
|
5037
|
+
type DenShopLine = DenShopListing & {
|
|
5038
|
+
ownerUserName: string;
|
|
5039
|
+
storeInvId: number;
|
|
5040
|
+
state: string;
|
|
5041
|
+
};
|
|
4492
5042
|
type DenShopUpdate = {
|
|
4493
5043
|
list?: Array<{
|
|
4494
5044
|
item: DenShopItem;
|
|
@@ -4515,6 +5065,7 @@ declare class DenShopApi {
|
|
|
4515
5065
|
onBuy(listener: (purchase: DenShopPurchaseEvent) => void): Unsubscribe;
|
|
4516
5066
|
onSale(listener: (sale: DenShopSale) => void): Unsubscribe;
|
|
4517
5067
|
inDen(): Promise<DenShopStand[]>;
|
|
5068
|
+
forSale(timeoutMs?: number): Promise<DenShopLine[]>;
|
|
4518
5069
|
update(storeInvId: number, state: string, { list, unlist }: DenShopUpdate, timeoutMs?: number): Promise<DenShopChange>;
|
|
4519
5070
|
private isMe;
|
|
4520
5071
|
private send;
|
|
@@ -4772,6 +5323,10 @@ declare class DensApi {
|
|
|
4772
5323
|
ecoScore: number;
|
|
4773
5324
|
}>;
|
|
4774
5325
|
items(): Promise<DenPlacedItem[]>;
|
|
5326
|
+
itemAt(point: {
|
|
5327
|
+
x: number;
|
|
5328
|
+
y: number;
|
|
5329
|
+
}): Promise<DenPlacedItem | null>;
|
|
4775
5330
|
placement(): Promise<DenPlacement | null>;
|
|
4776
5331
|
moveItem(item: Pick<DenPlacedItem, "refId" | "invIdx">, placement: DenItemPlacement): Promise<boolean>;
|
|
4777
5332
|
inventory(timeoutMs?: number): Promise<DenInventoryItem[]>;
|
|
@@ -4817,6 +5372,7 @@ declare class DensApi {
|
|
|
4817
5372
|
heldDenShop(storeInvId: number): Promise<HeldDenShop | null>;
|
|
4818
5373
|
private placedItems;
|
|
4819
5374
|
private placedItem;
|
|
5375
|
+
private denItemFrom;
|
|
4820
5376
|
private ownedItems;
|
|
4821
5377
|
private findOwnedItem;
|
|
4822
5378
|
private readOwnedItem;
|
|
@@ -4866,6 +5422,16 @@ type ClientJamAGram = {
|
|
|
4866
5422
|
stampMediaId: number;
|
|
4867
5423
|
specialType: number;
|
|
4868
5424
|
};
|
|
5425
|
+
type JamAGramComposing = {
|
|
5426
|
+
toUserName: string;
|
|
5427
|
+
toModeratedUserName: string;
|
|
5428
|
+
message: string;
|
|
5429
|
+
messageType: number;
|
|
5430
|
+
cardMediaId: number;
|
|
5431
|
+
stampMediaId: number;
|
|
5432
|
+
type: number;
|
|
5433
|
+
giftInvId: number;
|
|
5434
|
+
};
|
|
4869
5435
|
declare class ECardsApi {
|
|
4870
5436
|
readonly [STATE_FIELDS]: readonly [
|
|
4871
5437
|
"cards",
|
|
@@ -4911,6 +5477,8 @@ declare class ECardsApi {
|
|
|
4911
5477
|
clientInbox(): Promise<ClientJamAGram[]>;
|
|
4912
5478
|
clientInboxLoaded(): Promise<boolean>;
|
|
4913
5479
|
openComposer(userName: string, moderatedUserName?: string): Promise<void>;
|
|
5480
|
+
draft(): Promise<JamAGramComposing | null>;
|
|
5481
|
+
reading(): Promise<JamAGram | null>;
|
|
4914
5482
|
closeInbox(): Promise<void>;
|
|
4915
5483
|
isComposerOpen(): Promise<boolean>;
|
|
4916
5484
|
onReceived(listener: (card: JamAGram) => void): Unsubscribe;
|
|
@@ -4948,11 +5516,27 @@ declare const TYPES: {
|
|
|
4948
5516
|
readonly work: "TYPE_WORK";
|
|
4949
5517
|
};
|
|
4950
5518
|
type FeedbackType = keyof typeof TYPES;
|
|
5519
|
+
type FeedbackTopic = {
|
|
5520
|
+
id: number;
|
|
5521
|
+
type: FeedbackType | null;
|
|
5522
|
+
title: string;
|
|
5523
|
+
prompt: string;
|
|
5524
|
+
thanks: string;
|
|
5525
|
+
allowsImage: boolean;
|
|
5526
|
+
seen: boolean;
|
|
5527
|
+
};
|
|
4951
5528
|
declare class FeedbackApi {
|
|
4952
5529
|
private readonly flash;
|
|
4953
|
-
|
|
5530
|
+
private readonly typed;
|
|
5531
|
+
constructor(game: GameContext, typed?: PhantomFlash);
|
|
4954
5532
|
types(): Promise<Record<FeedbackType, number>>;
|
|
4955
5533
|
maxLength(type: FeedbackType | number): Promise<number>;
|
|
5534
|
+
topics(): Promise<FeedbackTopic[]>;
|
|
5535
|
+
open(type: FeedbackType | number): Promise<void>;
|
|
5536
|
+
onOpen(listener: (opened: {
|
|
5537
|
+
id: number;
|
|
5538
|
+
type: FeedbackType | null;
|
|
5539
|
+
}) => void): () => void;
|
|
4956
5540
|
isOpen(): Promise<boolean>;
|
|
4957
5541
|
close(): Promise<void>;
|
|
4958
5542
|
}
|
|
@@ -5007,6 +5591,16 @@ type GuiClick = {
|
|
|
5007
5591
|
dispatched: readonly string[];
|
|
5008
5592
|
handled: boolean;
|
|
5009
5593
|
};
|
|
5594
|
+
type GuiWait = {
|
|
5595
|
+
timeoutMs?: number;
|
|
5596
|
+
everyMs?: number;
|
|
5597
|
+
};
|
|
5598
|
+
type GuiEvent = {
|
|
5599
|
+
type: string;
|
|
5600
|
+
stageX: number;
|
|
5601
|
+
stageY: number;
|
|
5602
|
+
raw: Record<string, FlashValue>;
|
|
5603
|
+
};
|
|
5010
5604
|
declare const SCREENS: {
|
|
5011
5605
|
readonly avatarEditor: {
|
|
5012
5606
|
readonly method: "openAvatarEditor";
|
|
@@ -5166,6 +5760,9 @@ declare class GuiApi {
|
|
|
5166
5760
|
clickHud(part: HudPart | string): Promise<GuiClick>;
|
|
5167
5761
|
chatBox(): Promise<string>;
|
|
5168
5762
|
setChatBox(text: string): Promise<void>;
|
|
5763
|
+
onChatBox(listener: (text: string) => void, options?: {
|
|
5764
|
+
everyFrames?: number;
|
|
5765
|
+
}): () => void;
|
|
5169
5766
|
chatHistory(): Promise<string[]>;
|
|
5170
5767
|
closeChatPanel(): Promise<void>;
|
|
5171
5768
|
freeChatEnabled(): Promise<boolean>;
|
|
@@ -5187,6 +5784,9 @@ declare class GuiApi {
|
|
|
5187
5784
|
pinCurrency(): Promise<void>;
|
|
5188
5785
|
unpinCurrency(): Promise<void>;
|
|
5189
5786
|
get currencyPinned(): boolean;
|
|
5787
|
+
waitFor(query: GuiQuery, options?: GuiWait): Promise<GuiElement | null>;
|
|
5788
|
+
on(target: GuiTarget, event: string, listener: (event: GuiEvent) => void): () => void;
|
|
5789
|
+
hover(target: GuiTarget, over?: boolean): Promise<boolean>;
|
|
5190
5790
|
private rollCurrency;
|
|
5191
5791
|
private chatField;
|
|
5192
5792
|
private setFieldText;
|
|
@@ -5201,16 +5801,252 @@ declare class GuiApi {
|
|
|
5201
5801
|
private onElement;
|
|
5202
5802
|
private rootPlace;
|
|
5203
5803
|
}
|
|
5204
|
-
type
|
|
5205
|
-
invId: number;
|
|
5804
|
+
type ItemDefinition = {
|
|
5206
5805
|
defId: number;
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5806
|
+
name: string;
|
|
5807
|
+
titleStrId: number;
|
|
5808
|
+
cost: number;
|
|
5809
|
+
currencyType: number;
|
|
5810
|
+
combinedCost: string;
|
|
5811
|
+
membersOnly: boolean;
|
|
5812
|
+
recycleValue: number;
|
|
5813
|
+
type: number;
|
|
5814
|
+
enviroType: number;
|
|
5815
|
+
colors: number[];
|
|
5816
|
+
layerId: number;
|
|
5817
|
+
accId: number;
|
|
5818
|
+
avatarUseFlag: number;
|
|
5819
|
+
itemStatus: number;
|
|
5820
|
+
isNew: boolean;
|
|
5821
|
+
isOnSale: boolean;
|
|
5822
|
+
isGiftable: boolean;
|
|
5823
|
+
availabilityStartTime: number;
|
|
5824
|
+
availabilityEndTime: number;
|
|
5825
|
+
combat: ItemCombat;
|
|
5826
|
+
};
|
|
5827
|
+
type ItemCombat = {
|
|
5828
|
+
attack: number;
|
|
5829
|
+
defense: number;
|
|
5830
|
+
attackMediaRefId: number;
|
|
5831
|
+
combatType: number;
|
|
5832
|
+
modifierType: number;
|
|
5833
|
+
modifierValue: number;
|
|
5834
|
+
criticalHit: number;
|
|
5835
|
+
};
|
|
5836
|
+
type ShopOffering = {
|
|
5837
|
+
shopId: number;
|
|
5838
|
+
listType: number;
|
|
5839
|
+
titleStrId: number | null;
|
|
5840
|
+
diamondBundle: boolean;
|
|
5841
|
+
diamondCost: number;
|
|
5842
|
+
items: ItemDefinition[];
|
|
5843
|
+
unknownDefIds: number[];
|
|
5844
|
+
};
|
|
5845
|
+
type ShopListing = {
|
|
5846
|
+
shopId: number;
|
|
5847
|
+
listType: number;
|
|
5848
|
+
defIds: number[];
|
|
5849
|
+
};
|
|
5850
|
+
type OpenShop = {
|
|
5851
|
+
shopId: number;
|
|
5852
|
+
listType: number;
|
|
5853
|
+
windowClass: string;
|
|
5854
|
+
itemCount: number;
|
|
5855
|
+
selectedIndex: number | null;
|
|
5856
|
+
selectedDefId: number | null;
|
|
5857
|
+
selectedDiamond: boolean | null;
|
|
5858
|
+
selectedColorIndex: number;
|
|
5859
|
+
};
|
|
5860
|
+
type ShopLimits = {
|
|
5861
|
+
items: number;
|
|
5862
|
+
denItems: number;
|
|
5863
|
+
audioItems: number;
|
|
5864
|
+
warnItems: number;
|
|
5865
|
+
warnDenItems: number;
|
|
5866
|
+
warnAudioItems: number;
|
|
5867
|
+
warnDenRooms: number;
|
|
5868
|
+
denShopItems: number;
|
|
5869
|
+
};
|
|
5870
|
+
type ItemPictureKind = "clothing" | "den-item";
|
|
5871
|
+
type ItemPictureItem = number | {
|
|
5872
|
+
defId: number;
|
|
5873
|
+
kind?: ItemPictureKind;
|
|
5874
|
+
color?: number;
|
|
5875
|
+
};
|
|
5876
|
+
type ItemPictureOptions = {
|
|
5877
|
+
scale?: number;
|
|
5878
|
+
background?: number | null;
|
|
5879
|
+
maxSize?: number;
|
|
5880
|
+
large?: boolean;
|
|
5881
|
+
version?: number;
|
|
5882
|
+
timeoutMs?: number;
|
|
5883
|
+
cache?: boolean;
|
|
5884
|
+
};
|
|
5885
|
+
type ItemRarity = "normal" | "new" | "sale" | "clearance" | "rare";
|
|
5886
|
+
type ItemSummary = {
|
|
5887
|
+
defId: number;
|
|
5888
|
+
kind: ItemPictureKind;
|
|
5889
|
+
name: string;
|
|
5890
|
+
rarity: ItemRarity;
|
|
5891
|
+
cost: number;
|
|
5892
|
+
currencyType: number;
|
|
5893
|
+
membersOnly: boolean;
|
|
5894
|
+
forSale: boolean;
|
|
5895
|
+
picture: string | null;
|
|
5896
|
+
};
|
|
5897
|
+
type ItemSummaryOptions = {
|
|
5898
|
+
kind?: ItemPictureKind;
|
|
5899
|
+
picture?: boolean | ItemPictureOptions;
|
|
5900
|
+
};
|
|
5901
|
+
type ItemSummariesOptions = ItemSummaryOptions & {
|
|
5902
|
+
atOnce?: number;
|
|
5903
|
+
};
|
|
5904
|
+
type DenShopOffering = {
|
|
5905
|
+
shopId: number;
|
|
5906
|
+
listType: number;
|
|
5907
|
+
items: DenItemDefinition[];
|
|
5908
|
+
unknownDefIds: number[];
|
|
5909
|
+
};
|
|
5910
|
+
type DiamondItem = {
|
|
5911
|
+
defId: number;
|
|
5912
|
+
value: number;
|
|
5913
|
+
type: number;
|
|
5914
|
+
refDefId: number;
|
|
5915
|
+
status: number;
|
|
5916
|
+
isNew: boolean;
|
|
5917
|
+
isOnSale: boolean;
|
|
5918
|
+
isOnClearance: boolean;
|
|
5919
|
+
isRare: boolean;
|
|
5920
|
+
isAvailable: boolean;
|
|
5921
|
+
availabilityEndTime: number;
|
|
5922
|
+
startTime: number;
|
|
5923
|
+
};
|
|
5924
|
+
type DiamondDefinition = {
|
|
5925
|
+
defId: number;
|
|
5926
|
+
value: number;
|
|
5927
|
+
refDefId: number;
|
|
5928
|
+
type: number;
|
|
5929
|
+
status: number;
|
|
5930
|
+
availabilityStartTime: number;
|
|
5931
|
+
availabilityEndTime: number;
|
|
5932
|
+
};
|
|
5933
|
+
type DiamondShopItem = {
|
|
5934
|
+
diamondDefId: number;
|
|
5935
|
+
defId: number | null;
|
|
5936
|
+
itemClass: string | null;
|
|
5937
|
+
};
|
|
5938
|
+
type DiamondShopList = {
|
|
5939
|
+
items: DiamondShopItem[];
|
|
5940
|
+
unknownDefIds: number[];
|
|
5941
|
+
};
|
|
5942
|
+
type Purchase = {
|
|
5943
|
+
defId: number;
|
|
5944
|
+
shopId: number;
|
|
5945
|
+
status: number;
|
|
5946
|
+
balance: number | null;
|
|
5947
|
+
currencyType: number;
|
|
5948
|
+
};
|
|
5949
|
+
type Sale = {
|
|
5950
|
+
invIds: number[];
|
|
5951
|
+
gems: number | null;
|
|
5952
|
+
};
|
|
5953
|
+
declare class ShopsApi {
|
|
5954
|
+
readonly [STATE_FIELDS]: readonly [
|
|
5955
|
+
"lists"
|
|
5956
|
+
];
|
|
5957
|
+
private readonly flash;
|
|
5958
|
+
private readonly client;
|
|
5959
|
+
private readonly server;
|
|
5960
|
+
private readonly lists;
|
|
5961
|
+
private readonly pictures;
|
|
5962
|
+
constructor(game: GameContext, flash: PhantomFlash);
|
|
5963
|
+
offering(shopId: number, { refresh, timeoutMs, }?: {
|
|
5964
|
+
refresh?: boolean;
|
|
5965
|
+
timeoutMs?: number;
|
|
5966
|
+
}): Promise<ShopOffering>;
|
|
5967
|
+
denOffering(shopId: number, { refresh, timeoutMs, }?: {
|
|
5968
|
+
refresh?: boolean;
|
|
5969
|
+
timeoutMs?: number;
|
|
5970
|
+
}): Promise<DenShopOffering>;
|
|
5971
|
+
definition(defId: number): Promise<ItemDefinition | null>;
|
|
5972
|
+
definitionsReady(): Promise<boolean>;
|
|
5973
|
+
picture(item: ItemPictureItem, options?: ItemPictureOptions): Promise<string>;
|
|
5974
|
+
isAvailable(window: {
|
|
5975
|
+
availabilityStartTime: number;
|
|
5976
|
+
availabilityEndTime: number;
|
|
5977
|
+
}): Promise<boolean>;
|
|
5978
|
+
item(defId: number, options?: ItemSummaryOptions): Promise<ItemSummary | null>;
|
|
5979
|
+
items(defIds: readonly number[], options?: ItemSummariesOptions): Promise<Array<ItemSummary | null>>;
|
|
5980
|
+
forSale(shopId: number, options?: {
|
|
5981
|
+
refresh?: boolean;
|
|
5982
|
+
timeoutMs?: number;
|
|
5983
|
+
}): Promise<ItemDefinition[]>;
|
|
5984
|
+
whenDefinitionsReady(options?: {
|
|
5985
|
+
timeoutMs?: number;
|
|
5986
|
+
}): Promise<void>;
|
|
5987
|
+
diamondItem(defId: number): Promise<DiamondItem | null>;
|
|
5988
|
+
diamondDefinition(entry: number | {
|
|
5989
|
+
refDefId: number;
|
|
5990
|
+
type: number;
|
|
5991
|
+
}): Promise<DiamondDefinition | null>;
|
|
5992
|
+
diamondList(defIds: number[]): Promise<DiamondShopList>;
|
|
5993
|
+
listType(shopId: number): Promise<number | null>;
|
|
5994
|
+
knownShops(): Promise<Array<{
|
|
5995
|
+
shopId: number;
|
|
5996
|
+
listType: number;
|
|
5997
|
+
}>>;
|
|
5998
|
+
open(shopId: number): Promise<void>;
|
|
5999
|
+
close(): Promise<void>;
|
|
6000
|
+
isOpen(): Promise<boolean>;
|
|
6001
|
+
openShop(): Promise<OpenShop | null>;
|
|
6002
|
+
limits(): Promise<ShopLimits>;
|
|
6003
|
+
onOpen(listener: (opened: {
|
|
6004
|
+
shopId: number;
|
|
6005
|
+
listType: number;
|
|
6006
|
+
}) => void): () => void;
|
|
6007
|
+
onClose(listener: (closed: {
|
|
6008
|
+
bought: boolean;
|
|
6009
|
+
}) => void): () => void;
|
|
6010
|
+
buyDiamondBundle(timeoutMs?: number): Promise<{
|
|
6011
|
+
bought: boolean;
|
|
6012
|
+
balance: number | null;
|
|
6013
|
+
}>;
|
|
6014
|
+
buy(defId: number, { shopId, colorIndex, diamond, forDenItem, timeoutMs, }: {
|
|
6015
|
+
shopId: number;
|
|
6016
|
+
colorIndex?: number;
|
|
6017
|
+
diamond?: boolean;
|
|
6018
|
+
forDenItem?: {
|
|
6019
|
+
invId: number;
|
|
6020
|
+
userName: string;
|
|
6021
|
+
};
|
|
6022
|
+
timeoutMs?: number;
|
|
6023
|
+
}): Promise<Purchase>;
|
|
6024
|
+
sell(...invIds: number[]): Promise<Sale>;
|
|
6025
|
+
onBuy(listener: (purchase: Purchase) => void): Unsubscribe;
|
|
6026
|
+
onSell(listener: (sale: Sale) => void): Unsubscribe;
|
|
6027
|
+
onList(listener: (listing: ShopListing) => void): Unsubscribe;
|
|
6028
|
+
onDiamondBundleBuy(listener: (result: {
|
|
6029
|
+
bought: boolean;
|
|
6030
|
+
balance: number | null;
|
|
6031
|
+
}) => void): Unsubscribe;
|
|
6032
|
+
private definitionsLoaded;
|
|
6033
|
+
private drawClothing;
|
|
6034
|
+
private drawDenItem;
|
|
6035
|
+
private listFor;
|
|
6036
|
+
}
|
|
6037
|
+
type InventoryItem = {
|
|
6038
|
+
invId: number;
|
|
6039
|
+
defId: number;
|
|
6040
|
+
color: number;
|
|
6041
|
+
wornOn: number[];
|
|
6042
|
+
denStoreInvId: number;
|
|
6043
|
+
};
|
|
6044
|
+
type ItemPlace = "worn" | "den-shop" | "inventory";
|
|
6045
|
+
type OwnedItem = InventoryItem & {
|
|
6046
|
+
where: ItemPlace;
|
|
6047
|
+
};
|
|
6048
|
+
type DescribedItem = OwnedItem & {
|
|
6049
|
+
definition: ItemDefinition | null;
|
|
5214
6050
|
};
|
|
5215
6051
|
type OwnedFilter = {
|
|
5216
6052
|
defId?: number | number[];
|
|
@@ -5238,11 +6074,19 @@ type ItemPrizeOffer = {
|
|
|
5238
6074
|
nameStrId: number;
|
|
5239
6075
|
descStrId: number;
|
|
5240
6076
|
};
|
|
6077
|
+
type ItemHolding = {
|
|
6078
|
+
owned: boolean;
|
|
6079
|
+
count: number;
|
|
6080
|
+
worn: number;
|
|
6081
|
+
spare: number;
|
|
6082
|
+
items: OwnedItem[];
|
|
6083
|
+
};
|
|
5241
6084
|
type RecycleResult = {
|
|
5242
6085
|
recycled: number[];
|
|
5243
6086
|
gems: number | null;
|
|
5244
6087
|
};
|
|
5245
6088
|
declare class InventoryApi {
|
|
6089
|
+
private readonly areas;
|
|
5246
6090
|
readonly [STATE_FIELDS]: readonly [
|
|
5247
6091
|
"inventory",
|
|
5248
6092
|
"slots",
|
|
@@ -5256,14 +6100,22 @@ declare class InventoryApi {
|
|
|
5256
6100
|
private readonly slotListeners;
|
|
5257
6101
|
private readonly prizeListeners;
|
|
5258
6102
|
private prize;
|
|
5259
|
-
constructor(game: GameContext)
|
|
6103
|
+
constructor(game: GameContext, areas: () => {
|
|
6104
|
+
shops: ShopsApi;
|
|
6105
|
+
});
|
|
5260
6106
|
items({ refresh }?: {
|
|
5261
6107
|
refresh?: boolean;
|
|
5262
6108
|
}): Promise<InventoryItem[]>;
|
|
5263
6109
|
owned({ defId, color, where, refresh }?: OwnedFilter): Promise<OwnedItem[]>;
|
|
6110
|
+
describe(filter?: OwnedFilter): Promise<DescribedItem[]>;
|
|
6111
|
+
private shops;
|
|
5264
6112
|
worn({ refresh }?: {
|
|
5265
6113
|
refresh?: boolean;
|
|
5266
6114
|
}): Promise<OwnedItem[]>;
|
|
6115
|
+
have(defId: number, { color, refresh }?: {
|
|
6116
|
+
color?: number;
|
|
6117
|
+
refresh?: boolean;
|
|
6118
|
+
}): Promise<ItemHolding>;
|
|
5267
6119
|
canWear(defId: number, { custom }?: {
|
|
5268
6120
|
custom?: boolean;
|
|
5269
6121
|
}): Promise<boolean>;
|
|
@@ -5295,6 +6147,19 @@ declare class InventoryApi {
|
|
|
5295
6147
|
private apply;
|
|
5296
6148
|
}
|
|
5297
6149
|
type Language = "english" | "spanish" | "portuguese" | "french" | "german" | "none";
|
|
6150
|
+
declare const WORDS: {
|
|
6151
|
+
readonly gems: "GEMS_CAPITALIZED";
|
|
6152
|
+
readonly gem: "GEM_CAPITALIZED";
|
|
6153
|
+
readonly diamonds: "DIAMONDS_CAPITALIZED";
|
|
6154
|
+
readonly diamond: "DIAMOND_CAPITALIZED";
|
|
6155
|
+
readonly crystals: "CRYSTALS_CAPITALIZED";
|
|
6156
|
+
readonly crystal: "CRYSTAL_CAPITALIZED";
|
|
6157
|
+
readonly tickets: "TICKETS_CAPITALIZED";
|
|
6158
|
+
readonly ticket: "TICKET_CAPITALIZED";
|
|
6159
|
+
readonly members: "MEMBERS";
|
|
6160
|
+
readonly newJammerName: "NEW_JAMMER_USERNAME";
|
|
6161
|
+
};
|
|
6162
|
+
type GameWord = keyof typeof WORDS;
|
|
5298
6163
|
type LocalizedText = {
|
|
5299
6164
|
text: string;
|
|
5300
6165
|
isHtmlNormal: boolean;
|
|
@@ -5305,6 +6170,7 @@ declare class LocalizationApi {
|
|
|
5305
6170
|
private readonly bridge;
|
|
5306
6171
|
private readonly flash;
|
|
5307
6172
|
private codes;
|
|
6173
|
+
private wordCodes;
|
|
5308
6174
|
constructor(game: GameContext, flash: PhantomFlash);
|
|
5309
6175
|
currentLanguage(): Promise<Language>;
|
|
5310
6176
|
accountLanguage(): Promise<Language>;
|
|
@@ -5314,6 +6180,9 @@ declare class LocalizationApi {
|
|
|
5314
6180
|
countryCode(): Promise<string>;
|
|
5315
6181
|
hasLocalizations(): Promise<boolean>;
|
|
5316
6182
|
translate(id: number): Promise<string>;
|
|
6183
|
+
translateAll(ids: readonly number[]): Promise<string[]>;
|
|
6184
|
+
word(name: GameWord): Promise<string>;
|
|
6185
|
+
words(): GameWord[];
|
|
5317
6186
|
translatePreferred(id: number): Promise<string>;
|
|
5318
6187
|
translateWithValues(id: number, ...values: string[]): Promise<string>;
|
|
5319
6188
|
translateAvatarName(name: string): Promise<string>;
|
|
@@ -5324,8 +6193,16 @@ declare class LocalizationApi {
|
|
|
5324
6193
|
languageId(language: Language): Promise<number>;
|
|
5325
6194
|
onLanguageChange(listener: (language: Language) => void): () => void;
|
|
5326
6195
|
onReady(listener: () => void): () => void;
|
|
6196
|
+
private wordIds;
|
|
5327
6197
|
private languageCodes;
|
|
5328
6198
|
}
|
|
6199
|
+
type MasterpiecePictureOptions = {
|
|
6200
|
+
scale?: number;
|
|
6201
|
+
background?: number | null;
|
|
6202
|
+
maxSize?: number;
|
|
6203
|
+
timeoutMs?: number;
|
|
6204
|
+
cache?: boolean;
|
|
6205
|
+
};
|
|
5329
6206
|
type Masterpiece = DenMasterpieceItem;
|
|
5330
6207
|
type MasterpieceList = {
|
|
5331
6208
|
userName: string | null;
|
|
@@ -5356,6 +6233,7 @@ declare class MasterpiecesApi {
|
|
|
5356
6233
|
private readonly creatorsAsked;
|
|
5357
6234
|
private readonly likesAsked;
|
|
5358
6235
|
private readonly likesGiven;
|
|
6236
|
+
private readonly pictures;
|
|
5359
6237
|
private readonly itemsListeners;
|
|
5360
6238
|
private readonly creatorListeners;
|
|
5361
6239
|
private readonly likesListeners;
|
|
@@ -5365,6 +6243,8 @@ declare class MasterpiecesApi {
|
|
|
5365
6243
|
creatorOf(denUserName: string, uniqueImageId: string, timeoutMs?: number): Promise<string>;
|
|
5366
6244
|
likes(uniqueImageId: string, timeoutMs?: number): Promise<MasterpieceLikes>;
|
|
5367
6245
|
like(masterpiece: LikeableMasterpiece, timeoutMs?: number): Promise<boolean>;
|
|
6246
|
+
picture(uniqueImageId: string, options?: MasterpiecePictureOptions): Promise<string>;
|
|
6247
|
+
private draw;
|
|
5368
6248
|
onItems(listener: (list: MasterpieceList) => void): Unsubscribe;
|
|
5369
6249
|
onCreator(listener: (creator: MasterpieceCreator) => void): Unsubscribe;
|
|
5370
6250
|
onLikes(listener: (likes: MasterpieceLikesEvent) => void): Unsubscribe;
|
|
@@ -5629,6 +6509,18 @@ type MinigamePlayerInfo = {
|
|
|
5629
6509
|
activePetName: string;
|
|
5630
6510
|
member: boolean;
|
|
5631
6511
|
};
|
|
6512
|
+
type MinigameRound = {
|
|
6513
|
+
gameDefId: number | null;
|
|
6514
|
+
name: string;
|
|
6515
|
+
score: number | null;
|
|
6516
|
+
gems: number | null;
|
|
6517
|
+
ended: boolean;
|
|
6518
|
+
data: readonly string[];
|
|
6519
|
+
at: number;
|
|
6520
|
+
};
|
|
6521
|
+
type MinigameRoundOptions = {
|
|
6522
|
+
settleMs?: number;
|
|
6523
|
+
};
|
|
5632
6524
|
type MinigameJoinOptions = {
|
|
5633
6525
|
multiplayer?: boolean;
|
|
5634
6526
|
proModeId?: number;
|
|
@@ -5720,6 +6612,7 @@ declare class MinigamesApi {
|
|
|
5720
6612
|
onGemAward(listener: (sent: MinigameAwardSent) => void): Unsubscribe;
|
|
5721
6613
|
onPetMasteryAward(listener: (sent: MinigameAwardSent) => void): Unsubscribe;
|
|
5722
6614
|
onScore(listener: (sent: MinigameScoreSent) => void): Unsubscribe;
|
|
6615
|
+
onRound(listener: (round: MinigameRound) => void, options?: MinigameRoundOptions): Unsubscribe;
|
|
5723
6616
|
quit(): Promise<void>;
|
|
5724
6617
|
playerInfo(): Promise<MinigamePlayerInfo>;
|
|
5725
6618
|
gameNameId(gameDefId: number): Promise<number | null>;
|
|
@@ -5754,6 +6647,12 @@ type ShownMembership = {
|
|
|
5754
6647
|
member: boolean;
|
|
5755
6648
|
daysLeft: number;
|
|
5756
6649
|
};
|
|
6650
|
+
type MembershipUpsell = {
|
|
6651
|
+
page: string;
|
|
6652
|
+
reason: string;
|
|
6653
|
+
subject: string | null;
|
|
6654
|
+
roomName: string | null;
|
|
6655
|
+
};
|
|
5757
6656
|
declare class MembershipApi {
|
|
5758
6657
|
readonly [STATE_FIELDS]: readonly [
|
|
5759
6658
|
"heard"
|
|
@@ -5764,17 +6663,28 @@ declare class MembershipApi {
|
|
|
5764
6663
|
private questRoom;
|
|
5765
6664
|
private readonly changeListeners;
|
|
5766
6665
|
private readonly lookListeners;
|
|
6666
|
+
private readonly upsellListeners;
|
|
6667
|
+
private upsellHook;
|
|
6668
|
+
private upsellsOff;
|
|
5767
6669
|
private readonly flash;
|
|
6670
|
+
private readonly typedFlash;
|
|
5768
6671
|
private readonly server;
|
|
5769
6672
|
private readonly client;
|
|
5770
|
-
constructor(game: GameContext);
|
|
6673
|
+
constructor(game: GameContext, flash: PhantomFlash);
|
|
5771
6674
|
get real(): Membership | null;
|
|
5772
6675
|
onChange(listener: (membership: Membership) => void): Unsubscribe;
|
|
6676
|
+
watch(listener: (membership: Membership) => void): Unsubscribe;
|
|
5773
6677
|
shown(): Promise<ShownMembership>;
|
|
5774
6678
|
get showing(): MembershipLook | null;
|
|
5775
6679
|
onShowing(listener: (look: MembershipLook | null) => void): Unsubscribe;
|
|
5776
6680
|
show(options?: MembershipLookOptions): Promise<MembershipLook>;
|
|
5777
6681
|
stopShowing(): Promise<void>;
|
|
6682
|
+
onUpsell(listener: (upsell: MembershipUpsell) => void): Unsubscribe;
|
|
6683
|
+
get upsellsHidden(): boolean;
|
|
6684
|
+
hideUpsells(hide?: boolean): Promise<boolean>;
|
|
6685
|
+
private upsellOptions;
|
|
6686
|
+
private syncUpsellHook;
|
|
6687
|
+
private tellUpsellListeners;
|
|
5778
6688
|
private hear;
|
|
5779
6689
|
private hook;
|
|
5780
6690
|
private rewriteLogin;
|
|
@@ -5798,12 +6708,20 @@ type NewspaperReadState = {
|
|
|
5798
6708
|
defId: number;
|
|
5799
6709
|
timeSeen: number;
|
|
5800
6710
|
};
|
|
6711
|
+
type AvailableNewspaperIssue = NewspaperIssue & {
|
|
6712
|
+
available: boolean;
|
|
6713
|
+
viewable: boolean;
|
|
6714
|
+
inCountry: boolean;
|
|
6715
|
+
};
|
|
5801
6716
|
declare class NewspaperApi {
|
|
5802
6717
|
private readonly flash;
|
|
5803
6718
|
private readonly server;
|
|
5804
6719
|
private readonly seenListeners;
|
|
5805
6720
|
constructor(game: GameContext);
|
|
5806
6721
|
definitions(): Promise<NewspaperIssue[]>;
|
|
6722
|
+
available(): Promise<AvailableNewspaperIssue[]>;
|
|
6723
|
+
reading(): Promise<NewspaperIssue | null>;
|
|
6724
|
+
close(): Promise<void>;
|
|
5807
6725
|
definition(defId: number): Promise<NewspaperIssue | null>;
|
|
5808
6726
|
dataOf(defId: number): Promise<NewspaperReadState | null>;
|
|
5809
6727
|
hasUnseenPages(): Promise<boolean>;
|
|
@@ -5813,6 +6731,16 @@ declare class NewspaperApi {
|
|
|
5813
6731
|
onPageSeen(listener: (seen: PacketOf<typeof NewspaperPageSeen>) => void): () => void;
|
|
5814
6732
|
private readIssue;
|
|
5815
6733
|
}
|
|
6734
|
+
type PetInWorld = {
|
|
6735
|
+
name: string;
|
|
6736
|
+
defId: number;
|
|
6737
|
+
createdTs: number;
|
|
6738
|
+
position: Point;
|
|
6739
|
+
visible: boolean;
|
|
6740
|
+
ground: boolean;
|
|
6741
|
+
moving: boolean;
|
|
6742
|
+
unhatchedEgg: boolean;
|
|
6743
|
+
};
|
|
5816
6744
|
type PlayerPet = {
|
|
5817
6745
|
invId: number;
|
|
5818
6746
|
name: string;
|
|
@@ -5827,6 +6755,16 @@ type PlayerPet = {
|
|
|
5827
6755
|
favoriteFoodDefId: number;
|
|
5828
6756
|
denStoreInvId: number;
|
|
5829
6757
|
};
|
|
6758
|
+
type OwnedPet = PlayerPet & {
|
|
6759
|
+
kind: string;
|
|
6760
|
+
out: boolean;
|
|
6761
|
+
};
|
|
6762
|
+
type PetRoster = {
|
|
6763
|
+
pets: OwnedPet[];
|
|
6764
|
+
out: OwnedPet | null;
|
|
6765
|
+
max: number;
|
|
6766
|
+
room: number;
|
|
6767
|
+
};
|
|
5830
6768
|
type PetDefinition = {
|
|
5831
6769
|
defId: number;
|
|
5832
6770
|
title: string;
|
|
@@ -5986,6 +6924,7 @@ declare class PetsApi {
|
|
|
5986
6924
|
activeName(): Promise<string>;
|
|
5987
6925
|
get(invId: number): Promise<PlayerPet | null>;
|
|
5988
6926
|
max(): Promise<number>;
|
|
6927
|
+
mine(): Promise<PetRoster>;
|
|
5989
6928
|
kindName(defId: number): Promise<string>;
|
|
5990
6929
|
kindId(name: string): Promise<number>;
|
|
5991
6930
|
definition(defId: number): Promise<PetDefinition | null>;
|
|
@@ -6095,6 +7034,7 @@ declare class PetsApi {
|
|
|
6095
7034
|
onAdoptionChecklist(listener: (checklist: AdoptionChecklist) => void): () => void;
|
|
6096
7035
|
onAdoptionCount(listener: (count: number) => void): () => void;
|
|
6097
7036
|
onDefinitionsLoaded(listener: () => void): () => void;
|
|
7037
|
+
inWorld(): Promise<PetInWorld | null>;
|
|
6098
7038
|
}
|
|
6099
7039
|
type CachedWall = {
|
|
6100
7040
|
posts: WallPost[];
|
|
@@ -6130,6 +7070,10 @@ type WallPost = {
|
|
|
6130
7070
|
patternId: number;
|
|
6131
7071
|
localizationId: number;
|
|
6132
7072
|
};
|
|
7073
|
+
type WallThreadPost = WallPost & {
|
|
7074
|
+
text: string;
|
|
7075
|
+
replies: WallThreadPost[];
|
|
7076
|
+
};
|
|
6133
7077
|
type WallContents = {
|
|
6134
7078
|
owner: string;
|
|
6135
7079
|
posts: WallPost[];
|
|
@@ -6239,11 +7183,19 @@ declare class PlayerWallApi {
|
|
|
6239
7183
|
hiddenPostIds(): Promise<string[]>;
|
|
6240
7184
|
permissions(userName: string): Promise<WallPermissions>;
|
|
6241
7185
|
showPostAs(msgId: string, text: string): Promise<void>;
|
|
7186
|
+
serviceRequest(command: string, fields?: {
|
|
7187
|
+
[key: string]: WallValue;
|
|
7188
|
+
}, userName?: string): Promise<void>;
|
|
7189
|
+
private tokenFor;
|
|
6242
7190
|
private readPosts;
|
|
6243
7191
|
private asList;
|
|
6244
7192
|
private readPost;
|
|
6245
7193
|
private buildPost;
|
|
6246
7194
|
private withOwner;
|
|
7195
|
+
thread(userName?: string, options?: {
|
|
7196
|
+
timeoutMs?: number;
|
|
7197
|
+
}): Promise<WallThreadPost[]>;
|
|
7198
|
+
private wallPhrase;
|
|
6247
7199
|
private playerName;
|
|
6248
7200
|
private comm;
|
|
6249
7201
|
}
|
|
@@ -6404,6 +7356,14 @@ type DenRoomDefinition = {
|
|
|
6404
7356
|
availabilityStartTime: number;
|
|
6405
7357
|
availabilityEndTime: number;
|
|
6406
7358
|
};
|
|
7359
|
+
type BelongingKind = "clothing" | "den" | "pet";
|
|
7360
|
+
type Belonging = {
|
|
7361
|
+
kind: BelongingKind;
|
|
7362
|
+
invIdx: number;
|
|
7363
|
+
defId: number;
|
|
7364
|
+
name: string;
|
|
7365
|
+
itemType: number;
|
|
7366
|
+
};
|
|
6407
7367
|
type PartyHosting = {
|
|
6408
7368
|
userName: string;
|
|
6409
7369
|
secondsLeft: number;
|
|
@@ -6461,6 +7421,8 @@ declare class PlayerApi {
|
|
|
6461
7421
|
}): Promise<ClothingItem[]>;
|
|
6462
7422
|
denItemsForRoom(): Promise<DenInventoryItem[]>;
|
|
6463
7423
|
petsInDen(world: "land" | "ocean"): Promise<DenInventoryItem[]>;
|
|
7424
|
+
belongings(kind?: BelongingKind | readonly BelongingKind[]): Promise<Belonging[]>;
|
|
7425
|
+
private ownPets;
|
|
6464
7426
|
animalKindCount(): Promise<number>;
|
|
6465
7427
|
animalDefaults(avTypeId: number): Promise<AnimalDefaults>;
|
|
6466
7428
|
customAnimal(customAvId: number): Promise<AnimalKind | null>;
|
|
@@ -6468,6 +7430,10 @@ declare class PlayerApi {
|
|
|
6468
7430
|
animalOf(userName?: string): Promise<AnimalKind | null>;
|
|
6469
7431
|
denRoomDefinitions(): Promise<DenRoomDefinition[]>;
|
|
6470
7432
|
denRoomDefinition(defId: number): Promise<DenRoomDefinition | null>;
|
|
7433
|
+
activeDenId(): Promise<number>;
|
|
7434
|
+
onActiveDenChange(listener: (invId: number) => void): Unsubscribe;
|
|
7435
|
+
buddyCount(): Promise<number>;
|
|
7436
|
+
onBuddyCountChange(listener: (count: number) => void): Unsubscribe;
|
|
6471
7437
|
private hear;
|
|
6472
7438
|
private stateSources;
|
|
6473
7439
|
private recordOf;
|
|
@@ -6510,6 +7476,7 @@ declare class ReportsApi {
|
|
|
6510
7476
|
constructor(game: GameContext);
|
|
6511
7477
|
report(userName: string, reason: ReportReason, timeoutMs?: number): Promise<boolean>;
|
|
6512
7478
|
reportContent(userName: string, kind: ReportedContent, reason: ReportReason, data: string, timeoutMs?: number): Promise<boolean>;
|
|
7479
|
+
alreadyReported(userName: string): Promise<boolean>;
|
|
6513
7480
|
onReportResult(listener: (taken: boolean) => void): Unsubscribe;
|
|
6514
7481
|
onContentReportResult(listener: (taken: boolean) => void): Unsubscribe;
|
|
6515
7482
|
onReportSent(listener: (report: SentReport) => void): Unsubscribe;
|
|
@@ -6690,9 +7657,14 @@ declare class RoomApi {
|
|
|
6690
7657
|
private readonly failureListeners;
|
|
6691
7658
|
private readonly giftsAsked;
|
|
6692
7659
|
private readonly giftListeners;
|
|
7660
|
+
private readonly loadedListeners;
|
|
7661
|
+
private builtHook;
|
|
7662
|
+
private builtWanted;
|
|
7663
|
+
private hidingPlayers;
|
|
6693
7664
|
private readonly server;
|
|
6694
7665
|
private readonly flash;
|
|
6695
|
-
|
|
7666
|
+
private readonly phantomFlash;
|
|
7667
|
+
constructor(game: GameContext, flash?: PhantomFlash);
|
|
6696
7668
|
get current(): RoomInfo | null;
|
|
6697
7669
|
get details(): RoomDetails | null;
|
|
6698
7670
|
get layout(): RoomLayout | null;
|
|
@@ -6716,6 +7688,10 @@ declare class RoomApi {
|
|
|
6716
7688
|
onWorldItemTaken(listener: (gift: WorldItemTakenEvent) => void): () => void;
|
|
6717
7689
|
private hasTakenGift;
|
|
6718
7690
|
onJoin(listener: (room: RoomInfo) => void): () => void;
|
|
7691
|
+
onLoaded(listener: (scene: RoomScene) => void): () => void;
|
|
7692
|
+
whenLoaded(options?: {
|
|
7693
|
+
timeoutMs?: number;
|
|
7694
|
+
}): Promise<boolean>;
|
|
6719
7695
|
focusCamera(at: {
|
|
6720
7696
|
x: number;
|
|
6721
7697
|
y: number;
|
|
@@ -6733,12 +7709,14 @@ declare class RoomApi {
|
|
|
6733
7709
|
}): Promise<void>;
|
|
6734
7710
|
respawn(): Promise<void>;
|
|
6735
7711
|
spawns(): Promise<RoomSpawn[]>;
|
|
7712
|
+
walkToSpawn(name: string): Promise<void>;
|
|
6736
7713
|
portals(): Promise<RoomPortal[]>;
|
|
6737
7714
|
volumes(): Promise<RoomVolume[]>;
|
|
6738
7715
|
volumesAt(point: {
|
|
6739
7716
|
x: number;
|
|
6740
7717
|
y: number;
|
|
6741
7718
|
}): Promise<RoomVolume[]>;
|
|
7719
|
+
enableVolume(name: string, enabled: boolean): Promise<void>;
|
|
6742
7720
|
bounds(): Promise<RoomBounds>;
|
|
6743
7721
|
camera(): Promise<RoomCamera>;
|
|
6744
7722
|
moveCamera(offset: {
|
|
@@ -6777,6 +7755,7 @@ declare class RoomApi {
|
|
|
6777
7755
|
setPathDepth(cells: number): Promise<void>;
|
|
6778
7756
|
reload(): Promise<boolean>;
|
|
6779
7757
|
showAvatars(show: boolean): Promise<void>;
|
|
7758
|
+
showPlayers(show: boolean): Promise<void>;
|
|
6780
7759
|
joiningInvisibly(): Promise<boolean>;
|
|
6781
7760
|
darkAreas(): Promise<RoomDarkArea[]>;
|
|
6782
7761
|
nearestEmptyCell(point: {
|
|
@@ -6795,6 +7774,11 @@ declare class RoomApi {
|
|
|
6795
7774
|
}): Promise<RoomObjectAt | null>;
|
|
6796
7775
|
setJamaaTime(milliseconds: number): Promise<void>;
|
|
6797
7776
|
setDenKickNotice(show: boolean): Promise<void>;
|
|
7777
|
+
private wantBuiltHook;
|
|
7778
|
+
private releaseBuiltHook;
|
|
7779
|
+
private hookBuilt;
|
|
7780
|
+
private tellLoaded;
|
|
7781
|
+
private roomBuilt;
|
|
6798
7782
|
private darkArea;
|
|
6799
7783
|
private actors;
|
|
6800
7784
|
private number;
|
|
@@ -6803,6 +7787,8 @@ declare class RoomApi {
|
|
|
6803
7787
|
join(name: string, options?: {
|
|
6804
7788
|
invisible?: boolean;
|
|
6805
7789
|
}): Promise<void>;
|
|
7790
|
+
onChange(listener: (change: RoomChange) => void): () => void;
|
|
7791
|
+
surfaces(): Promise<RoomSurface[]>;
|
|
6806
7792
|
}
|
|
6807
7793
|
type RoomPlayer = {
|
|
6808
7794
|
userId: number;
|
|
@@ -6854,14 +7840,59 @@ declare class RoomPlayers {
|
|
|
6854
7840
|
refresh(): Promise<readonly RoomPlayer[]>;
|
|
6855
7841
|
viewOf(userId: number): Promise<RoomPlayerView | null>;
|
|
6856
7842
|
views(): Promise<RoomPlayerView[]>;
|
|
7843
|
+
onList(listener: (event: RoomPlayerList) => void, options?: {
|
|
7844
|
+
refresh?: boolean;
|
|
7845
|
+
}): () => void;
|
|
7846
|
+
onPosition(userId: number, listener: (where: RoomPlayerWhere) => void, options?: {
|
|
7847
|
+
everyMs?: number;
|
|
7848
|
+
}): () => void;
|
|
6857
7849
|
private move;
|
|
6858
7850
|
}
|
|
7851
|
+
declare const ROOM_SURFACES: {
|
|
7852
|
+
readonly behind: "room_bkg_main";
|
|
7853
|
+
readonly players: "room_avatars";
|
|
7854
|
+
readonly front: "room_fg";
|
|
7855
|
+
readonly over: "room_super_fg";
|
|
7856
|
+
readonly chat: "room_chat";
|
|
7857
|
+
readonly interface: "gui";
|
|
7858
|
+
};
|
|
7859
|
+
type RoomSurfaceName = keyof typeof ROOM_SURFACES;
|
|
7860
|
+
type RoomSurface = {
|
|
7861
|
+
name: RoomSurfaceName;
|
|
7862
|
+
layer: (typeof ROOM_LAYER_NAMES)[number];
|
|
7863
|
+
ready: boolean;
|
|
7864
|
+
children: number;
|
|
7865
|
+
visible: boolean;
|
|
7866
|
+
place: FlashReference;
|
|
7867
|
+
};
|
|
7868
|
+
type RoomChange = {
|
|
7869
|
+
from: RoomInfo | null;
|
|
7870
|
+
to: RoomInfo;
|
|
7871
|
+
};
|
|
7872
|
+
type RoomPlayerList = {
|
|
7873
|
+
players: readonly RoomPlayer[];
|
|
7874
|
+
arrived: RoomPlayer | null;
|
|
7875
|
+
left: RoomPlayer | null;
|
|
7876
|
+
};
|
|
7877
|
+
type RoomPlayerWhere = {
|
|
7878
|
+
userId: number;
|
|
7879
|
+
x: number;
|
|
7880
|
+
y: number;
|
|
7881
|
+
here: boolean;
|
|
7882
|
+
moving: boolean | null;
|
|
7883
|
+
};
|
|
6859
7884
|
type ConnectionMode = "socket" | "http" | "disconnected";
|
|
6860
7885
|
type ConnectionServer = {
|
|
6861
7886
|
host: string;
|
|
6862
7887
|
port: number;
|
|
6863
7888
|
ips: readonly string[];
|
|
6864
7889
|
};
|
|
7890
|
+
type SessionReady = {
|
|
7891
|
+
connected: boolean;
|
|
7892
|
+
loggedIn: boolean;
|
|
7893
|
+
inWorld: boolean;
|
|
7894
|
+
worldReady: boolean;
|
|
7895
|
+
};
|
|
6865
7896
|
type ConnectionOutcome = {
|
|
6866
7897
|
connected: boolean;
|
|
6867
7898
|
};
|
|
@@ -6878,6 +7909,11 @@ declare class SessionApi {
|
|
|
6878
7909
|
constructor(game: GameContext, flash: PhantomFlash);
|
|
6879
7910
|
connected(): Promise<boolean>;
|
|
6880
7911
|
mode(): Promise<ConnectionMode>;
|
|
7912
|
+
ready(): Promise<SessionReady>;
|
|
7913
|
+
whenReady(options?: {
|
|
7914
|
+
step?: keyof SessionReady;
|
|
7915
|
+
timeoutMs?: number;
|
|
7916
|
+
}): Promise<SessionReady>;
|
|
6881
7917
|
server(): Promise<ConnectionServer>;
|
|
6882
7918
|
onConnectionLost(listener: () => void): Unsubscribe;
|
|
6883
7919
|
onConnected(listener: (outcome: ConnectionOutcome) => void): Unsubscribe;
|
|
@@ -6901,186 +7937,6 @@ declare class SessionApi {
|
|
|
6901
7937
|
onIdleWarning(listener: () => void): Unsubscribe;
|
|
6902
7938
|
private hookVoid;
|
|
6903
7939
|
}
|
|
6904
|
-
type ItemDefinition = {
|
|
6905
|
-
defId: number;
|
|
6906
|
-
name: string;
|
|
6907
|
-
titleStrId: number;
|
|
6908
|
-
cost: number;
|
|
6909
|
-
currencyType: number;
|
|
6910
|
-
combinedCost: string;
|
|
6911
|
-
membersOnly: boolean;
|
|
6912
|
-
recycleValue: number;
|
|
6913
|
-
type: number;
|
|
6914
|
-
enviroType: number;
|
|
6915
|
-
colors: number[];
|
|
6916
|
-
layerId: number;
|
|
6917
|
-
accId: number;
|
|
6918
|
-
avatarUseFlag: number;
|
|
6919
|
-
itemStatus: number;
|
|
6920
|
-
isNew: boolean;
|
|
6921
|
-
isOnSale: boolean;
|
|
6922
|
-
isGiftable: boolean;
|
|
6923
|
-
availabilityStartTime: number;
|
|
6924
|
-
availabilityEndTime: number;
|
|
6925
|
-
combat: ItemCombat;
|
|
6926
|
-
};
|
|
6927
|
-
type ItemCombat = {
|
|
6928
|
-
attack: number;
|
|
6929
|
-
defense: number;
|
|
6930
|
-
attackMediaRefId: number;
|
|
6931
|
-
combatType: number;
|
|
6932
|
-
modifierType: number;
|
|
6933
|
-
modifierValue: number;
|
|
6934
|
-
criticalHit: number;
|
|
6935
|
-
};
|
|
6936
|
-
type ShopOffering = {
|
|
6937
|
-
shopId: number;
|
|
6938
|
-
listType: number;
|
|
6939
|
-
titleStrId: number | null;
|
|
6940
|
-
diamondBundle: boolean;
|
|
6941
|
-
diamondCost: number;
|
|
6942
|
-
items: ItemDefinition[];
|
|
6943
|
-
unknownDefIds: number[];
|
|
6944
|
-
};
|
|
6945
|
-
type ShopListing = {
|
|
6946
|
-
shopId: number;
|
|
6947
|
-
listType: number;
|
|
6948
|
-
defIds: number[];
|
|
6949
|
-
};
|
|
6950
|
-
type ItemPictureKind = "clothing" | "den-item";
|
|
6951
|
-
type ItemPictureItem = number | {
|
|
6952
|
-
defId: number;
|
|
6953
|
-
kind?: ItemPictureKind;
|
|
6954
|
-
color?: number;
|
|
6955
|
-
};
|
|
6956
|
-
type ItemPictureOptions = {
|
|
6957
|
-
scale?: number;
|
|
6958
|
-
background?: number | null;
|
|
6959
|
-
maxSize?: number;
|
|
6960
|
-
large?: boolean;
|
|
6961
|
-
version?: number;
|
|
6962
|
-
timeoutMs?: number;
|
|
6963
|
-
cache?: boolean;
|
|
6964
|
-
};
|
|
6965
|
-
type DenShopOffering = {
|
|
6966
|
-
shopId: number;
|
|
6967
|
-
listType: number;
|
|
6968
|
-
items: DenItemDefinition[];
|
|
6969
|
-
unknownDefIds: number[];
|
|
6970
|
-
};
|
|
6971
|
-
type DiamondItem = {
|
|
6972
|
-
defId: number;
|
|
6973
|
-
value: number;
|
|
6974
|
-
type: number;
|
|
6975
|
-
refDefId: number;
|
|
6976
|
-
status: number;
|
|
6977
|
-
isNew: boolean;
|
|
6978
|
-
isOnSale: boolean;
|
|
6979
|
-
isOnClearance: boolean;
|
|
6980
|
-
isRare: boolean;
|
|
6981
|
-
isAvailable: boolean;
|
|
6982
|
-
availabilityEndTime: number;
|
|
6983
|
-
startTime: number;
|
|
6984
|
-
};
|
|
6985
|
-
type DiamondDefinition = {
|
|
6986
|
-
defId: number;
|
|
6987
|
-
value: number;
|
|
6988
|
-
refDefId: number;
|
|
6989
|
-
type: number;
|
|
6990
|
-
status: number;
|
|
6991
|
-
availabilityStartTime: number;
|
|
6992
|
-
availabilityEndTime: number;
|
|
6993
|
-
};
|
|
6994
|
-
type DiamondShopItem = {
|
|
6995
|
-
diamondDefId: number;
|
|
6996
|
-
defId: number | null;
|
|
6997
|
-
itemClass: string | null;
|
|
6998
|
-
};
|
|
6999
|
-
type DiamondShopList = {
|
|
7000
|
-
items: DiamondShopItem[];
|
|
7001
|
-
unknownDefIds: number[];
|
|
7002
|
-
};
|
|
7003
|
-
type Purchase = {
|
|
7004
|
-
defId: number;
|
|
7005
|
-
shopId: number;
|
|
7006
|
-
status: number;
|
|
7007
|
-
balance: number | null;
|
|
7008
|
-
currencyType: number;
|
|
7009
|
-
};
|
|
7010
|
-
type Sale = {
|
|
7011
|
-
invIds: number[];
|
|
7012
|
-
gems: number | null;
|
|
7013
|
-
};
|
|
7014
|
-
declare class ShopsApi {
|
|
7015
|
-
readonly [STATE_FIELDS]: readonly [
|
|
7016
|
-
"lists"
|
|
7017
|
-
];
|
|
7018
|
-
private readonly flash;
|
|
7019
|
-
private readonly client;
|
|
7020
|
-
private readonly server;
|
|
7021
|
-
private readonly lists;
|
|
7022
|
-
private readonly pictures;
|
|
7023
|
-
constructor(game: GameContext, flash: PhantomFlash);
|
|
7024
|
-
offering(shopId: number, { refresh, timeoutMs, }?: {
|
|
7025
|
-
refresh?: boolean;
|
|
7026
|
-
timeoutMs?: number;
|
|
7027
|
-
}): Promise<ShopOffering>;
|
|
7028
|
-
denOffering(shopId: number, { refresh, timeoutMs, }?: {
|
|
7029
|
-
refresh?: boolean;
|
|
7030
|
-
timeoutMs?: number;
|
|
7031
|
-
}): Promise<DenShopOffering>;
|
|
7032
|
-
definition(defId: number): Promise<ItemDefinition | null>;
|
|
7033
|
-
definitionsReady(): Promise<boolean>;
|
|
7034
|
-
picture(item: ItemPictureItem, options?: ItemPictureOptions): Promise<string>;
|
|
7035
|
-
isAvailable(window: {
|
|
7036
|
-
availabilityStartTime: number;
|
|
7037
|
-
availabilityEndTime: number;
|
|
7038
|
-
}): Promise<boolean>;
|
|
7039
|
-
diamondItem(defId: number): Promise<DiamondItem | null>;
|
|
7040
|
-
diamondDefinition(entry: number | {
|
|
7041
|
-
refDefId: number;
|
|
7042
|
-
type: number;
|
|
7043
|
-
}): Promise<DiamondDefinition | null>;
|
|
7044
|
-
diamondList(defIds: number[]): Promise<DiamondShopList>;
|
|
7045
|
-
listType(shopId: number): Promise<number | null>;
|
|
7046
|
-
knownShops(): Promise<Array<{
|
|
7047
|
-
shopId: number;
|
|
7048
|
-
listType: number;
|
|
7049
|
-
}>>;
|
|
7050
|
-
open(shopId: number): Promise<void>;
|
|
7051
|
-
close(): Promise<void>;
|
|
7052
|
-
isOpen(): Promise<boolean>;
|
|
7053
|
-
onOpen(listener: (opened: {
|
|
7054
|
-
shopId: number;
|
|
7055
|
-
listType: number;
|
|
7056
|
-
}) => void): () => void;
|
|
7057
|
-
buyDiamondBundle(timeoutMs?: number): Promise<{
|
|
7058
|
-
bought: boolean;
|
|
7059
|
-
balance: number | null;
|
|
7060
|
-
}>;
|
|
7061
|
-
buy(defId: number, { shopId, colorIndex, diamond, forDenItem, timeoutMs, }: {
|
|
7062
|
-
shopId: number;
|
|
7063
|
-
colorIndex?: number;
|
|
7064
|
-
diamond?: boolean;
|
|
7065
|
-
forDenItem?: {
|
|
7066
|
-
invId: number;
|
|
7067
|
-
userName: string;
|
|
7068
|
-
};
|
|
7069
|
-
timeoutMs?: number;
|
|
7070
|
-
}): Promise<Purchase>;
|
|
7071
|
-
sell(...invIds: number[]): Promise<Sale>;
|
|
7072
|
-
onBuy(listener: (purchase: Purchase) => void): Unsubscribe;
|
|
7073
|
-
onSell(listener: (sale: Sale) => void): Unsubscribe;
|
|
7074
|
-
onList(listener: (listing: ShopListing) => void): Unsubscribe;
|
|
7075
|
-
onDiamondBundleBuy(listener: (result: {
|
|
7076
|
-
bought: boolean;
|
|
7077
|
-
balance: number | null;
|
|
7078
|
-
}) => void): Unsubscribe;
|
|
7079
|
-
private definitionsLoaded;
|
|
7080
|
-
private drawClothing;
|
|
7081
|
-
private drawDenItem;
|
|
7082
|
-
private listFor;
|
|
7083
|
-
}
|
|
7084
7940
|
declare const BANKS: {
|
|
7085
7941
|
readonly gift: "hasLoadedGiftUnwrapSfx";
|
|
7086
7942
|
readonly trade: "hasLoadedTradeSfx";
|
|
@@ -7140,6 +7996,9 @@ declare class SoundApi {
|
|
|
7140
7996
|
private readonly bridge;
|
|
7141
7997
|
private readonly flash;
|
|
7142
7998
|
private readonly changeListeners;
|
|
7999
|
+
private readonly audioListeners;
|
|
8000
|
+
private audioHooks;
|
|
8001
|
+
private audioReading;
|
|
7143
8002
|
constructor(game: GameContext, flash: PhantomFlash);
|
|
7144
8003
|
settings(): Promise<SoundSettings>;
|
|
7145
8004
|
areSoundsMuted(): Promise<boolean>;
|
|
@@ -7150,6 +8009,8 @@ declare class SoundApi {
|
|
|
7150
8009
|
muteMusic(muted: boolean): Promise<SoundSettings>;
|
|
7151
8010
|
muteAll(muted: boolean): Promise<SoundSettings>;
|
|
7152
8011
|
toggleMute(): Promise<SoundSettings>;
|
|
8012
|
+
silence(): Promise<SoundSettings>;
|
|
8013
|
+
restore(settings: SoundSettings): Promise<SoundSettings>;
|
|
7153
8014
|
setVolume(volume: number): Promise<SoundSettings>;
|
|
7154
8015
|
setSoundVolume(volume: number): Promise<SoundSettings>;
|
|
7155
8016
|
setMusicVolume(volume: number): Promise<SoundSettings>;
|
|
@@ -7163,6 +8024,10 @@ declare class SoundApi {
|
|
|
7163
8024
|
unpauseSounds(): Promise<void>;
|
|
7164
8025
|
stopAll(): Promise<void>;
|
|
7165
8026
|
onChange(listener: (settings: SoundSettings) => void): Unsubscribe;
|
|
8027
|
+
onAudioChange(listener: (settings: SoundSettings) => void): Unsubscribe;
|
|
8028
|
+
private watchAudio;
|
|
8029
|
+
private unwatchAudio;
|
|
8030
|
+
private audioChanged;
|
|
7166
8031
|
onPlay(listener: (className: string, loops: number) => void): () => void;
|
|
7167
8032
|
onStop(listener: (className: string) => void): () => void;
|
|
7168
8033
|
private hookAudio;
|
|
@@ -7226,6 +8091,21 @@ type TradeListEdit = {
|
|
|
7226
8091
|
removed: InventoryRef[];
|
|
7227
8092
|
};
|
|
7228
8093
|
type TradeListing = Omit<PacketOf<typeof TradeList>, "room">;
|
|
8094
|
+
type TradeStage = "none" | "asking" | "offered" | "accepted" | "completed" | "ended";
|
|
8095
|
+
type TradeState = {
|
|
8096
|
+
stage: TradeStage;
|
|
8097
|
+
trading: boolean;
|
|
8098
|
+
userName: string | null;
|
|
8099
|
+
theirOffer: TradeOffer | null;
|
|
8100
|
+
theyWant: {
|
|
8101
|
+
kind: number;
|
|
8102
|
+
invIdx: number;
|
|
8103
|
+
} | null;
|
|
8104
|
+
myList: TradeItemRef[];
|
|
8105
|
+
myDraft: TradeDraftItem[];
|
|
8106
|
+
completion: TradeCompletion | null;
|
|
8107
|
+
end: TradeEnd | null;
|
|
8108
|
+
};
|
|
7229
8109
|
declare class TradesApi {
|
|
7230
8110
|
readonly [STATE_FIELDS]: readonly [
|
|
7231
8111
|
"pending"
|
|
@@ -7242,6 +8122,9 @@ declare class TradesApi {
|
|
|
7242
8122
|
onEnd(listener: (end: TradeEnd) => void): Unsubscribe;
|
|
7243
8123
|
onChange(listener: (change: TradeChange) => void): Unsubscribe;
|
|
7244
8124
|
request(userName: string, wanted: TradeItemRef, { clothing, den, audio, pets }?: TradeOfferItems): Promise<void>;
|
|
8125
|
+
openRequest(userName: string, wanted: TradeItemRef, { timeoutMs }?: {
|
|
8126
|
+
timeoutMs?: number;
|
|
8127
|
+
}): Promise<void>;
|
|
7245
8128
|
add(...items: TradeItemRef[]): Promise<void>;
|
|
7246
8129
|
remove(...items: TradeItemRef[]): Promise<void>;
|
|
7247
8130
|
myList(timeoutMs?: number): Promise<TradeListing>;
|
|
@@ -7258,6 +8141,9 @@ declare class TradesApi {
|
|
|
7258
8141
|
offerDraft(): Promise<TradeDraftItem[]>;
|
|
7259
8142
|
counts(): Promise<TradeCounts>;
|
|
7260
8143
|
listEntry(item: TradeItemRef): Promise<TradeItemRef | null>;
|
|
8144
|
+
state(): Promise<TradeState>;
|
|
8145
|
+
onState(listener: (state: TradeState) => void): Unsubscribe;
|
|
8146
|
+
private whenCardReady;
|
|
7261
8147
|
private ownCollection;
|
|
7262
8148
|
private comm;
|
|
7263
8149
|
private changeList;
|
|
@@ -7409,13 +8295,17 @@ type UiWindowOptions = UiOptions & {
|
|
|
7409
8295
|
closable?: boolean;
|
|
7410
8296
|
};
|
|
7411
8297
|
type UiButton = UiWidget & {
|
|
8298
|
+
label(): string;
|
|
7412
8299
|
setLabel(label: string): Promise<void>;
|
|
7413
8300
|
setDisabled(disabled: boolean): Promise<void>;
|
|
8301
|
+
setImage(image: string | null): Promise<void>;
|
|
7414
8302
|
onClick(listener: () => void): UiRemove;
|
|
7415
8303
|
};
|
|
7416
8304
|
type UiButtonOptions = UiOptions & {
|
|
7417
8305
|
disabled?: boolean;
|
|
7418
8306
|
primary?: boolean;
|
|
8307
|
+
image?: string;
|
|
8308
|
+
imageOnly?: boolean;
|
|
7419
8309
|
};
|
|
7420
8310
|
type UiLabel = UiWidget & {
|
|
7421
8311
|
setText(text: string): Promise<void>;
|
|
@@ -7501,6 +8391,16 @@ type UiGridOptions = UiOptions & {
|
|
|
7501
8391
|
tileHeight?: number;
|
|
7502
8392
|
gap?: number;
|
|
7503
8393
|
};
|
|
8394
|
+
type UiImage = UiWidget & {
|
|
8395
|
+
source(): string;
|
|
8396
|
+
setSource(url: string): Promise<void>;
|
|
8397
|
+
onFailed(listener: (message: string) => void): UiRemove;
|
|
8398
|
+
};
|
|
8399
|
+
type UiImageOptions = UiOptions & {
|
|
8400
|
+
alt?: string;
|
|
8401
|
+
centered?: boolean;
|
|
8402
|
+
alpha?: number;
|
|
8403
|
+
};
|
|
7504
8404
|
type UiScroll = UiWidget & {
|
|
7505
8405
|
readonly body: OverlayNode;
|
|
7506
8406
|
offset(): number;
|
|
@@ -7520,6 +8420,66 @@ type UiTooltipOptions = UiOptions & {
|
|
|
7520
8420
|
visible?: boolean;
|
|
7521
8421
|
target?: UiWidget | OverlayNode;
|
|
7522
8422
|
};
|
|
8423
|
+
type UiPromptOptions = {
|
|
8424
|
+
title?: string;
|
|
8425
|
+
value?: string;
|
|
8426
|
+
placeholder?: string;
|
|
8427
|
+
maxLength?: number;
|
|
8428
|
+
okLabel?: string;
|
|
8429
|
+
cancelLabel?: string;
|
|
8430
|
+
x?: number;
|
|
8431
|
+
y?: number;
|
|
8432
|
+
width?: number;
|
|
8433
|
+
skin?: UiSkin;
|
|
8434
|
+
};
|
|
8435
|
+
type UiChooseOptions = {
|
|
8436
|
+
title?: string;
|
|
8437
|
+
cancelLabel?: string;
|
|
8438
|
+
x?: number;
|
|
8439
|
+
y?: number;
|
|
8440
|
+
width?: number;
|
|
8441
|
+
rows?: number;
|
|
8442
|
+
skin?: UiSkin;
|
|
8443
|
+
};
|
|
8444
|
+
type UiNotice = UiWidget & {
|
|
8445
|
+
setText(text: string): Promise<void>;
|
|
8446
|
+
onClose(listener: () => void): UiRemove;
|
|
8447
|
+
};
|
|
8448
|
+
type UiNoticeOptions = {
|
|
8449
|
+
title?: string;
|
|
8450
|
+
seconds?: number;
|
|
8451
|
+
x?: number;
|
|
8452
|
+
y?: number;
|
|
8453
|
+
width?: number;
|
|
8454
|
+
closable?: boolean;
|
|
8455
|
+
draggable?: boolean;
|
|
8456
|
+
skin?: UiSkin;
|
|
8457
|
+
};
|
|
8458
|
+
type UiTagTarget = number | {
|
|
8459
|
+
readonly place: FlashPlaceLike;
|
|
8460
|
+
} | UiPlace;
|
|
8461
|
+
type UiTag = UiWidget & {
|
|
8462
|
+
setText(text: string): Promise<void>;
|
|
8463
|
+
};
|
|
8464
|
+
type UiTagOptions = {
|
|
8465
|
+
offsetX?: number;
|
|
8466
|
+
offsetY?: number;
|
|
8467
|
+
colour?: number;
|
|
8468
|
+
heading?: boolean;
|
|
8469
|
+
background?: boolean;
|
|
8470
|
+
seconds?: number;
|
|
8471
|
+
key?: string;
|
|
8472
|
+
skin?: UiSkin;
|
|
8473
|
+
};
|
|
8474
|
+
type UiTipOptions = {
|
|
8475
|
+
offsetX?: number;
|
|
8476
|
+
offsetY?: number;
|
|
8477
|
+
skin?: UiSkin;
|
|
8478
|
+
};
|
|
8479
|
+
type UiStageSize = {
|
|
8480
|
+
width: number;
|
|
8481
|
+
height: number;
|
|
8482
|
+
};
|
|
7523
8483
|
type UiProgress = UiWidget & {
|
|
7524
8484
|
value(): number;
|
|
7525
8485
|
setValue(value: number): Promise<void>;
|
|
@@ -7584,6 +8544,7 @@ declare class UiApi {
|
|
|
7584
8544
|
private readonly flash;
|
|
7585
8545
|
private readonly drawn;
|
|
7586
8546
|
private readonly popups;
|
|
8547
|
+
private readonly tags;
|
|
7587
8548
|
private symbolMaker;
|
|
7588
8549
|
private gameFont;
|
|
7589
8550
|
private defaultSkin;
|
|
@@ -7611,6 +8572,7 @@ declare class UiApi {
|
|
|
7611
8572
|
tabs(options: UiTabsOptions): Promise<UiTabs>;
|
|
7612
8573
|
list(options?: UiListOptions): Promise<UiList>;
|
|
7613
8574
|
grid(options: UiGridOptions): Promise<UiGrid>;
|
|
8575
|
+
image(source: string, options?: UiImageOptions): Promise<UiImage>;
|
|
7614
8576
|
scroll(options?: UiScrollOptions): Promise<UiScroll>;
|
|
7615
8577
|
tooltip(options?: UiTooltipOptions): Promise<UiTooltip>;
|
|
7616
8578
|
private bubble;
|
|
@@ -7618,6 +8580,13 @@ declare class UiApi {
|
|
|
7618
8580
|
progress(options?: UiProgressOptions): Promise<UiProgress>;
|
|
7619
8581
|
colors(options?: UiColorsOptions): Promise<UiColors>;
|
|
7620
8582
|
paletteValues(which?: 1 | 2 | "game"): Promise<number[]>;
|
|
8583
|
+
prompt(text: string, options?: UiPromptOptions): UiPopupAnswer<string | null>;
|
|
8584
|
+
choose(text: string, choices: readonly (UiChoice | string)[], options?: UiChooseOptions): UiPopupAnswer<string | null>;
|
|
8585
|
+
notice(text: string, options?: UiNoticeOptions): Promise<UiNotice>;
|
|
8586
|
+
tag(target: UiTagTarget, text: string, options?: UiTagOptions): Promise<UiTag>;
|
|
8587
|
+
tipOn(place: UiPlace, text: string | (() => string | Promise<string>), options?: UiTipOptions): Promise<UiRemove>;
|
|
8588
|
+
stageSize(): Promise<UiStageSize>;
|
|
8589
|
+
onStageResize(listener: (size: UiStageSize) => void): () => void;
|
|
7621
8590
|
places(): UiSpot[];
|
|
7622
8591
|
place(spot: UiSpot): FlashPlaceLike;
|
|
7623
8592
|
attach(place: UiPlace, widget: UiWidget | OverlayNode): Promise<UiRemove>;
|
|
@@ -7633,7 +8602,10 @@ declare class UiApi {
|
|
|
7633
8602
|
clear(): Promise<void>;
|
|
7634
8603
|
private pieceOf;
|
|
7635
8604
|
private widget;
|
|
8605
|
+
private picture;
|
|
7636
8606
|
private box;
|
|
8607
|
+
private anchorOf;
|
|
8608
|
+
private mouse;
|
|
7637
8609
|
private placeOf;
|
|
7638
8610
|
private maker;
|
|
7639
8611
|
private nodeObject;
|
|
@@ -7801,6 +8773,10 @@ type JourneyBookCounts = {
|
|
|
7801
8773
|
unseenPages: number;
|
|
7802
8774
|
unclaimedGifts: number;
|
|
7803
8775
|
};
|
|
8776
|
+
type JourneyBookPage = {
|
|
8777
|
+
page: number;
|
|
8778
|
+
pages: number;
|
|
8779
|
+
};
|
|
7804
8780
|
declare class JourneyBookApi {
|
|
7805
8781
|
private readonly flash;
|
|
7806
8782
|
private readonly client;
|
|
@@ -7810,6 +8786,11 @@ declare class JourneyBookApi {
|
|
|
7810
8786
|
unclaimedGifts(): Promise<number>;
|
|
7811
8787
|
open(factDefId?: number): Promise<void>;
|
|
7812
8788
|
onChange(listener: (counts: JourneyBookCounts) => void): Unsubscribe;
|
|
8789
|
+
onGiftReady(listener: (gifts: number) => void): Unsubscribe;
|
|
8790
|
+
unseenPageIds(): Promise<number[]>;
|
|
8791
|
+
showing(): Promise<JourneyBookPage | null>;
|
|
8792
|
+
turnTo(page: number): Promise<boolean>;
|
|
8793
|
+
close(): Promise<boolean>;
|
|
7813
8794
|
}
|
|
7814
8795
|
type ReferralCodeInfo = {
|
|
7815
8796
|
code: string;
|
|
@@ -7824,6 +8805,10 @@ type ReferralPage = {
|
|
|
7824
8805
|
status: number;
|
|
7825
8806
|
};
|
|
7826
8807
|
type ReferrerOutcome = "recorded" | "refused" | "failed";
|
|
8808
|
+
type ReferralRewards = {
|
|
8809
|
+
treasures: boolean[];
|
|
8810
|
+
opened: number;
|
|
8811
|
+
};
|
|
7827
8812
|
declare class ReferralsApi {
|
|
7828
8813
|
readonly [STATE_FIELDS]: readonly [
|
|
7829
8814
|
"heardCode"
|
|
@@ -7831,6 +8816,8 @@ declare class ReferralsApi {
|
|
|
7831
8816
|
private readonly flash;
|
|
7832
8817
|
private readonly server;
|
|
7833
8818
|
private heardCode;
|
|
8819
|
+
private firstTreasure;
|
|
8820
|
+
private otherTreasures;
|
|
7834
8821
|
constructor(game: GameContext);
|
|
7835
8822
|
get code(): string | null;
|
|
7836
8823
|
fetchCode(timeoutMs?: number): Promise<ReferralCodeInfo>;
|
|
@@ -7842,6 +8829,14 @@ declare class ReferralsApi {
|
|
|
7842
8829
|
pageSize?: number;
|
|
7843
8830
|
timeoutMs?: number;
|
|
7844
8831
|
}): Promise<ReferralPage>;
|
|
8832
|
+
everyone(options?: {
|
|
8833
|
+
pageSize?: number;
|
|
8834
|
+
pages?: number;
|
|
8835
|
+
timeoutMs?: number;
|
|
8836
|
+
}): Promise<ReferredPlayer[]>;
|
|
8837
|
+
rewards(): Promise<ReferralRewards>;
|
|
8838
|
+
onRewards(listener: (rewards: ReferralRewards) => void): Unsubscribe;
|
|
8839
|
+
private stat;
|
|
7845
8840
|
onCode(listener: (code: ReferralCodeInfo | null) => void): Unsubscribe;
|
|
7846
8841
|
onHasReferrer(listener: (hasReferrer: boolean) => void): Unsubscribe;
|
|
7847
8842
|
onReferrerNamed(listener: (outcome: ReferrerOutcome) => void): Unsubscribe;
|
|
@@ -7865,6 +8860,10 @@ type ShortcutPress = {
|
|
|
7865
8860
|
alt: boolean;
|
|
7866
8861
|
consumed: boolean;
|
|
7867
8862
|
};
|
|
8863
|
+
type ShortcutTyping = "empty" | "always";
|
|
8864
|
+
type BoundShortcut = Shortcut & {
|
|
8865
|
+
whileTyping: ShortcutTyping;
|
|
8866
|
+
};
|
|
7868
8867
|
declare class InputApi {
|
|
7869
8868
|
private readonly flash;
|
|
7870
8869
|
private readonly bindings;
|
|
@@ -7872,9 +8871,13 @@ declare class InputApi {
|
|
|
7872
8871
|
private readonly held;
|
|
7873
8872
|
constructor(game: GameContext);
|
|
7874
8873
|
bind(shortcut: string, options?: ShortcutOptions): Promise<Shortcut>;
|
|
8874
|
+
bindAnywhere(shortcut: string, options?: ShortcutOptions): Promise<Shortcut>;
|
|
8875
|
+
private bindWith;
|
|
7875
8876
|
unbind(shortcut: string): Promise<boolean>;
|
|
7876
8877
|
get bound(): Shortcut[];
|
|
8878
|
+
get shortcuts(): BoundShortcut[];
|
|
7877
8879
|
onShortcut(listener: (press: ShortcutPress) => void): Unsubscribe;
|
|
8880
|
+
onAnyKey(listener: (press: KeyPress) => void): Unsubscribe;
|
|
7878
8881
|
private listen;
|
|
7879
8882
|
private tell;
|
|
7880
8883
|
}
|
|
@@ -7907,6 +8910,13 @@ declare class ViewApi {
|
|
|
7907
8910
|
showOwnAvatar(show: boolean): Promise<boolean>;
|
|
7908
8911
|
showOwnNameTag(show: boolean): Promise<boolean>;
|
|
7909
8912
|
onChange(listener: (state: ViewState) => void): Unsubscribe;
|
|
8913
|
+
private cleaned;
|
|
8914
|
+
clean(options?: {
|
|
8915
|
+
interface?: boolean;
|
|
8916
|
+
ownAvatar?: boolean;
|
|
8917
|
+
ownNameTag?: boolean;
|
|
8918
|
+
}): Promise<ViewState>;
|
|
8919
|
+
restore(): Promise<ViewState>;
|
|
7910
8920
|
private set;
|
|
7911
8921
|
private hide;
|
|
7912
8922
|
private follow;
|
|
@@ -7915,6 +8925,14 @@ declare class ViewApi {
|
|
|
7915
8925
|
private hookZoom;
|
|
7916
8926
|
private changed;
|
|
7917
8927
|
}
|
|
8928
|
+
type BodyMod = {
|
|
8929
|
+
kind: "eyes" | "pattern";
|
|
8930
|
+
defId: number;
|
|
8931
|
+
name: string;
|
|
8932
|
+
titleStrId: number;
|
|
8933
|
+
membersOnly: boolean;
|
|
8934
|
+
inUse: boolean;
|
|
8935
|
+
};
|
|
7918
8936
|
type LookItem = {
|
|
7919
8937
|
defId: number;
|
|
7920
8938
|
color: number;
|
|
@@ -7974,6 +8992,10 @@ declare class LooksApi {
|
|
|
7974
8992
|
plan(look: Look, options?: LookOptions): Promise<LookPlan>;
|
|
7975
8993
|
putOn(look: Look, options?: LookOptions): Promise<LookResult>;
|
|
7976
8994
|
onChange(listener: (change: LookChange) => void): () => void;
|
|
8995
|
+
watch(listener: (look: Look) => void): () => void;
|
|
8996
|
+
bodyMods(): Promise<BodyMod[]>;
|
|
8997
|
+
wearBodyMod(kind: "eyes" | "pattern", defId: number): Promise<boolean>;
|
|
8998
|
+
private bodyModsWorn;
|
|
7977
8999
|
private player;
|
|
7978
9000
|
private holding;
|
|
7979
9001
|
}
|
|
@@ -8432,10 +9454,16 @@ type SdkPathOfSdk = {
|
|
|
8432
9454
|
}[SdkArea];
|
|
8433
9455
|
declare const NOT_FOR_PLUGINS: readonly [
|
|
8434
9456
|
"avatar.view",
|
|
9457
|
+
"avatar.viewOf",
|
|
9458
|
+
"room.surfaces",
|
|
8435
9459
|
"adventures.record",
|
|
8436
9460
|
"content.replaceOnScreen",
|
|
8437
9461
|
"content.load",
|
|
8438
|
-
"realtime.join"
|
|
9462
|
+
"realtime.join",
|
|
9463
|
+
"realtime.stayIn",
|
|
9464
|
+
"customRooms.prop",
|
|
9465
|
+
"customRooms.object",
|
|
9466
|
+
"customRooms.character"
|
|
8439
9467
|
];
|
|
8440
9468
|
type SdkPath = Exclude<SdkPathOfSdk, (typeof NOT_FOR_PLUGINS)[number]>;
|
|
8441
9469
|
type RemoteMember<Member> = Member extends (...args: infer Args) => infer Result ? Result extends Unsubscribe ? (...args: Args) => Unsubscribe : (...args: Args) => Promise<Awaited<Result>> : () => Promise<Member>;
|
|
@@ -8493,18 +9521,33 @@ type PluginContext = {
|
|
|
8493
9521
|
}): Promise<void>;
|
|
8494
9522
|
confirm(message: string, options?: ConfirmOptions): Promise<boolean | null>;
|
|
8495
9523
|
openUrl(url: string): Promise<void>;
|
|
9524
|
+
openPanel(panelId: string, options?: {
|
|
9525
|
+
game?: string;
|
|
9526
|
+
}): Promise<void>;
|
|
9527
|
+
closePanel(panelId: string, options?: {
|
|
9528
|
+
game?: string;
|
|
9529
|
+
}): Promise<void>;
|
|
8496
9530
|
log(...values: unknown[]): void;
|
|
8497
9531
|
};
|
|
8498
|
-
type PluginPhantom = Omit<RemoteSdk, "avatar" | "adventures" | "content" | "ui" | "realtime"> & {
|
|
9532
|
+
type PluginPhantom = Omit<RemoteSdk, "avatar" | "adventures" | "content" | "ui" | "realtime" | "customRooms" | "room"> & {
|
|
8499
9533
|
readonly avatar: RemoteSdk["avatar"] & {
|
|
8500
9534
|
view(): Promise<FlashHandle>;
|
|
8501
9535
|
};
|
|
9536
|
+
readonly room: RemoteSdk["room"] & {
|
|
9537
|
+
surfaces(): Promise<RoomSurface[]>;
|
|
9538
|
+
};
|
|
8502
9539
|
readonly adventures: RemoteSdk["adventures"] & {
|
|
8503
9540
|
record(): AdventureRecorder;
|
|
8504
9541
|
};
|
|
8505
9542
|
readonly content: RemoteSdk["content"] & Pick<ContentApi, "load" | "replaceOnScreen">;
|
|
8506
9543
|
readonly realtime: RemoteSdk["realtime"] & {
|
|
8507
9544
|
join<Data = unknown, State extends RealtimeObject = RealtimeObject, Presence extends RealtimeObject = RealtimeObject>(spec: RealtimeChannelSpec, options?: RealtimeJoinOptions<Presence>): Promise<RealtimeChannel<Data, State, Presence>>;
|
|
9545
|
+
stayIn<Data = unknown, State extends RealtimeObject = RealtimeObject, Presence extends RealtimeObject = RealtimeObject>(spec: RealtimeChannelSpec, ready: (channel: RealtimeChannel<Data, State, Presence>) => void, options?: RealtimeStayOptions<Presence>): Promise<Unsubscribe>;
|
|
9546
|
+
};
|
|
9547
|
+
readonly customRooms: RemoteSdk["customRooms"] & {
|
|
9548
|
+
prop(id: string, roomId?: string): CustomRoomPropHandle;
|
|
9549
|
+
object(id: string, roomId?: string): CustomRoomObjectHandle;
|
|
9550
|
+
character(id: string, roomId?: string): CustomRoomCharacterHandle;
|
|
8508
9551
|
};
|
|
8509
9552
|
readonly ui: UiApi;
|
|
8510
9553
|
readonly recipes: PluginRecipes;
|