@spawnco/sdk-types 0.0.44 → 0.0.46

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/index.d.mts CHANGED
@@ -14,6 +14,14 @@ interface MagicCdnApi {
14
14
  type ClipFormat = 'gif' | 'webm' | 'mp4';
15
15
  type ClipKind = 'world' | (string & {});
16
16
  type ClipStatus = 'ready' | 'processing' | 'hidden';
17
+ interface SoundSettings {
18
+ master: number;
19
+ music: number;
20
+ sfx: number;
21
+ ui: number;
22
+ ambience: number;
23
+ voice: number;
24
+ }
17
25
  interface ClipThumbnailDescriptor {
18
26
  assetUrl: string;
19
27
  contentType: string;
@@ -93,6 +101,10 @@ interface SpawnClientSDK__V1<TConfig = any> {
93
101
  query?: Record<string, string>;
94
102
  headers?: Record<string, string>;
95
103
  }): Promise<Room<ClientSentMessages, ServerSentMessages>>;
104
+ getConnectionUrl(options: {
105
+ roomId: string;
106
+ query?: Record<string, string>;
107
+ }): Promise<string>;
96
108
  };
97
109
  config: {
98
110
  get(): Promise<TConfig>;
@@ -174,6 +186,9 @@ interface SpawnClientSDK__V1<TConfig = any> {
174
186
  }>;
175
187
  };
176
188
  magicCdn: MagicCdnApi;
189
+ sound: {
190
+ get(): Promise<SoundSettings>;
191
+ };
177
192
  }
178
193
  interface SpawnServerSDK__V1<TConfig = any> {
179
194
  user: {
@@ -338,4 +353,4 @@ interface LeaderboardEntry {
338
353
  type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
339
354
  type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;
340
355
 
341
- export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
356
+ export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,14 @@ interface MagicCdnApi {
14
14
  type ClipFormat = 'gif' | 'webm' | 'mp4';
15
15
  type ClipKind = 'world' | (string & {});
16
16
  type ClipStatus = 'ready' | 'processing' | 'hidden';
17
+ interface SoundSettings {
18
+ master: number;
19
+ music: number;
20
+ sfx: number;
21
+ ui: number;
22
+ ambience: number;
23
+ voice: number;
24
+ }
17
25
  interface ClipThumbnailDescriptor {
18
26
  assetUrl: string;
19
27
  contentType: string;
@@ -93,6 +101,10 @@ interface SpawnClientSDK__V1<TConfig = any> {
93
101
  query?: Record<string, string>;
94
102
  headers?: Record<string, string>;
95
103
  }): Promise<Room<ClientSentMessages, ServerSentMessages>>;
104
+ getConnectionUrl(options: {
105
+ roomId: string;
106
+ query?: Record<string, string>;
107
+ }): Promise<string>;
96
108
  };
97
109
  config: {
98
110
  get(): Promise<TConfig>;
@@ -174,6 +186,9 @@ interface SpawnClientSDK__V1<TConfig = any> {
174
186
  }>;
175
187
  };
176
188
  magicCdn: MagicCdnApi;
189
+ sound: {
190
+ get(): Promise<SoundSettings>;
191
+ };
177
192
  }
178
193
  interface SpawnServerSDK__V1<TConfig = any> {
179
194
  user: {
@@ -338,4 +353,4 @@ interface LeaderboardEntry {
338
353
  type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
339
354
  type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;
340
355
 
341
- export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
356
+ export type { ClipDescriptor, ClipFormat, ClipKind, ClipListOptions, ClipLookupOptions, ClipStatus, ClipThumbnailDescriptor, InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SoundSettings, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, UploadClipOptions, User };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spawnco/sdk-types",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "TypeScript type definitions for Spawn SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/v1.ts CHANGED
@@ -18,6 +18,15 @@ export type ClipFormat = 'gif' | 'webm' | 'mp4';
18
18
  export type ClipKind = 'world' | (string & {});
19
19
  export type ClipStatus = 'ready' | 'processing' | 'hidden';
20
20
 
21
+ export interface SoundSettings {
22
+ master: number; // 0-1
23
+ music: number; // 0-1
24
+ sfx: number; // 0-1
25
+ ui: number; // 0-1
26
+ ambience: number; // 0-1
27
+ voice: number; // 0-1
28
+ }
29
+
21
30
  export interface ClipThumbnailDescriptor {
22
31
  assetUrl: string;
23
32
  contentType: string;
@@ -107,6 +116,7 @@ export interface SpawnClientSDK__V1<TConfig = any> {
107
116
  query?: Record<string, string>;
108
117
  headers?: Record<string, string>;
109
118
  }): Promise<Room<ClientSentMessages, ServerSentMessages>>;
119
+ getConnectionUrl(options: { roomId: string; query?: Record<string, string> }): Promise<string>;
110
120
  };
111
121
 
112
122
  config: {
@@ -201,6 +211,10 @@ export interface SpawnClientSDK__V1<TConfig = any> {
201
211
  };
202
212
 
203
213
  magicCdn: MagicCdnApi;
214
+
215
+ sound: {
216
+ get(): Promise<SoundSettings>;
217
+ };
204
218
  }
205
219
 
206
220
  // Server SDK - available in Durable Objects