Skip to content

Commit

Permalink
Fix TS typings for KeyErrorEvent and KeySessionCreatedEvent error (#4441
Browse files Browse the repository at this point in the history
)

`KeyErrorEvent` is triggered with `error` (`DashJSError`) instead of `data`.

`KeySystemSelectedEvent` has incorrect `error` type:  it's `DashJSError`
as well instead of `string`.

As a result, `KeyError` type becomes redundant and can be removed.
  • Loading branch information
kris-youview committed Apr 4, 2024
1 parent 1816773 commit 6180c75
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions index.d.ts
Expand Up @@ -1896,16 +1896,9 @@ declare namespace dashjs {
data: object
}

export class KeyError {
constructor(sessionToken: SessionToken, errorString: string);

sessionToken: SessionToken;
error: string;
}

export interface KeyErrorEvent extends Event {
type: MediaPlayerEvents['KEY_ERROR'];
data: KeyError;
error: DashJSError;
}

export class KeyMessage {
Expand Down Expand Up @@ -1943,7 +1936,7 @@ declare namespace dashjs {
export interface KeySystemSelectedEvent extends Event {
type: MediaPlayerEvents['KEY_SYSTEM_SELECTED'];
data: object | null;
error?: string;
error?: DashJSError;
}

export interface LicenseRequestCompleteEvent extends Event {
Expand Down

0 comments on commit 6180c75

Please sign in to comment.