hytopia 0.11.6 → 0.11.8

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.
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [AssetsLibrary](./server.assetslibrary.md) &gt; [assetsLibraryPath](./server.assetslibrary.assetslibrarypath.md)
4
+
5
+ ## AssetsLibrary.assetsLibraryPath property
6
+
7
+ The path to the assets library package. Null if assets library is not available.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ readonly assetsLibraryPath: string | null;
13
+ ```
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [AssetsLibrary](./server.assetslibrary.md) &gt; [instance](./server.assetslibrary.instance.md)
4
+
5
+ ## AssetsLibrary.instance property
6
+
7
+ The global AssetsLibrary instance as a singleton.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ static readonly instance: AssetsLibrary;
13
+ ```
@@ -0,0 +1,133 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [AssetsLibrary](./server.assetslibrary.md)
4
+
5
+ ## AssetsLibrary class
6
+
7
+ Manages the assets library and synchronization of assets to the local assets directory in development.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export default class AssetsLibrary
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ The AssetsLibrary is created internally as a global singletone accessible with the static property `AssetsLibrary.instance`<!-- -->.
18
+
19
+ Please note: Assets will automatically sync to local assets in development mode the first time an asset in the library is requested by the client. This means you do not need to explicitly handle calling syncAsset() yourself unless you have a specific reason to.
20
+
21
+ ## Example
22
+
23
+
24
+ ```typescript
25
+ import { AssetsLibrary } from 'hytopia';
26
+
27
+ const assetsLibrary = AssetsLibrary.instance;
28
+ assetsLibrary.syncAsset('assets/models/player.gltf');
29
+ ```
30
+
31
+ ## Properties
32
+
33
+ <table><thead><tr><th>
34
+
35
+ Property
36
+
37
+
38
+ </th><th>
39
+
40
+ Modifiers
41
+
42
+
43
+ </th><th>
44
+
45
+ Type
46
+
47
+
48
+ </th><th>
49
+
50
+ Description
51
+
52
+
53
+ </th></tr></thead>
54
+ <tbody><tr><td>
55
+
56
+ [assetsLibraryPath](./server.assetslibrary.assetslibrarypath.md)
57
+
58
+
59
+ </td><td>
60
+
61
+ `readonly`
62
+
63
+
64
+ </td><td>
65
+
66
+ string \| null
67
+
68
+
69
+ </td><td>
70
+
71
+ The path to the assets library package. Null if assets library is not available.
72
+
73
+
74
+ </td></tr>
75
+ <tr><td>
76
+
77
+ [instance](./server.assetslibrary.instance.md)
78
+
79
+
80
+ </td><td>
81
+
82
+ `static`
83
+
84
+ `readonly`
85
+
86
+
87
+ </td><td>
88
+
89
+ [AssetsLibrary](./server.assetslibrary.md)
90
+
91
+
92
+ </td><td>
93
+
94
+ The global AssetsLibrary instance as a singleton.
95
+
96
+
97
+ </td></tr>
98
+ </tbody></table>
99
+
100
+ ## Methods
101
+
102
+ <table><thead><tr><th>
103
+
104
+ Method
105
+
106
+
107
+ </th><th>
108
+
109
+ Modifiers
110
+
111
+
112
+ </th><th>
113
+
114
+ Description
115
+
116
+
117
+ </th></tr></thead>
118
+ <tbody><tr><td>
119
+
120
+ [syncAsset(assetPath)](./server.assetslibrary.syncasset.md)
121
+
122
+
123
+ </td><td>
124
+
125
+
126
+ </td><td>
127
+
128
+ Synchronizes an asset from the assets library to the local assets directory.
129
+
130
+
131
+ </td></tr>
132
+ </tbody></table>
133
+
@@ -0,0 +1,58 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [AssetsLibrary](./server.assetslibrary.md) &gt; [syncAsset](./server.assetslibrary.syncasset.md)
4
+
5
+ ## AssetsLibrary.syncAsset() method
6
+
7
+ Synchronizes an asset from the assets library to the local assets directory.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ syncAsset(assetPath: string): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ assetPath
36
+
37
+
38
+ </td><td>
39
+
40
+ string
41
+
42
+
43
+ </td><td>
44
+
45
+ The path of the asset to copy to local assets.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ void
54
+
55
+ ## Remarks
56
+
57
+ Syncs an asset from the assets library to local assets in development. The assets library is unavailable in production, so assets must be local to the project.
58
+
package/docs/server.md CHANGED
@@ -19,6 +19,17 @@ Description
19
19
  </th></tr></thead>
