@wvdsh/sdk-js 1.3.13 → 1.3.14
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/client.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WavedashSDK } from './index.js';
|
|
2
|
-
export { BackendConnectionPayload, EngineInstance, Friend, FullscreenChangedPayload, Leaderboard, LeaderboardDisplayType, LeaderboardEntries, LeaderboardSortOrder, ListUGCItemsArgs, Lobby, LobbyDataUpdatedPayload, LobbyInvite, LobbyInvitePayload, LobbyJoinResponse, LobbyJoinedPayload, LobbyKickedPayload, LobbyKickedReason, LobbyMessage, LobbyMessagePayload, LobbyUser, LobbyUserChangeType, LobbyUsersUpdatedPayload, LobbyVisibility, P2PConfig, P2PConnection, P2PConnectionEstablishedPayload, P2PConnectionFailedPayload, P2PMessage, P2PPacketDropReason, P2PPacketDroppedPayload, P2PPeer, P2PPeerDisconnectedPayload, P2PPeerReconnectedPayload, P2PPeerReconnectingPayload, PaginatedUGCItems, RemoteFileMetadata, StatsStoredPayload, UGCItem, UGCType, UGCVisibility, UpdateUGCItemArgs, UpsertedLeaderboardEntry, WavedashConfig, WavedashEvent, WavedashEventMap, WavedashResponse } from './index.js';
|
|
2
|
+
export { BackendConnectionPayload, EngineInstance, Friend, FullscreenChangedPayload, Leaderboard, LeaderboardDisplayType, LeaderboardEntries, LeaderboardSortOrder, ListUGCItemsArgs, Lobby, LobbyDataUpdatedPayload, LobbyInvite, LobbyInvitePayload, LobbyJoinResponse, LobbyJoinedPayload, LobbyKickedPayload, LobbyKickedReason, LobbyMessage, LobbyMessagePayload, LobbyUser, LobbyUserChangeType, LobbyUsersUpdatedPayload, LobbyVisibility, MuteChangedPayload, P2PConfig, P2PConnection, P2PConnectionEstablishedPayload, P2PConnectionFailedPayload, P2PMessage, P2PPacketDropReason, P2PPacketDroppedPayload, P2PPeer, P2PPeerDisconnectedPayload, P2PPeerReconnectedPayload, P2PPeerReconnectingPayload, PaginatedUGCItems, RemoteFileMetadata, StatsStoredPayload, UGCItem, UGCType, UGCVisibility, UpdateUGCItemArgs, UpsertedLeaderboardEntry, WavedashConfig, WavedashEvent, WavedashEventMap, WavedashResponse } from './index.js';
|
|
3
3
|
export { GameLaunchParams } from '@wvdsh/api';
|
|
4
4
|
export { GenericId as Id } from 'convex/values';
|
|
5
5
|
import 'convex/browser';
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ declare const WavedashEvents: {
|
|
|
31
31
|
readonly BACKEND_DISCONNECTED: "BackendDisconnected";
|
|
32
32
|
readonly BACKEND_RECONNECTING: "BackendReconnecting";
|
|
33
33
|
readonly FULLSCREEN_CHANGED: "FullscreenChanged";
|
|
34
|
+
readonly MUTE_CHANGED: "MuteChanged";
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
/** Reasons why a user was kicked from a lobby */
|
|
@@ -214,6 +215,10 @@ interface BackendConnectionPayload {
|
|
|
214
215
|
interface FullscreenChangedPayload {
|
|
215
216
|
isFullscreen: boolean;
|
|
216
217
|
}
|
|
218
|
+
/** Payload for MuteChanged event - emitted when mute state flips */
|
|
219
|
+
interface MuteChangedPayload {
|
|
220
|
+
isMuted: boolean;
|
|
221
|
+
}
|
|
217
222
|
type WavedashEventMap = {
|
|
218
223
|
[WavedashEvents.LOBBY_MESSAGE]: LobbyMessagePayload;
|
|
219
224
|
[WavedashEvents.LOBBY_JOINED]: LobbyJoinedPayload;
|
|
@@ -232,6 +237,7 @@ type WavedashEventMap = {
|
|
|
232
237
|
[WavedashEvents.BACKEND_DISCONNECTED]: BackendConnectionPayload;
|
|
233
238
|
[WavedashEvents.BACKEND_RECONNECTING]: BackendConnectionPayload;
|
|
234
239
|
[WavedashEvents.FULLSCREEN_CHANGED]: FullscreenChangedPayload;
|
|
240
|
+
[WavedashEvents.MUTE_CHANGED]: MuteChangedPayload;
|
|
235
241
|
};
|
|
236
242
|
interface P2PPeer {
|
|
237
243
|
userId: GenericId<"users">;
|
|
@@ -873,6 +879,7 @@ declare class WavedashSDK extends EventTarget {
|
|
|
873
879
|
readonly BACKEND_DISCONNECTED: "BackendDisconnected";
|
|
874
880
|
readonly BACKEND_RECONNECTING: "BackendReconnecting";
|
|
875
881
|
readonly FULLSCREEN_CHANGED: "FullscreenChanged";
|
|
882
|
+
readonly MUTE_CHANGED: "MuteChanged";
|
|
876
883
|
};
|
|
877
884
|
LobbyVisibility: {
|
|
878
885
|
readonly PUBLIC: 0;
|
|
@@ -1261,4 +1268,4 @@ declare global {
|
|
|
1261
1268
|
|
|
1262
1269
|
declare function setupWavedashSDK(): WavedashSDK;
|
|
1263
1270
|
|
|
1264
|
-
export { type BackendConnectionPayload, type EngineInstance, type Friend, type FullscreenChangedPayload, type Leaderboard, type LeaderboardDisplayType, type LeaderboardEntries, type LeaderboardSortOrder, type ListUGCItemsArgs, type Lobby, type LobbyDataUpdatedPayload, type LobbyInvite, type LobbyInvitePayload, type LobbyJoinResponse, type LobbyJoinedPayload, type LobbyKickedPayload, type LobbyKickedReason, type LobbyMessage, type LobbyMessagePayload, type LobbyUser, type LobbyUserChangeType, type LobbyUsersUpdatedPayload, type LobbyVisibility, type P2PConfig, type P2PConnection, type P2PConnectionEstablishedPayload, type P2PConnectionFailedPayload, type P2PMessage, type P2PPacketDropReason, type P2PPacketDroppedPayload, type P2PPeer, type P2PPeerDisconnectedPayload, type P2PPeerReconnectedPayload, type P2PPeerReconnectingPayload, type PaginatedUGCItems, type RemoteFileMetadata, type StatsStoredPayload, type UGCItem, type UGCType, type UGCVisibility, type UpdateUGCItemArgs, type UpsertedLeaderboardEntry, type WavedashConfig, type WavedashEvent, type WavedashEventMap, type WavedashResponse, WavedashSDK, setupWavedashSDK };
|
|
1271
|
+
export { type BackendConnectionPayload, type EngineInstance, type Friend, type FullscreenChangedPayload, type Leaderboard, type LeaderboardDisplayType, type LeaderboardEntries, type LeaderboardSortOrder, type ListUGCItemsArgs, type Lobby, type LobbyDataUpdatedPayload, type LobbyInvite, type LobbyInvitePayload, type LobbyJoinResponse, type LobbyJoinedPayload, type LobbyKickedPayload, type LobbyKickedReason, type LobbyMessage, type LobbyMessagePayload, type LobbyUser, type LobbyUserChangeType, type LobbyUsersUpdatedPayload, type LobbyVisibility, type MuteChangedPayload, type P2PConfig, type P2PConnection, type P2PConnectionEstablishedPayload, type P2PConnectionFailedPayload, type P2PMessage, type P2PPacketDropReason, type P2PPacketDroppedPayload, type P2PPeer, type P2PPeerDisconnectedPayload, type P2PPeerReconnectedPayload, type P2PPeerReconnectingPayload, type PaginatedUGCItems, type RemoteFileMetadata, type StatsStoredPayload, type UGCItem, type UGCType, type UGCVisibility, type UpdateUGCItemArgs, type UpsertedLeaderboardEntry, type WavedashConfig, type WavedashEvent, type WavedashEventMap, type WavedashResponse, WavedashSDK, setupWavedashSDK };
|
package/dist/index.js
CHANGED
|
@@ -75,8 +75,11 @@ var WavedashEvents = {
|
|
|
75
75
|
BACKEND_RECONNECTING: "BackendReconnecting",
|
|
76
76
|
// attempting to reconnect to backend
|
|
77
77
|
// Fullscreen events
|
|
78
|
-
FULLSCREEN_CHANGED: "FullscreenChanged"
|
|
78
|
+
FULLSCREEN_CHANGED: "FullscreenChanged",
|
|
79
79
|
// fullscreen state changed
|
|
80
|
+
// Audio events
|
|
81
|
+
MUTE_CHANGED: "MuteChanged"
|
|
82
|
+
// mute state changed
|
|
80
83
|
// TODO: Future events to implement
|
|
81
84
|
// P2P_CONNECTION_REQUESTED: 'P2PConnectionRequested', // for now we always connect all lobby members
|
|
82
85
|
};
|
|
@@ -3070,7 +3073,6 @@ var AudioManager = class extends WavedashManager {
|
|
|
3070
3073
|
this.handleMute = (data) => {
|
|
3071
3074
|
if (this._isMuted === data.isMuted) return;
|
|
3072
3075
|
this._isMuted = data.isMuted;
|
|
3073
|
-
logger.debug(`[AudioManager] muted=${this._isMuted}`);
|
|
3074
3076
|
const target = this._isMuted ? 0 : 1;
|
|
3075
3077
|
this.contexts.forEach((gain, ctx) => {
|
|
3076
3078
|
const now = ctx.currentTime;
|
|
@@ -3085,6 +3087,10 @@ var AudioManager = class extends WavedashManager {
|
|
|
3085
3087
|
setMutedNative.call(el, this._isMuted ? true : intended);
|
|
3086
3088
|
});
|
|
3087
3089
|
}
|
|
3090
|
+
this.sdk.gameEventManager.notifyGame(
|
|
3091
|
+
WavedashEvents.MUTE_CHANGED,
|
|
3092
|
+
{ isMuted: this._isMuted }
|
|
3093
|
+
);
|
|
3088
3094
|
};
|
|
3089
3095
|
this.installShims();
|
|
3090
3096
|
this.sdk.iframeMessenger.addEventListener(
|