@meshstream/p2p-web 0.0.0-stage → 0.2.1

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,536 @@
1
+ /** Core class for managing media streams loading via P2P. */
2
+ export var Core: {
3
+ new (config: any): {
4
+ eventTarget: {
5
+ events: Map<any, any>;
6
+ dispatchEvent(eventName: any, a1: any, a2: any, a3: any, a4: any, a5: any): void;
7
+ getEventDispatcher(eventName: any): (a1: any, a2: any, a3: any, a4: any, a5: any) => void;
8
+ addEventListener(eventName: any, listener: any): void;
9
+ removeEventListener(eventName: any, listener: any): void;
10
+ clear(): void;
11
+ };
12
+ manifestResponseUrl: any;
13
+ streams: Map<any, any>;
14
+ mainStreamConfig: {};
15
+ secondaryStreamConfig: {};
16
+ commonCoreConfig: {};
17
+ bandwidthCalculators: {
18
+ all: {
19
+ clearThresholdMs: number;
20
+ loadingsCount: number;
21
+ bytes: any[];
22
+ loadingOnlyTimestamps: any[];
23
+ timestamps: any[];
24
+ noLoadingsTime: number;
25
+ loadingsStoppedAt: number;
26
+ addBytes(bytesLength: any, now?: number): void;
27
+ startLoading(now?: number): void;
28
+ stopLoading(now?: number): void;
29
+ getBandwidthLoadingOnly(seconds: any, ignoreThresholdTimestamp?: number): number;
30
+ getBandwidth(seconds: any, ignoreThresholdTimestamp?: number, now?: number): number;
31
+ clearStale(): void;
32
+ clear(): void;
33
+ };
34
+ http: {
35
+ clearThresholdMs: number;
36
+ loadingsCount: number;
37
+ bytes: any[];
38
+ loadingOnlyTimestamps: any[];
39
+ timestamps: any[];
40
+ noLoadingsTime: number;
41
+ loadingsStoppedAt: number;
42
+ addBytes(bytesLength: any, now?: number): void;
43
+ startLoading(now?: number): void;
44
+ stopLoading(now?: number): void;
45
+ getBandwidthLoadingOnly(seconds: any, ignoreThresholdTimestamp?: number): number;
46
+ getBandwidth(seconds: any, ignoreThresholdTimestamp?: number, now?: number): number;
47
+ clearStale(): void;
48
+ clear(): void;
49
+ };
50
+ };
51
+ segmentStorage: any;
52
+ webTorrentSocketPool: {
53
+ "__#private@#sockets": Map<any, any>;
54
+ "__#private@#eventTarget": {
55
+ events: Map<any, any>;
56
+ dispatchEvent(eventName: any, a1: any, a2: any, a3: any, a4: any, a5: any): void;
57
+ getEventDispatcher(eventName: any): (a1: any, a2: any, a3: any, a4: any, a5: any) => void;
58
+ addEventListener(eventName: any, listener: any): void;
59
+ removeEventListener(eventName: any, listener: any): void;
60
+ clear(): void;
61
+ };
62
+ addEventListener(eventName: any, listener: any): void;
63
+ removeEventListener(eventName: any, listener: any): void;
64
+ acquire(url: any): {
65
+ client: any;
66
+ release: () => void;
67
+ };
68
+ destroy(): void;
69
+ };
70
+ socketPoolLogger: any;
71
+ peerId: string;
72
+ mainStreamLoader: any;
73
+ secondaryStreamLoader: any;
74
+ streamDetails: {
75
+ isLive: boolean;
76
+ activeLevelBitrate: number;
77
+ };
78
+ storageInitPromise: any;
79
+ /**
80
+ * Retrieves the current configuration for the core instance, ensuring immutability.
81
+ *
82
+ * @returns A deep readonly version of the core configuration.
83
+ */
84
+ getConfig(): any;
85
+ /**
86
+ * Applies a set of dynamic configuration updates to the core, merging with the existing configuration.
87
+ *
88
+ * @param dynamicConfig - A set of configuration changes to apply.
89
+ *
90
+ * @example
91
+ * // Example of dynamically updating the download time windows and timeout settings.
92
+ * const dynamicConfig = {
93
+ * httpDownloadTimeWindow: 60, // Set HTTP download time window to 60 seconds
94
+ * p2pDownloadTimeWindow: 60, // Set P2P download time window to 60 seconds
95
+ * httpNotReceivingBytesTimeoutMs: 1500, // Set HTTP timeout to 1500 milliseconds
96
+ * p2pNotReceivingBytesTimeoutMs: 1500 // Set P2P timeout to 1500 milliseconds
97
+ * };
98
+ * core.applyDynamicConfig(dynamicConfig);
99
+ */
100
+ applyDynamicConfig(dynamicConfig: any): void;
101
+ processSpecificDynamicConfigParams(prevConfig: any, updatedConfig: any, streamType: any): void;
102
+ getUpdatedStreamProperty(propertyName: any, updatedConfig: any, streamType: any): any;
103
+ /**
104
+ * Adds an event listener for the specified event type on the core event target.
105
+ *
106
+ * @param eventName - The name of the event to listen for.
107
+ * @param listener - The callback function to invoke when the event is fired.
108
+ */
109
+ addEventListener(eventName: any, listener: any): void;
110
+ /**
111
+ * Removes an event listener for the specified event type on the core event target.
112
+ *
113
+ * @param eventName - The name of the event to listen for.
114
+ * @param listener - The callback function to be removed.
115
+ */
116
+ removeEventListener(eventName: any, listener: any): void;
117
+ /**
118
+ * Sets the response URL for the manifest, stripping any query parameters.
119
+ *
120
+ * @param url - The full URL to the manifest response.
121
+ */
122
+ setManifestResponseUrl(url: any): void;
123
+ /**
124
+ * Checks if a segment is already stored within the core.
125
+ *
126
+ * @param segmentRuntimeId - The runtime identifier of the segment to check.
127
+ * @returns `true` if the segment is present, otherwise `false`.
128
+ */
129
+ hasSegment(segmentRuntimeId: any): boolean;
130
+ /**
131
+ * Retrieves a specific stream by its runtime identifier, if it exists.
132
+ *
133
+ * @param streamRuntimeId - The runtime identifier of the stream to retrieve.
134
+ * @returns The stream with its segments, or `undefined` if not found.
135
+ */
136
+ getStream(streamRuntimeId: any): any;
137
+ /**
138
+ * Ensures a stream exists in the map; adds it if it does not.
139
+ *
140
+ * @param stream - The stream to potentially add to the map.
141
+ */
142
+ addStreamIfNoneExists(stream: any): void;
143
+ /**
144
+ * Updates the segments associated with a specific stream.
145
+ *
146
+ * @param streamRuntimeId - The runtime identifier of the stream to update.
147
+ * @param addSegments - Optional segments to add to the stream.
148
+ * @param removeSegmentIds - Optional segment IDs to remove from the stream.
149
+ */
150
+ updateStream(streamRuntimeId: any, addSegments: any, removeSegmentIds: any): void;
151
+ /**
152
+ * Loads a segment given its runtime identifier and invokes the provided callbacks during the process.
153
+ * Initializes segment storage if it has not been initialized yet.
154
+ *
155
+ * @param segmentRuntimeId - The runtime identifier of the segment to load.
156
+ * @param callbacks - The callbacks to be invoked during segment loading.
157
+ * @throws {Error} - Throws if the manifest response URL is not defined.
158
+ */
159
+ loadSegment(segmentRuntimeId: any, callbacks: any): Promise<void>;
160
+ /**
161
+ * Aborts the loading of a segment specified by its runtime identifier.
162
+ *
163
+ * @param segmentRuntimeId - The runtime identifier of the segment whose loading is to be aborted.
164
+ */
165
+ abortSegmentLoading(segmentRuntimeId: any): void;
166
+ /**
167
+ * Updates the playback parameters while play head moves, specifically position and playback rate, for stream loaders.
168
+ *
169
+ * @param position - The new position in the stream, in seconds.
170
+ * @param rate - The new playback rate.
171
+ */
172
+ updatePlayback(position: any, rate: any): void;
173
+ /**
174
+ * Sets the active level bitrate, used for adjusting quality levels in adaptive streaming.
175
+ * Notifies the stream loaders if a change occurs.
176
+ *
177
+ * @param bitrate - The new bitrate to set as active.
178
+ */
179
+ setActiveLevelBitrate(bitrate: any): void;
180
+ /**
181
+ * Updates the 'isLive' status of the stream
182
+ *
183
+ * @param isLive - Boolean indicating whether the stream is live.
184
+ */
185
+ setIsLive(isLive: any): void;
186
+ /**
187
+ * Identify if a segment is loadable by the P2P core based on the segment's stream type and configuration.
188
+ * @param segmentRuntimeId Segment runtime identifier to check.
189
+ * @returns `true` if the segment is loadable by the P2P core, otherwise `false`.
190
+ */
191
+ isSegmentLoadable(segmentRuntimeId: any): boolean;
192
+ /**
193
+ * Cleans up resources used by the Core instance, including destroying any active stream loaders
194
+ * and clearing stored segments.
195
+ */
196
+ destroy(): void;
197
+ initializeSegmentStorage(): Promise<any>;
198
+ identifySegment(segmentRuntimeId: any): any;
199
+ overrideAllConfigs(dynamicConfig: any, mainStream: any, secondaryStream: any): void;
200
+ destroyStreamLoader(streamType: any): void;
201
+ getStreamHybridLoader(segment: any): any;
202
+ createNewHybridLoader(segment: any): {
203
+ streamManifestUrl: any;
204
+ lastRequestedSegment: any;
205
+ streamDetails: any;
206
+ config: any;
207
+ bandwidthCalculators: any;
208
+ segmentStorage: any;
209
+ webTorrentSocketPool: any;
210
+ eventTarget: any;
211
+ peerId: any;
212
+ requests: {
213
+ requestProcessQueueCallback: any;
214
+ bandwidthCalculators: any;
215
+ playback: any;
216
+ config: any;
217
+ eventTarget: any;
218
+ swarmId: any;
219
+ requests: Map<any, any>;
220
+ get executingHttpCount(): number;
221
+ get executingP2PCount(): number;
222
+ get(segment: any): any;
223
+ getOrCreateRequest(segment: any): any;
224
+ remove(request: any): void;
225
+ items(): MapIterator<any>;
226
+ httpRequests(): Generator<any, void, unknown>;
227
+ p2pRequests(): Generator<any, void, unknown>;
228
+ destroy(): void;
229
+ };
230
+ engineRequest: any;
231
+ p2pLoaders: {
232
+ "__#private@#loaders": Map<any, any>;
233
+ "__#private@#currentLoaderItem": any;
234
+ "__#private@#logger": any;
235
+ "__#private@#streamManifestUrl": any;
236
+ "__#private@#requests": any;
237
+ "__#private@#segmentStorage": any;
238
+ "__#private@#config": any;
239
+ "__#private@#webTorrentSocketPool": any;
240
+ "__#private@#eventTarget": any;
241
+ "__#private@#peerId": any;
242
+ "__#private@#onSegmentAnnouncement": any;
243
+ "__#private@#createLoader"(stream: any): {
244
+ loader: {
245
+ "__#private@#webtorrentManager": {
246
+ "__#private@#config": any;
247
+ "__#private@#eventTarget": {
248
+ events: Map<any, any>;
249
+ dispatchEvent(eventName: any, a1: any, a2: any, a3: any, a4: any, a5: any): void;
250
+ getEventDispatcher(eventName: any): (a1: any, a2: any, a3: any, a4: any, a5: any) => void;
251
+ addEventListener(eventName: any, listener: any): void;
252
+ removeEventListener(eventName: any, listener: any): void;
253
+ clear(): void;
254
+ };
255
+ "__#private@#connectingPeers": Set<any>;
256
+ "__#private@#connectedPeers": Map<any, any>;
257
+ "__#private@#clients": Set<any>;
258
+ "__#private@#destroyed": boolean;
259
+ "__#private@#started": boolean;
260
+ "__#private@#claimPeer": (remotePeerId: any) => boolean;
261
+ addEventListener(eventName: any, listener: any): void;
262
+ removeEventListener(eventName: any, listener: any): void;
263
+ start(): void;
264
+ destroy(): void;
265
+ "__#private@#closePeer"(peerId: any, cause: any): void;
266
+ "__#private@#addConnectedPeer"(peerId: any, connection: any, channel: any, trackerUrl: any): void;
267
+ };
268
+ "__#private@#peersMap": Map<any, any>;
269
+ "__#private@#swarmId": any;
270
+ "__#private@#streamSwarmId": string;
271
+ "__#private@#isAnnounceMicrotaskCreated": boolean;
272
+ "__#private@#webtorrentManagerLogger": any;
273
+ "__#private@#churnLogger": any;
274
+ "__#private@#infoHash": string;
275
+ "__#private@#streamManifestUrl": any;
276
+ "__#private@#stream": any;
277
+ "__#private@#requests": any;
278
+ "__#private@#segmentStorage": any;
279
+ "__#private@#config": any;
280
+ "__#private@#webTorrentSocketPool": any;
281
+ "__#private@#eventTarget": any;
282
+ "__#private@#onSegmentAnnouncement": any;
283
+ "__#private@#churnCleanupTimeoutId": NodeJS.Timeout;
284
+ "__#private@#onPeerConnect": any;
285
+ "__#private@#onPeerConnectError": any;
286
+ "__#private@#onPeerClose": any;
287
+ "__#private@#onPeerError": any;
288
+ "__#private@#onPeerWarning": any;
289
+ "__#private@#onTrackerWarning": any;
290
+ "__#private@#onTrackerError": any;
291
+ "__#private@#onPeerSegmentsAnnouncement": any;
292
+ "__#private@#churnCleanup": () => void;
293
+ downloadSegment(segment: any): void;
294
+ isSegmentLoadingOrLoadedBySomeone(segment: any): boolean;
295
+ isSegmentLoadedBySomeone(segment: any): boolean;
296
+ get connectedPeerCount(): number;
297
+ peers(): Generator<any, void, unknown>;
298
+ "__#private@#getSegmentsAnnouncement"(): {
299
+ loaded: any;
300
+ httpLoading: any[];
301
+ };
302
+ "__#private@#onPeerConnectedWebTorrent": (event: any) => void;
303
+ "__#private@#onPeerDisconnectedWebTorrent": (event: any) => void;
304
+ broadcastAnnouncement: (sendEmptyAnnouncement?: boolean) => void;
305
+ "__#private@#sendSegmentsAnnouncement": (sendEmptyAnnouncement?: boolean) => void;
306
+ "__#private@#onSegmentRequested": (peer: any, segmentExternalId: any, requestId: any, byteFrom: any) => Promise<void>;
307
+ destroy(): void;
308
+ };
309
+ stream: any;
310
+ loggerInfo: string;
311
+ };
312
+ "__#private@#findOrCreateLoaderForStream"(stream: any): any;
313
+ changeCurrentLoader(stream: any): void;
314
+ "__#private@#setLoaderDestroyTimeout"(item: any): void;
315
+ "__#private@#destroyAndRemoveLoader"(item: any): void;
316
+ get currentLoader(): any;
317
+ destroy(): void;
318
+ };
319
+ playback: {
320
+ position: any;
321
+ rate: number;
322
+ };
323
+ segmentAvgDuration: number;
324
+ logger: any;
325
+ levelChangedTimestamp: any;
326
+ lastQueueProcessingTimeStamp: any;
327
+ randomHttpDownloadTimeout: any;
328
+ initialHttpDelayTimeoutId: any;
329
+ isProcessQueueMicrotaskCreated: boolean;
330
+ swarmId: any;
331
+ createdAt: number;
332
+ setIntervalLoading(): void;
333
+ loadSegment(segment: any, callbacks: any): Promise<void>;
334
+ requestProcessQueueMicrotask: (force?: boolean) => void;
335
+ processRequests(queueSegmentIds: any, queueDownloadRatio: any): void;
336
+ processQueue(): void;
337
+ abortSegmentRequest(segmentRuntimeId: any): void;
338
+ loadThroughHttp(segment: any): void;
339
+ loadThroughP2P(segment: any): void;
340
+ loadRandomThroughHttp(): void;
341
+ abortLastHttpLoadingInQueueAfterItem(queue: any, segment: any): boolean;
342
+ abortLastP2PLoadingInQueueAfterItem(queue: any, segment: any): boolean;
343
+ getAvailableStorageCapacityPercent(): number;
344
+ generateQueue(): {
345
+ queue: {
346
+ segment: any;
347
+ statuses: {
348
+ isHighDemand: boolean;
349
+ isHttpDownloadable: boolean;
350
+ isP2PDownloadable: any;
351
+ };
352
+ }[];
353
+ queueSegmentIds: Set<any>;
354
+ maxPossibleLength: number;
355
+ alreadyLoadedCount: number;
356
+ queueDownloadRatio: number;
357
+ };
358
+ getBandwidth(queueDownloadRatio: any): any;
359
+ notifyLevelChanged(): void;
360
+ sendBroadcastAnnouncement(sendEmptySegmentsAnnouncement?: boolean): void;
361
+ updatePlayback(position: any, rate: any): void;
362
+ updateStream(stream: any): void;
363
+ destroy(): void;
364
+ };
365
+ };
366
+ /** Default configuration for common core settings. */
367
+ DEFAULT_COMMON_CORE_CONFIG: {
368
+ segmentMemoryStorageLimit: undefined;
369
+ customSegmentStorageFactory: undefined;
370
+ trackerClientVersionPrefix: string;
371
+ };
372
+ /** Default configuration for stream settings. */
373
+ DEFAULT_STREAM_CONFIG: {
374
+ isP2PUploadDisabled: boolean;
375
+ isP2PDisabled: boolean;
376
+ simultaneousHttpDownloads: number;
377
+ simultaneousP2PDownloads: number;
378
+ preferP2PForEngineRequest: boolean;
379
+ highDemandTimeWindow: number;
380
+ httpDownloadInitialTimeoutMs: number;
381
+ httpDownloadTimeWindow: number;
382
+ p2pDownloadTimeWindow: number;
383
+ webRtcMaxMessageSize: number;
384
+ p2pNotReceivingBytesTimeoutMs: number;
385
+ p2pInactiveLoaderDestroyTimeoutMs: number;
386
+ httpNotReceivingBytesTimeoutMs: number;
387
+ httpErrorRetries: number;
388
+ p2pErrorRetries: number;
389
+ announceTrackers: string[];
390
+ rtcConfig: {
391
+ iceServers: {
392
+ urls: string;
393
+ }[];
394
+ };
395
+ validateP2PSegment: undefined;
396
+ validateHTTPSegment: undefined;
397
+ httpRequestSetup: undefined;
398
+ swarmId: undefined;
399
+ p2pMaxPeers: number;
400
+ p2pChurnMaxPeersMultiplier: number;
401
+ p2pChurnCleanupIntervalMs: number;
402
+ p2pChurnGracePeriodMs: number;
403
+ webRtcOffersCount: number;
404
+ webRtcOfferTimeoutMs: number;
405
+ webRtcIceGatheringTimeoutMs: number;
406
+ webRtcConnectionTimeoutMs: number;
407
+ };
408
+ };
409
+ /** Custom error class for errors that occur during core network requests. */
410
+ export var CoreRequestError: {
411
+ new (type: any, message: any, cause: any): {
412
+ name: string;
413
+ type: any;
414
+ cause: any;
415
+ message: string;
416
+ stack?: string;
417
+ };
418
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
419
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
420
+ stackTraceLimit: number;
421
+ };
422
+ /** Represents an error that occurred while establishing a peer connection. */
423
+ export var PeerConnectError: {
424
+ new (type: any, message: any, cause: any): {
425
+ name: string;
426
+ type: any;
427
+ cause: any;
428
+ message: string;
429
+ stack?: string;
430
+ };
431
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
432
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
433
+ stackTraceLimit: number;
434
+ };
435
+ /** Represents an error that occurred during a peer connection. */
436
+ export var PeerError: {
437
+ new (type: any, message: any, cause: any): {
438
+ name: string;
439
+ type: any;
440
+ cause: any;
441
+ message: string;
442
+ stack?: string;
443
+ };
444
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
445
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
446
+ stackTraceLimit: number;
447
+ };
448
+ /** Represents a warning that occurred during a peer connection. */
449
+ export var PeerWarning: {
450
+ new (type: any, message: any, cause: any): {
451
+ name: string;
452
+ type: any;
453
+ cause: any;
454
+ message: string;
455
+ stack?: string;
456
+ };
457
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
458
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
459
+ stackTraceLimit: number;
460
+ };
461
+ /**
462
+ * Represents an error that can occur during the request process, with a timestamp for when the error occurred.
463
+ * @template T - The specific type of request error.
464
+ */
465
+ export var RequestError: {
466
+ new <T>(type: any, message: any, cause: any): {
467
+ name: string;
468
+ /** Error timestamp. */
469
+ timestamp: number;
470
+ type: any;
471
+ cause: any;
472
+ message: string;
473
+ stack?: string;
474
+ };
475
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
476
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
477
+ stackTraceLimit: number;
478
+ };
479
+ /** Represents an error that occurred during a tracker request. */
480
+ export var TrackerError: {
481
+ new (type: any, message: any, cause: any): {
482
+ name: string;
483
+ type: any;
484
+ cause: any;
485
+ message: string;
486
+ stack?: string;
487
+ };
488
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
489
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
490
+ stackTraceLimit: number;
491
+ };
492
+ /** Represents a warning that occurred during a tracker request. */
493
+ export var TrackerWarning: {
494
+ new (type: any, message: any, cause: any): {
495
+ name: string;
496
+ type: any;
497
+ cause: any;
498
+ message: string;
499
+ stack?: string;
500
+ };
501
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
502
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
503
+ stackTraceLimit: number;
504
+ };
505
+ /**
506
+ * Base class for domain-specific errors carrying a machine-readable type discriminator.
507
+ * @internal
508
+ */
509
+ export var TypedError: {
510
+ new (type: any, message: any, cause: any): {
511
+ type: any;
512
+ cause: any;
513
+ name: string;
514
+ message: string;
515
+ stack?: string;
516
+ };
517
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
518
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
519
+ stackTraceLimit: number;
520
+ };
521
+ export var debug: any;
522
+ /**
523
+ * Generates a stable, unique string ID for a stream based on its properties.
524
+ * Uses a SHA-1 hash to avoid collisions and encodes the result to standard Base64.
525
+ */
526
+ export function generateStreamShortId({ bitrate, codecs, width, height, language, channels, name, frameRate, videoRange }: {
527
+ bitrate: any;
528
+ codecs: any;
529
+ width: any;
530
+ height: any;
531
+ language: any;
532
+ channels: any;
533
+ name: any;
534
+ frameRate: any;
535
+ videoRange: any;
536
+ }): string;
@@ -0,0 +1,2 @@
1
+ /** SDK release identifier attached to all Web usage reports. */
2
+ export declare const MESHSTREAM_WEB_SDK_VERSION = "0.2.0";
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
- {
2
- "name": "@meshstream/p2p-web",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@meshstream/p2p-web",
3
+ "version": "0.2.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./adapters": {
13
+ "types": "./dist/adapters.d.ts",
14
+ "import": "./dist/adapters.js"
15
+ },
16
+ "./advanced": {
17
+ "types": "./dist/advanced.d.ts",
18
+ "import": "./dist/advanced.js"
19
+ },
20
+ "./service-worker": {
21
+ "types": "./dist/service-worker.d.ts",
22
+ "import": "./dist/service-worker.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist/*.d.ts",
27
+ "dist/**/*.d.ts",
28
+ "dist/index.js",
29
+ "dist/adapters.js",
30
+ "dist/advanced.js",
31
+ "dist/service-worker.js",
32
+ "dist/meshstream-sw.js",
33
+ "src/vendor/MESHSTREAM_CORE_LICENSE.txt"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsc -p tsconfig.json",
37
+ "build:release": "npm run build && node ../../scripts/bundle-web-sdk.mjs && node ../../scripts/minify-web-sdk.mjs dist",
38
+ "test": "npm run build && node --test test/*.test.mjs",
39
+ "prepack": "npm test && npm run build:release",
40
+ "pack:dry-run": "npm pack --dry-run"
41
+ },
42
+ "devDependencies": {
43
+ "dashjs": "^5.2.1",
44
+ "esbuild": "^0.28.2",
45
+ "hls.js": "^1.6.13",
46
+ "p2p-media-loader-core": "file:src/vendor/p2p-media-loader-core-3.0.1.tgz",
47
+ "p2p-media-loader-hlsjs": "3.0.1",
48
+ "p2p-media-loader-shaka": "3.0.1",
49
+ "shaka-player": "^4.16.47",
50
+ "terser": "^5.51.2",
51
+ "typescript": "^5.9.0"
52
+ }
53
+ }