20
20
  <tbody><tr><td>
21
21
 
22
+ [AssetsLibrary](./server.assetslibrary.md)
23
+
24
+
25
+ </td><td>
26
+
27
+ Manages the assets library and synchronization of assets to the local assets directory in development.
28
+
29
+
30
+ </td></tr>
31
+ <tr><td>
32
+
22
33
  [Audio](./server.audio.md)
23
34
 
24
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.11.6",
3
+ "version": "0.11.8",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./server.mjs",
package/server.api.json CHANGED
@@ -173,6 +173,134 @@
173
173
  "name": "",
174
174
  "preserveMemberOrder": false,
175
175
  "members": [
176
+ {
177
+ "kind": "Class",
178
+ "canonicalReference": "server!AssetsLibrary:class",
179
+ "docComment": "/**\n * Manages the assets library and synchronization of assets to the local assets directory in development.\n *\n * @remarks\n *\n * The AssetsLibrary is created internally as a global singletone accessible with the static property `AssetsLibrary.instance`.\n *\n * Please note: Assets will automatically sync to local assets in development mode the first time an asset in the library is requested by the client. This means you do not need to explicitly handle calling syncAsset() yourself unless you have a specific reason to.\n *\n * @example\n * ```typescript\n * import { AssetsLibrary } from 'hytopia';\n *\n * const assetsLibrary = AssetsLibrary.instance;\n * assetsLibrary.syncAsset('assets/models/player.gltf');\n * ```\n *\n */\n",
180
+ "excerptTokens": [
181
+ {
182
+ "kind": "Content",
183
+ "text": "export default class AssetsLibrary "
184
+ }
185
+ ],
186
+ "fileUrlPath": "src/assets/AssetsLibrary.ts",
187
+ "releaseTag": "Public",
188
+ "isAbstract": false,
189
+ "name": "AssetsLibrary",
190
+ "preserveMemberOrder": false,
191
+ "members": [
192
+ {
193
+ "kind": "Property",
194
+ "canonicalReference": "server!AssetsLibrary#assetsLibraryPath:member",
195
+ "docComment": "/**\n * The path to the assets library package. Null if assets library is not available.\n */\n",
196
+ "excerptTokens": [
197
+ {
198
+ "kind": "Content",
199
+ "text": "readonly assetsLibraryPath: "
200
+ },
201
+ {
202
+ "kind": "Content",
203
+ "text": "string | null"
204
+ },
205
+ {
206
+ "kind": "Content",
207
+ "text": ";"
208
+ }
209
+ ],
210
+ "isReadonly": true,
211
+ "isOptional": false,
212
+ "releaseTag": "Public",
213
+ "name": "assetsLibraryPath",
214
+ "propertyTypeTokenRange": {
215
+ "startIndex": 1,
216
+ "endIndex": 2
217
+ },
218
+ "isStatic": false,
219
+ "isProtected": false,
220
+ "isAbstract": false
221
+ },
222
+ {
223
+ "kind": "Property",
224
+ "canonicalReference": "server!AssetsLibrary.instance:member",
225
+ "docComment": "/**\n * The global AssetsLibrary instance as a singleton.\n */\n",
226
+ "excerptTokens": [
227
+ {
228
+ "kind": "Content",
229
+ "text": "static readonly instance: "
230
+ },
231
+ {
232
+ "kind": "Reference",
233
+ "text": "AssetsLibrary",
234
+ "canonicalReference": "server!AssetsLibrary:class"
235
+ },
236
+ {
237
+ "kind": "Content",
238
+ "text": ";"
239
+ }
240
+ ],
241
+ "isReadonly": true,
242
+ "isOptional": false,
243
+ "releaseTag": "Public",
244
+ "name": "instance",
245
+ "propertyTypeTokenRange": {
246
+ "startIndex": 1,
247
+ "endIndex": 2
248
+ },
249
+ "isStatic": true,
250
+ "isProtected": false,
251
+ "isAbstract": false
252
+ },
253
+ {
254
+ "kind": "Method",
255
+ "canonicalReference": "server!AssetsLibrary#syncAsset:member(1)",
256
+ "docComment": "/**\n * Synchronizes an asset from the assets library to the local assets directory.\n *\n * @remarks\n *\n * Syncs an asset from the assets library to local assets in development. The assets library is unavailable in production, so assets must be local to the project.\n *\n * @param assetPath - The path of the asset to copy to local assets.\n */\n",
257
+ "excerptTokens": [
258
+ {
259
+ "kind": "Content",
260
+ "text": "syncAsset(assetPath: "
261
+ },
262
+ {
263
+ "kind": "Content",
264
+ "text": "string"
265
+ },
266
+ {
267
+ "kind": "Content",
268
+ "text": "): "
269
+ },
270
+ {
271
+ "kind": "Content",
272
+ "text": "void"
273
+ },
274
+ {
275
+ "kind": "Content",
276
+ "text": ";"
277
+ }
278
+ ],
279
+ "isStatic": false,
280
+ "returnTypeTokenRange": {
281
+ "startIndex": 3,
282
+ "endIndex": 4
283
+ },
284
+ "releaseTag": "Public",
285
+ "isProtected": false,
286
+ "overloadIndex": 1,
287
+ "parameters": [
288
+ {
289
+ "parameterName": "assetPath",
290
+ "parameterTypeTokenRange": {
291
+ "startIndex": 1,
292
+ "endIndex": 2
293
+ },
294
+ "isOptional": false
295
+ }
296
+ ],
297
+ "isOptional": false,
298
+ "isAbstract": false,
299
+ "name": "syncAsset"
300
+ }
301
+ ],
302
+ "implementsTokenRanges": []
303
+ },
176
304
  {
177
305
  "kind": "Class",
178
306
  "canonicalReference": "server!Audio:class",
package/server.d.ts CHANGED
@@ -12,6 +12,45 @@ import * as Sentry from '@sentry/node';
12
12
  import type { Socket } from 'net';
13
13
  import { WebSocket as WebSocket_2 } from 'ws';
14
14
 
15
+ /**
16
+ * Manages the assets library and synchronization of assets
17
+ * to the local assets directory in development.
18
+ *
19
+ * @remarks
20
+ * The AssetsLibrary is created internally as a global
21
+ * singletone accessible with the static property
22
+ * `AssetsLibrary.instance`.
23
+ *
24
+ * Please note: Assets will automatically sync to local assets in
25
+ * development mode the first time an asset in the library is requested
26
+ * by the client. This means you do not need to explicitly handle
27
+ * calling syncAsset() yourself unless you have a specific reason to.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * import { AssetsLibrary } from 'hytopia';
32
+ *
33
+ * const assetsLibrary = AssetsLibrary.instance;
34
+ * assetsLibrary.syncAsset('assets/models/player.gltf');
35
+ * ```
36
+ */
37
+ export declare class AssetsLibrary {
38
+ /** The global AssetsLibrary instance as a singleton. */
39
+ static readonly instance: AssetsLibrary;
40
+ /** The path to the assets library package. Null if assets library is not available. */
41
+ readonly assetsLibraryPath: string | null;
42
+ /**
43
+ * Synchronizes an asset from the assets library to the local assets directory.
44
+ *
45
+ * @remarks
46
+ * Syncs an asset from the assets library to local assets in development.
47
+ * The assets library is unavailable in production, so assets must be local to the project.
48
+ *
49
+ * @param assetPath - The path of the asset to copy to local assets.
50
+ */
51
+ syncAsset(assetPath: string): void;
52
+ }
53
+
15
54
  /**
16
55
  * Represents a audio playback in a world.
17
56
  *