@wvdsh/api 0.1.32 → 0.1.34
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.
|
@@ -107,6 +107,7 @@ export declare const IFRAME_MESSAGE_TYPE: {
|
|
|
107
107
|
readonly MUTE_CHANGED: "MuteChanged";
|
|
108
108
|
readonly GAMEPLAY_JWT_READY: "GameplayJwtReady";
|
|
109
109
|
readonly END_SESSION: "EndSession";
|
|
110
|
+
readonly TRIGGER_PAYWALL: "TriggerPaywall";
|
|
110
111
|
};
|
|
111
112
|
export declare const SERVICE_WORKER_MESSAGE_TYPE: {
|
|
112
113
|
readonly EMBED_CONFIGURE: "embed.configure";
|
|
@@ -139,7 +140,7 @@ export interface SDKConfig {
|
|
|
139
140
|
launchParams: GameLaunchParams;
|
|
140
141
|
parentOrigin: string;
|
|
141
142
|
}
|
|
142
|
-
export type IframeResponseMessageTypes = typeof IFRAME_MESSAGE_TYPE.GET_LOBBY_INVITE_LINK | typeof IFRAME_MESSAGE_TYPE.GET_DEVICE_FINGERPRINT | typeof IFRAME_MESSAGE_TYPE.SET_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.TOGGLE_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.SET_MUTE | typeof IFRAME_MESSAGE_TYPE.TOGGLE_MUTE;
|
|
143
|
+
export type IframeResponseMessageTypes = typeof IFRAME_MESSAGE_TYPE.GET_LOBBY_INVITE_LINK | typeof IFRAME_MESSAGE_TYPE.GET_DEVICE_FINGERPRINT | typeof IFRAME_MESSAGE_TYPE.SET_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.TOGGLE_FULLSCREEN | typeof IFRAME_MESSAGE_TYPE.SET_MUTE | typeof IFRAME_MESSAGE_TYPE.TOGGLE_MUTE | typeof IFRAME_MESSAGE_TYPE.TRIGGER_PAYWALL;
|
|
143
144
|
export type IFrameEventPayloadMap = {
|
|
144
145
|
[IFRAME_MESSAGE_TYPE.FULLSCREEN_CHANGED]: {
|
|
145
146
|
isFullscreen: boolean;
|
|
@@ -168,6 +169,9 @@ export type IFrameEventPayloadMap = {
|
|
|
168
169
|
[IFRAME_MESSAGE_TYPE.GAMEPLAY_JWT_READY]: {
|
|
169
170
|
gameplayJwt: string;
|
|
170
171
|
};
|
|
172
|
+
[IFRAME_MESSAGE_TYPE.TRIGGER_PAYWALL]: {
|
|
173
|
+
purchased: boolean;
|
|
174
|
+
};
|
|
171
175
|
};
|
|
172
176
|
export interface GameLaunchParams {
|
|
173
177
|
lobby?: GenericId<'lobbies'>;
|
|
@@ -181,6 +185,10 @@ export declare const UrlParams: {
|
|
|
181
185
|
readonly EngineVersion: "engineversion";
|
|
182
186
|
readonly PlayKey: "pk";
|
|
183
187
|
readonly SdkConfig: "sdkconfig";
|
|
188
|
+
readonly Caller: "caller";
|
|
189
|
+
};
|
|
190
|
+
export declare const PlayRouteCaller: {
|
|
191
|
+
readonly Wavedash: "wavedash";
|
|
184
192
|
};
|
|
185
193
|
export declare const HEARTBEAT: {
|
|
186
194
|
/** Client sends heartbeat every 30 seconds when tab is visible */
|
|
@@ -83,7 +83,8 @@ export const IFRAME_MESSAGE_TYPE = {
|
|
|
83
83
|
TOGGLE_MUTE: 'ToggleMute',
|
|
84
84
|
MUTE_CHANGED: 'MuteChanged',
|
|
85
85
|
GAMEPLAY_JWT_READY: 'GameplayJwtReady',
|
|
86
|
-
END_SESSION: 'EndSession'
|
|
86
|
+
END_SESSION: 'EndSession',
|
|
87
|
+
TRIGGER_PAYWALL: 'TriggerPaywall'
|
|
87
88
|
};
|
|
88
89
|
// Wire types for messages on the page ↔ service-worker MessageChannel.
|
|
89
90
|
// Mirror of play's ServiceWorkerMessageType enum — kept here so the SDK and
|
|
@@ -108,7 +109,11 @@ export const UrlParams = {
|
|
|
108
109
|
Engine: 'engine',
|
|
109
110
|
EngineVersion: 'engineversion',
|
|
110
111
|
PlayKey: 'pk',
|
|
111
|
-
SdkConfig: 'sdkconfig'
|
|
112
|
+
SdkConfig: 'sdkconfig',
|
|
113
|
+
Caller: 'caller'
|
|
114
|
+
};
|
|
115
|
+
export const PlayRouteCaller = {
|
|
116
|
+
Wavedash: 'wavedash'
|
|
112
117
|
};
|
|
113
118
|
// ========== HEARTBEAT (client-side constants) ==========
|
|
114
119
|
const HEARTBEAT_CLIENT_INTERVAL_MS = 30_000;
|