mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
add undefined as valid senderId in sendCustomMessage method (#43729)
This commit is contained in:
@@ -1204,9 +1204,9 @@ export class CastReceiverContext {
|
||||
removeEventListener(type: system.EventType, handler: EventHandler): void;
|
||||
|
||||
/**
|
||||
* Sends a message to a specific sender.
|
||||
* Sends a message to a specific sender or broadcasts it to all connected senders (to broadcast pass undefined as a senderId).
|
||||
*/
|
||||
sendCustomMessage(namespace: string, senderId: string, message: any): void;
|
||||
sendCustomMessage(namespace: string, senderId: string | undefined, message: any): void;
|
||||
|
||||
/**
|
||||
* This function should be called in response to the feedbackstarted event if the application
|
||||
|
||||
@@ -144,6 +144,14 @@ cast.framework.CastReceiverContext.getInstance().addEventListener(
|
||||
() => '¡hola!',
|
||||
);
|
||||
|
||||
// send custom message to specific sender
|
||||
cast.framework.CastReceiverContext.getInstance()
|
||||
.sendCustomMessage('custom-namespace', 'sender-id', {});
|
||||
|
||||
// broadcast custom message to all connected senders
|
||||
cast.framework.CastReceiverContext.getInstance()
|
||||
.sendCustomMessage('custom-namespace', undefined, {});
|
||||
|
||||
const loadingError = new cast.framework.events.ErrorEvent(DetailedErrorCode.LOAD_FAILED, 'Loading failed!');
|
||||
|
||||
// PlayerManager message interceptors
|
||||
|
||||
Reference in New Issue
Block a user