Skip to content

Commit 14773e2

Browse files
authored
Add ESM files to package json (#4543)
* Output ESM via webpack build script * Remove ESM output from dev config * Remove unnecessary import * fix: update package json export fields * no message * no message
1 parent af008d6 commit 14773e2

File tree

2 files changed

+58
-4
lines changed

2 files changed

+58
-4
lines changed

index.d.ts

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ declare namespace dashjs {
1717
setCalleeNameVisible(flag: boolean): void;
1818
}
1919

20+
namespace Debug {
21+
const LOG_LEVEL_NONE = 0;
22+
const LOG_LEVEL_FATAL = 1;
23+
const LOG_LEVEL_ERROR = 2;
24+
const LOG_LEVEL_WARNING = 3;
25+
const LOG_LEVEL_INFO = 4;
26+
const LOG_LEVEL_DEBUG = 5;
27+
}
28+
2029
interface EventBus {
2130
on(type: string, listener: any, scope: any, options?: object): void;
2231

@@ -1296,6 +1305,14 @@ declare namespace dashjs {
12961305

12971306
export type TrackSelectionFunction = (tracks: MediaInfo[]) => MediaInfo[];
12981307

1308+
export interface DvrWindow {
1309+
start: number;
1310+
end: number;
1311+
startAsUtc: number;
1312+
endAsUtc: number;
1313+
size: number;
1314+
}
1315+
12991316
export interface MediaPlayerClass {
13001317
setConfig(config: object): void;
13011318

@@ -1427,7 +1444,7 @@ declare namespace dashjs {
14271444

14281445
timeInDvrWindow(): number;
14291446

1430-
getDvrWindow(): object;
1447+
getDvrWindow(): DvrWindow;
14311448

14321449
duration(): number;
14331450

@@ -1483,7 +1500,7 @@ declare namespace dashjs {
14831500

14841501
setTextTrack(idx: number): void;
14851502

1486-
getRepresentationsFor(type: MediaType): Representation[];
1503+
getRepresentationsByType(type: MediaType): Representation[];
14871504

14881505
getStreamsFromManifest(manifest: object): StreamInfo[];
14891506

@@ -3178,6 +3195,31 @@ declare namespace dashjs {
31783195
MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE: 'DRM: licenser error! --';
31793196
}
31803197

3198+
/**
3199+
* Streaming - Protection - Events
3200+
**/
3201+
3202+
export interface ProtectionEvents {
3203+
KEY_ADDED: 'public_keyAdded';
3204+
KEY_ERROR: 'public_keyError';
3205+
KEY_MESSAGE: 'public_keyMessage';
3206+
KEY_SESSION_CLOSED: 'public_keySessionClosed';
3207+
KEY_SESSION_CREATED: 'public_keySessionCreated';
3208+
KEY_SESSION_REMOVED: 'public_keySessionRemoved';
3209+
KEY_STATUSES_CHANGED: 'public_keyStatusesChanged';
3210+
KEY_SYSTEM_ACCESS_COMPLETE: 'public_keySystemAccessComplete';
3211+
KEY_SYSTEM_SELECTED: 'public_keySystemSelected';
3212+
LICENSE_REQUEST_COMPLETE: 'public_licenseRequestComplete';
3213+
LICENSE_REQUEST_SENDING: 'public_licenseRequestSending';
3214+
NEED_KEY: 'needkey';
3215+
PROTECTION_CREATED: 'public_protectioncreated';
3216+
PROTECTION_DESTROYED: 'public_protectiondestroyed';
3217+
SERVER_CERTIFICATE_UPDATED: 'serverCertificateUpdated';
3218+
TEARDOWN_COMPLETE: 'protectionTeardownComplete';
3219+
VIDEO_ELEMENT_SELECTED: 'videoElementSelected';
3220+
KEY_SESSION_UPDATED: 'public_keySessionUpdated';
3221+
}
3222+
31813223
/**
31823224
* Streaming - Protection - Models
31833225
**/
@@ -3511,6 +3553,11 @@ declare namespace dashjs {
35113553
createProtectionSystem(config: object): void;
35123554
}
35133555

3556+
export namespace Protection {
3557+
export const events: ProtectionEvents;
3558+
export const errors: ProtectionErrors;
3559+
}
3560+
35143561
/**
35153562
* Streaming - Rules - ABR - LolP
35163563
*/

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
"description": "A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.",
55
"author": "Dash Industry Forum",
66
"license": "BSD-3-Clause",
7-
"exports": "./dist/dash.all.min.js",
7+
"exports": {
8+
".": {
9+
"types": "./index.d.ts",
10+
"import": "./dist/esm/dash.all.debug.esm.js",
11+
"default": "./dist/esm/dash.all.debug.esm.js",
12+
"browser": "./dist/dash.all.min.js",
13+
"script": "./dist/dash.all.min.js"
14+
}
15+
},
816
"type": "module",
9-
"types": "index.d.ts",
1017
"scripts": {
1118
"dev": "tsc && webpack --config build/webpack.dev.cjs --mode development --watch --progress",
1219
"start": "webpack serve --config build/webpack.dev.cjs",

0 commit comments

Comments
 (0)