@spawnco/sdk-types 0.0.38 → 0.0.40
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 +12 -0
- package/dist/index.d.ts +12 -0
- package/package.json +1 -1
- package/src/v1.ts +16 -0
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* Current modules: user, room, economy, inventory, storage
|
|
5
5
|
* Future modules: friends, achievements, chat, ai, leaderboards, tournaments
|
|
6
6
|
*/
|
|
7
|
+
interface MagicCdnMediaToken {
|
|
8
|
+
token: string;
|
|
9
|
+
expiresAtMs: number;
|
|
10
|
+
}
|
|
11
|
+
interface MagicCdnApi {
|
|
12
|
+
getMediaToken(): Promise<MagicCdnMediaToken>;
|
|
13
|
+
}
|
|
7
14
|
interface SpawnClientSDK__V1<TConfig = any> {
|
|
8
15
|
ready(): Promise<void>;
|
|
9
16
|
user: {
|
|
@@ -96,6 +103,7 @@ interface SpawnClientSDK__V1<TConfig = any> {
|
|
|
96
103
|
error?: string;
|
|
97
104
|
}>;
|
|
98
105
|
};
|
|
106
|
+
magicCdn: MagicCdnApi;
|
|
99
107
|
}
|
|
100
108
|
interface SpawnServerSDK__V1<TConfig = any> {
|
|
101
109
|
user: {
|
|
@@ -110,6 +118,10 @@ interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
110
118
|
}>;
|
|
111
119
|
};
|
|
112
120
|
};
|
|
121
|
+
chat: {
|
|
122
|
+
/** Returns true if the user is currently muted (and not expired) */
|
|
123
|
+
checkIsMuted(userId: string): Promise<boolean>;
|
|
124
|
+
};
|
|
113
125
|
sparks: {
|
|
114
126
|
verifyPurchase({ purchaseId, price }: {
|
|
115
127
|
purchaseId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* Current modules: user, room, economy, inventory, storage
|
|
5
5
|
* Future modules: friends, achievements, chat, ai, leaderboards, tournaments
|
|
6
6
|
*/
|
|
7
|
+
interface MagicCdnMediaToken {
|
|
8
|
+
token: string;
|
|
9
|
+
expiresAtMs: number;
|
|
10
|
+
}
|
|
11
|
+
interface MagicCdnApi {
|
|
12
|
+
getMediaToken(): Promise<MagicCdnMediaToken>;
|
|
13
|
+
}
|
|
7
14
|
interface SpawnClientSDK__V1<TConfig = any> {
|
|
8
15
|
ready(): Promise<void>;
|
|
9
16
|
user: {
|
|
@@ -96,6 +103,7 @@ interface SpawnClientSDK__V1<TConfig = any> {
|
|
|
96
103
|
error?: string;
|
|
97
104
|
}>;
|
|
98
105
|
};
|
|
106
|
+
magicCdn: MagicCdnApi;
|
|
99
107
|
}
|
|
100
108
|
interface SpawnServerSDK__V1<TConfig = any> {
|
|
101
109
|
user: {
|
|
@@ -110,6 +118,10 @@ interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
110
118
|
}>;
|
|
111
119
|
};
|
|
112
120
|
};
|
|
121
|
+
chat: {
|
|
122
|
+
/** Returns true if the user is currently muted (and not expired) */
|
|
123
|
+
checkIsMuted(userId: string): Promise<boolean>;
|
|
124
|
+
};
|
|
113
125
|
sparks: {
|
|
114
126
|
verifyPurchase({ purchaseId, price }: {
|
|
115
127
|
purchaseId: string;
|
package/package.json
CHANGED
package/src/v1.ts
CHANGED
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
* Future modules: friends, achievements, chat, ai, leaderboards, tournaments
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
interface MagicCdnMediaToken {
|
|
9
|
+
token: string;
|
|
10
|
+
expiresAtMs: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface MagicCdnApi {
|
|
14
|
+
getMediaToken(): Promise<MagicCdnMediaToken>;
|
|
15
|
+
}
|
|
16
|
+
|
|
8
17
|
// Client SDK - available in browser
|
|
9
18
|
export interface SpawnClientSDK__V1<TConfig = any> {
|
|
10
19
|
ready(): Promise<void>;
|
|
@@ -113,6 +122,8 @@ export interface SpawnClientSDK__V1<TConfig = any> {
|
|
|
113
122
|
error?: string;
|
|
114
123
|
}>;
|
|
115
124
|
};
|
|
125
|
+
|
|
126
|
+
magicCdn: MagicCdnApi;
|
|
116
127
|
}
|
|
117
128
|
|
|
118
129
|
// Server SDK - available in Durable Objects
|
|
@@ -123,6 +134,11 @@ export interface SpawnServerSDK__V1<TConfig = any> {
|
|
|
123
134
|
};
|
|
124
135
|
};
|
|
125
136
|
|
|
137
|
+
chat: {
|
|
138
|
+
/** Returns true if the user is currently muted (and not expired) */
|
|
139
|
+
checkIsMuted(userId: string): Promise<boolean>;
|
|
140
|
+
};
|
|
141
|
+
|
|
126
142
|
sparks: {
|
|
127
143
|
verifyPurchase({ purchaseId, price }: { purchaseId: string; price: number }): Promise<boolean>;
|
|
128
144
|
};
|