Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#71105 [@types/chromecast-caf-receiver] Ext…
Browse files Browse the repository at this point in the history
…ensible customData type - Request Data by @James-Hill-Fox
  • Loading branch information
James-Hill-Fox authored Nov 13, 2024
1 parent 7747251 commit 1e8acd5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
17 changes: 13 additions & 4 deletions types/chromecast-caf-receiver/cast.framework.messages.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,17 @@ export class ResumeSessionRequestData extends RequestData {
sessionState: SessionState;
}

/**
* Custom data set by the receiver application.
*
* @remarks
*
* Augment this interface in custom receivers.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface RequestDataCustomData {
}

/**
* Media event request data.
* @see https://developers.google.com/cast/docs/reference/web_receiver/cast.framework.messages.RequestData
Expand All @@ -932,11 +943,9 @@ export class RequestData {
constructor(type: MessageType);

/**
* Application-specific data for this request.
* It enables the sender and receiver to easily extend the media protocol
* without having to use a new namespace with custom messages.
* Custom data set by the receiver application.
*/
customData?: any;
customData?: RequestDataCustomData;

/**
* Id of the media session that the request applies to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ declare module "./cast.framework.messages" {
interface BreakClipCustomData {
advertiser?: string;
}

interface RequestDataCustomData {
isRecovering?: boolean;
}
}

const sessionState = new cast.framework.messages.SessionState();
Expand All @@ -328,3 +332,4 @@ mediaStatus.customData = { description: "Lorem ipsum" };
queueItem.customData = { priority: 1 };
queueItem.media.customData = { environment: "production" };
breakClip.customData = { advertiser: "Umbrella Corporation" };
lrd.customData = { isRecovering: true };

0 comments on commit 1e8acd5

Please sign in to comment.