@types/chrome 0.0.283 → 0.0.285

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. chrome/README.md +1 -1
  2. chrome/chrome-cast/index.d.ts +1057 -1055
  3. chrome/index.d.ts +12300 -12250
  4. chrome/package.json +3 -3
@@ -1,1154 +1,1156 @@
1
- ////////////////////
2
- // Cast
3
- // @see https://code.google.com/p/chromium/codesearch#chromium/src/ui/file_manager/externs/chrome_cast.js
4
- ////////////////////
5
- declare namespace chrome.cast {
6
- /**
7
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.AutoJoinPolicy
8
- */
9
- export enum AutoJoinPolicy {
10
- CUSTOM_CONTROLLER_SCOPED = "custom_controller_scoped",
11
- TAB_AND_ORIGIN_SCOPED = "tab_and_origin_scoped",
12
- ORIGIN_SCOPED = "origin_scoped",
13
- PAGE_SCOPED = "page_scoped",
14
- }
15
-
16
- /**
17
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.DefaultActionPolicy
18
- */
19
- export enum DefaultActionPolicy {
20
- CREATE_SESSION = "create_session",
21
- CAST_THIS_TAB = "cast_this_tab",
22
- }
23
-
24
- /**
25
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability
26
- */
27
- export enum Capability {
28
- VIDEO_OUT = "video_out",
29
- AUDIO_OUT = "audio_out",
30
- VIDEO_IN = "video_in",
31
- AUDIO_IN = "audio_in",
32
- MULTIZONE_GROUP = "multizone_group",
33
- }
34
-
35
- /**
36
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ErrorCode
37
- */
38
- export enum ErrorCode {
39
- CANCEL = "cancel",
40
- TIMEOUT = "timeout",
41
- API_NOT_INITIALIZED = "api_not_initialized",
42
- INVALID_PARAMETER = "invalid_parameter",
43
- EXTENSION_NOT_COMPATIBLE = "extension_not_compatible",
44
- EXTENSION_MISSING = "extension_missing",
45
- RECEIVER_UNAVAILABLE = "receiver_unavailable",
46
- SESSION_ERROR = "session_error",
47
- CHANNEL_ERROR = "channel_error",
48
- LOAD_MEDIA_FAILED = "load_media_failed",
49
- }
50
-
51
- /**
52
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAvailability
53
- */
54
- export enum ReceiverAvailability {
55
- AVAILABLE = "available",
56
- UNAVAILABLE = "unavailable",
57
- }
58
-
59
- /**
60
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SenderPlatform
61
- */
62
- export enum SenderPlatform {
63
- CHROME = "chrome",
64
- IOS = "ios",
65
- ANDROID = "android",
66
- }
67
-
68
- /**
69
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverType
70
- */
71
- export enum ReceiverType {
72
- CAST = "cast",
73
- DIAL = "dial",
74
- HANGOUT = "hangout",
75
- CUSTOM = "custom",
76
- }
77
-
78
- /**
79
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAction
80
- */
81
- export enum ReceiverAction {
82
- CAST = "cast",
83
- STOP = "stop",
84
- }
85
-
86
- /**
87
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SessionStatus
88
- */
89
- export enum SessionStatus {
90
- CONNECTED = "connected",
91
- DISCONNECTED = "disconnected",
92
- STOPPED = "stopped",
93
- }
94
-
95
- /**
96
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.VERSION
97
- */
98
- export var VERSION: number[];
99
-
100
- /**
101
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable
102
- */
103
- export var isAvailable: boolean;
104
-
105
- /**
106
- * @param apiConfig
107
- * @param successCallback
108
- * @param errorCallback
109
- */
110
- export function initialize(
111
- apiConfig: chrome.cast.ApiConfig,
112
- successCallback: Function,
113
- errorCallback: (error: chrome.cast.Error) => void,
114
- ): void;
115
-
116
- /**
117
- * @param successCallback
118
- * @param errorCallback
119
- * @param opt_sessionRequest
120
- * @param opt_label
121
- */
122
- export function requestSession(
123
- successCallback: (session: chrome.cast.Session) => void,
124
- errorCallback: (error: chrome.cast.Error) => void,
125
- sessionRequest?: chrome.cast.SessionRequest,
126
- label?: string,
127
- ): void;
128
-
129
- /**
130
- * @param sessionId The id of the session to join.
131
- */
132
- export function requestSessionById(sessionId: string): void;
133
-
134
- /**
135
- * @param listener
136
- */
137
- export function addReceiverActionListener(
138
- listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
139
- ): void;
140
-
141
- /**
142
- * @param listener
143
- */
144
- export function removeReceiverActionListener(
145
- listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
146
- ): void;
147
-
148
- /**
149
- * @param message The message to log.
150
- */
151
- export function logMessage(message: string): void;
152
-
153
- /**
154
- * @param receivers
155
- * @param successCallback
156
- * @param errorCallback
157
- */
158
- export function setCustomReceivers(
159
- receivers: chrome.cast.Receiver[],
160
- successCallback: Function,
161
- errorCallback: (error: chrome.cast.Error) => void,
162
- ): void;
163
-
164
- /**
165
- * @param receiver
166
- * @param successCallback
167
- * @param errorCallback
168
- */
169
- export function setReceiverDisplayStatus(
170
- receiver: chrome.cast.Receiver,
171
- successCallback: Function,
172
- errorCallback: (error: chrome.cast.Error) => void,
173
- ): void;
174
-
175
- /**
176
- * @param escaped A string to unescape.
177
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.unescape
178
- */
179
- export function unescape(escaped: string): string;
180
-
181
- export class ApiConfig {
182
- /**
183
- * @param sessionRequest
184
- * @param sessionListener
185
- * @param receiverListener
186
- * @param opt_autoJoinPolicy
187
- * @param opt_defaultActionPolicy
188
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ApiConfig
189
- */
190
- constructor(
191
- sessionRequest: chrome.cast.SessionRequest,
192
- sessionListener: (session: chrome.cast.Session) => void,
193
- receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void,
194
- autoJoinPolicy?: chrome.cast.AutoJoinPolicy,
195
- defaultActionPolicy?: chrome.cast.DefaultActionPolicy,
196
- );
197
-
198
- sessionRequest: chrome.cast.SessionRequest;
199
- sessionListener: (session: chrome.cast.Session) => void;
200
- receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void;
201
- autoJoinPolicy: chrome.cast.AutoJoinPolicy;
202
- defaultActionPolicy: chrome.cast.DefaultActionPolicy;
203
- }
204
-
205
- export class Error {
206
- /**
207
- * @param code
208
- * @param opt_description
209
- * @param opt_details
210
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error
211
- */
212
- constructor(code: chrome.cast.ErrorCode, description?: string, details?: Object);
213
-
214
- code: chrome.cast.ErrorCode;
215
- description: string | null;
216
- details: object;
217
- }
218
-
219
- export class Image {
220
- /**
221
- * @param url
222
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Image
223
- */
224
- constructor(url: string);
225
-
226
- url: string;
227
- height: number | null;
228
- width: number | null;
229
- }
230
-
231
- export class SenderApplication {
232
- /**
233
- * @param platform
234
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderApplication
235
- */
236
- constructor(platform: chrome.cast.SenderPlatform);
237
-
238
- platform: chrome.cast.SenderPlatform;
239
- url: string | null;
240
- packageId: string | null;
241
- }
242
-
243
- export class SessionRequest {
244
- /**
245
- * @param appId
246
- * @param opt_capabilities
247
- * @param opt_timeout
248
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionRequest
249
- */
250
- constructor(appId: string, capabilities?: chrome.cast.Capability[], timeout?: number);
251
-
252
- appId: string;
253
- capabilities: chrome.cast.Capability[];
254
- requestSessionTimeout: number;
255
- language: string | null;
256
- }
257
-
258
- export class Session {
259
- /**
260
- * @param sessionId
261
- * @param appId
262
- * @param displayName
263
- * @param appImages
264
- * @param receiver
265
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Session
266
- */
267
- constructor(
268
- sessionId: string,
269
- appId: string,
270
- displayName: string,
271
- appImages: chrome.cast.Image[],
272
- receiver: chrome.cast.Receiver,
273
- );
274
-
275
- sessionId: string;
276
- appId: string;
277
- displayName: string;
278
- appImages: chrome.cast.Image[];
279
- receiver: chrome.cast.Receiver;
280
- senderApps: chrome.cast.SenderApplication[];
281
- namespaces: Array<{ name: string }>;
282
- media: chrome.cast.media.Media[];
283
- status: chrome.cast.SessionStatus;
284
- statusText: string | null;
285
- transportId: string;
286
-
287
- /**
288
- * @param newLevel
289
- * @param successCallback
290
- * @param errorCallback
291
- */
292
- setReceiverVolumeLevel(
293
- newLevel: number,
294
- successCallback: Function,
295
- errorCallback: (error: chrome.cast.Error) => void,
296
- ): void;
297
-
298
- /**
299
- * @param muted
300
- * @param successCallback
301
- * @param errorCallback
302
- */
303
- setReceiverMuted(
304
- muted: boolean,
305
- successCallback: Function,
306
- errorCallback: (error: chrome.cast.Error) => void,
307
- ): void;
308
-
309
- /**
310
- * @param successCallback
311
- * @param errorCallback
312
- */
313
- leave(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
314
-
315
- /**
316
- * @param successCallback
317
- * @param errorCallback
318
- */
319
- stop(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
320
-
321
- /**
322
- * @param namespace
323
- * @param message
324
- * @param successCallback
325
- * @param errorCallback
326
- */
327
- sendMessage(
328
- namespace: string,
329
- message: string | object,
330
- successCallback: Function,
331
- errorCallback: (error: chrome.cast.Error) => void,
332
- ): void;
333
-
334
- /**
335
- * @param listener
336
- */
337
- addUpdateListener(listener: (isAlive: boolean) => void): void;
338
-
339
- /**
340
- * @param listener
341
- */
342
- removeUpdateListener(listener: (isAlive: boolean) => void): void;
343
-
344
- /**
345
- * @param namespace
346
- * @param listener
347
- */
348
- addMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
349
-
350
- /**
351
- * @param namespace
352
- * @param listener
353
- */
354
- removeMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
355
-
356
- /**
357
- * @param listener
358
- */
359
- addMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
360
-
361
- /**
362
- * @param listener
363
- */
364
- removeMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
365
-
366
- /**
367
- * @param loadRequest
368
- * @param successCallback
369
- * @param errorCallback
370
- */
371
- loadMedia(
372
- loadRequest: chrome.cast.media.LoadRequest,
373
- successCallback: (media: chrome.cast.media.Media) => void,
374
- errorCallback: (error: chrome.cast.Error) => void,
375
- ): void;
376
-
377
- /**
378
- * @param queueLoadRequest
379
- * @param successCallback
380
- * @param errorCallback
381
- */
382
- queueLoad(
383
- queueLoadRequest: chrome.cast.media.QueueLoadRequest,
384
- successCallback: (media: chrome.cast.media.Media) => void,
385
- errorCallback: (error: chrome.cast.Error) => void,
386
- ): void;
387
- }
388
-
389
- export class Receiver {
390
- /**
391
- * @param label
392
- * @param friendlyName
393
- * @param opt_capabilities
394
- * @param opt_volume
395
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Receiver
396
- */
397
- constructor(
398
- label: string,
399
- friendlyName: string,
400
- capabilities?: chrome.cast.Capability[],
401
- volume?: chrome.cast.Volume,
402
- );
403
-
404
- label: string;
405
- friendlyName: string;
406
- capabilities: chrome.cast.Capability[];
407
- volume: chrome.cast.Volume;
408
- receiverType: chrome.cast.ReceiverType;
409
- displayStatus: chrome.cast.ReceiverDisplayStatus;
410
- }
411
-
412
- export class ReceiverDisplayStatus {
413
- /**
414
- * @param statusText
415
- * @param appImages
416
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverDisplayStatus
417
- */
418
- constructor(statusText: string, appImages: chrome.cast.Image[]);
419
-
420
- statusText: string;
421
- appImages: chrome.cast.Image[];
422
- }
423
-
424
- export class Volume {
425
- /**
426
- * @param opt_level
427
- * @param opt_muted
428
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Volume
429
- */
430
- constructor(level?: number, muted?: boolean);
431
-
432
- level: number | null;
433
- muted: boolean | null;
434
- }
435
- }
436
-
437
- declare namespace chrome.cast.media {
438
- export var DEFAULT_MEDIA_RECEIVER_APP_ID: string;
439
-
440
- /**
441
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MediaCommand
442
- */
443
- export enum MediaCommand {
444
- PAUSE = "pause",
445
- SEEK = "seek",
446
- STREAM_VOLUME = "stream_volume",
447
- STREAM_MUTE = "stream_mute",
448
- }
449
-
450
- /**
451
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MetadataType
452
- */
453
- export enum MetadataType {
454
- GENERIC,
455
- TV_SHOW,
456
- MOVIE,
457
- MUSIC_TRACK,
458
- PHOTO,
459
- }
460
-
461
- /**
462
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.PlayerState
463
- */
464
- export enum PlayerState {
465
- IDLE = "IDLE",
466
- PLAYING = "PLAYING",
467
- PAUSED = "PAUSED",
468
- BUFFERING = "BUFFERING",
469
- }
470
-
471
- /**
472
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.ResumeState
473
- */
474
- export enum ResumeState {
475
- PLAYBACK_START = "PLAYBACK_START",
476
- PLAYBACK_PAUSE = "PLAYBACK_PAUSE",
477
- }
478
-
479
- /**
480
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.StreamType
481
- */
482
- export enum StreamType {
483
- BUFFERED = "BUFFERED",
484
- LIVE = "LIVE",
485
- OTHER = "OTHER",
486
- }
487
-
488
- /**
489
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.IdleReason
490
- */
491
- export enum IdleReason {
492
- CANCELLED = "CANCELLED",
493
- INTERRUPTED = "INTERRUPTED",
494
- FINISHED = "FINISHED",
495
- ERROR = "ERROR",
496
- }
497
-
498
- /**
499
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode
500
- */
501
- export enum RepeatMode {
502
- OFF = "REPEAT_OFF",
503
- ALL = "REPEAT_ALL",
504
- SINGLE = "REPEAT_SINGLE",
505
- ALL_AND_SHUFFLE = "REPEAT_ALL_AND_SHUFFLE",
506
- }
507
-
508
- export class QueueItem {
509
- /**
510
- * @param mediaInfo
511
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem
512
- */
513
- constructor(mediaInfo: chrome.cast.media.MediaInfo);
514
-
515
- activeTrackIds: Number[];
516
- autoplay: boolean;
517
- customData: Object;
518
- itemId: number;
519
- media: chrome.cast.media.MediaInfo;
520
- preloadTime: number;
521
- startTime: number;
522
- }
523
-
524
- export class QueueLoadRequest {
525
- /**
526
- * @param items
527
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest
528
- */
529
- constructor(items: chrome.cast.media.QueueItem[]);
530
-
531
- customData: Object;
532
- items: chrome.cast.media.QueueItem[];
533
- repeatMode: chrome.cast.media.RepeatMode;
534
- startIndex: number;
535
- }
536
-
537
- export class QueueInsertItemsRequest {
538
- /**
539
- * @param itemsToInsert
540
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest
541
- */
542
- constructor(itemsToInsert: chrome.cast.media.QueueItem[]);
543
-
544
- customData: Object;
545
- insertBefore: number;
546
- items: chrome.cast.media.QueueItem[];
547
- }
548
-
549
- export class QueueRemoveItemsRequest {
550
- /**
551
- * @param itemIdsToRemove
552
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest
553
- */
554
- constructor(itemIdsToRemove: number[]);
555
-
556
- customData: Object;
557
- itemIds: number[];
558
- }
559
-
560
- export class QueueReorderItemsRequest {
561
- /**
562
- * @param itemIdsToReorder
563
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest
564
- */
565
- constructor(itemIdsToReorder: number[]);
566
-
567
- customData: Object;
568
- insertBefore: number;
569
- itemIds: number[];
570
- }
571
-
572
- export class QueueUpdateItemsRequest {
573
- /**
574
- * @param itemsToUpdate
575
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest
576
- */
577
- constructor(itemsToUpdate: chrome.cast.media.QueueItem[]);
578
-
579
- customData: Object;
580
- item: chrome.cast.media.QueueItem[];
581
- }
582
-
583
- /**
584
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TrackType
585
- */
586
- export enum TrackType {
587
- TEXT = "TEXT",
588
- AUDIO = "AUDIO",
589
- VIDEO = "VIDEO",
590
- }
591
-
592
- /**
593
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackType
594
- */
595
- export enum TextTrackType {
596
- SUBTITLES = "SUBTITLES",
597
- CAPTIONS = "CAPTIONS",
598
- DESCRIPTIONS = "DESCRIPTIONS",
599
- CHAPTERS = "CHAPTERS",
600
- METADATA = "METADATA",
601
- }
602
-
603
- /**
604
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackEdgeType
605
- */
606
- export enum TextTrackEdgeType {
607
- NONE = "NONE",
608
- OUTLINE = "OUTLINE",
609
- DROP_SHADOW = "DROP_SHADOW",
610
- RAISED = "RAISED",
611
- DEPRESSED = "DEPRESSED",
612
- }
613
-
614
- /**
615
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackWindowType
616
- */
617
- export enum TextTrackWindowType {
618
- NONE = "NONE",
619
- NORMAL = "NORMAL",
620
- ROUNDED_CORNERS = "ROUNDED_CORNERS",
621
- }
622
-
623
- /**
624
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontGenericFamily
625
- */
626
- export enum TextTrackFontGenericFamily {
627
- SANS_SERIF = "SANS_SERIF",
628
- MONOSPACED_SANS_SERIF = "MONOSPACED_SANS_SERIF",
629
- SERIF = "SERIF",
630
- MONOSPACED_SERIF = "MONOSPACED_SERIF",
631
- CASUAL = "CASUAL",
632
- CURSIVE = "CURSIVE",
633
- SMALL_CAPITALS = "SMALL_CAPITALS",
634
- }
635
-
636
- /**
637
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontStyle
638
- */
639
- export enum TextTrackFontStyle {
640
- NORMAL = "NORMAL",
641
- BOLD = "BOLD",
642
- BOLD_ITALIC = "BOLD_ITALIC",
643
- ITALIC = "ITALIC",
644
- }
645
-
646
- export class GetStatusRequest {
647
- /**
648
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest
649
- */
650
- constructor();
651
-
652
- customData: Object;
653
- }
654
-
655
- export class PauseRequest {
656
- /**
657
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest
658
- */
659
- constructor();
660
-
661
- customData: Object;
662
- }
663
-
664
- export class PlayRequest {
1
+ declare namespace chrome {
2
+ ////////////////////
3
+ // Cast
4
+ // @see https://code.google.com/p/chromium/codesearch#chromium/src/ui/file_manager/externs/chrome_cast.js
5
+ ////////////////////
6
+ export namespace cast {
665
7
  /**
666
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest
8
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.AutoJoinPolicy
667
9
  */
668
- constructor();
10
+ export enum AutoJoinPolicy {
11
+ CUSTOM_CONTROLLER_SCOPED = "custom_controller_scoped",
12
+ TAB_AND_ORIGIN_SCOPED = "tab_and_origin_scoped",
13
+ ORIGIN_SCOPED = "origin_scoped",
14
+ PAGE_SCOPED = "page_scoped",
15
+ }
669
16
 
670
- customData: Object;
671
- }
672
-
673
- export class SeekRequest {
674
17
  /**
675
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest
18
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.DefaultActionPolicy
676
19
  */
677
- constructor();
678
-
679
- currentTime: number;
680
- resumeState: chrome.cast.media.ResumeState;
681
- customData: Object;
682
- }
20
+ export enum DefaultActionPolicy {
21
+ CREATE_SESSION = "create_session",
22
+ CAST_THIS_TAB = "cast_this_tab",
23
+ }
683
24
 
684
- export class StopRequest {
685
25
  /**
686
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest
26
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability
687
27
  */
688
- constructor();
28
+ export enum Capability {
29
+ VIDEO_OUT = "video_out",
30
+ AUDIO_OUT = "audio_out",
31
+ VIDEO_IN = "video_in",
32
+ AUDIO_IN = "audio_in",
33
+ MULTIZONE_GROUP = "multizone_group",
34
+ }
689
35
 
690
- customData: Object;
691
- }
692
-
693
- export class VolumeRequest {
694
36
  /**
695
- * @param volume
696
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.VolumeRequest
37
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ErrorCode
697
38
  */
698
- constructor(volume: chrome.cast.Volume);
699
-
700
- volume: chrome.cast.Volume;
701
- customData: Object;
702
- }
39
+ export enum ErrorCode {
40
+ CANCEL = "cancel",
41
+ TIMEOUT = "timeout",
42
+ API_NOT_INITIALIZED = "api_not_initialized",
43
+ INVALID_PARAMETER = "invalid_parameter",
44
+ EXTENSION_NOT_COMPATIBLE = "extension_not_compatible",
45
+ EXTENSION_MISSING = "extension_missing",
46
+ RECEIVER_UNAVAILABLE = "receiver_unavailable",
47
+ SESSION_ERROR = "session_error",
48
+ CHANNEL_ERROR = "channel_error",
49
+ LOAD_MEDIA_FAILED = "load_media_failed",
50
+ }
703
51
 
704
- export class LoadRequest {
705
52
  /**
706
- * @param mediaInfo
707
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LoadRequest
53
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAvailability
708
54
  */
709
- constructor(mediaInfo: chrome.cast.media.MediaInfo);
710
-
711
- activeTrackIds: number[];
712
- autoplay: boolean;
713
- currentTime: number;
714
- customData: Object;
715
- media: chrome.cast.media.MediaInfo;
716
- playbackRate?: number | undefined;
717
- }
55
+ export enum ReceiverAvailability {
56
+ AVAILABLE = "available",
57
+ UNAVAILABLE = "unavailable",
58
+ }
718
59
 
719
- export class EditTracksInfoRequest {
720
60
  /**
721
- * @param opt_activeTrackIds
722
- * @param opt_textTrackStyle
723
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.EditTracksInfoRequest
61
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SenderPlatform
724
62
  */
725
- constructor(activeTrackIds?: number[], textTrackStyle?: chrome.cast.media.TextTrackStyle);
63
+ export enum SenderPlatform {
64
+ CHROME = "chrome",
65
+ IOS = "ios",
66
+ ANDROID = "android",
67
+ }
726
68
 
727
- activeTrackIds: number[];
728
- textTrackStyle: chrome.cast.media.TextTrackStyle;
729
- }
730
-
731
- export class GenericMediaMetadata {
732
- images: chrome.cast.Image[];
733
- metadataType: chrome.cast.media.MetadataType;
734
- releaseDate: string;
735
- /** @deprecated Use releaseDate instead. */
736
- releaseYear: number;
737
- subtitle: string;
738
- title: string;
739
- /** @deprecated Use metadataType instead. */
740
- type: chrome.cast.media.MetadataType;
741
- }
742
-
743
- export class MovieMediaMetadata {
744
- /**
745
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata
746
- */
747
- constructor();
748
-
749
- images: chrome.cast.Image[];
750
- metadataType: chrome.cast.media.MetadataType;
751
- releaseDate: string;
752
- /** @deprecated Use releaseDate instead. */
753
- releaseYear: number;
754
- subtitle: string;
755
- title: string;
756
- studio: string;
757
- /** @deprecated Use metadataType instead. */
758
- type: chrome.cast.media.MetadataType;
759
- }
760
-
761
- export class TvShowMediaMetadata {
762
69
  /**
763
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata
70
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverType
764
71
  */
765
- constructor();
766
-
767
- metadataType: chrome.cast.media.MetadataType;
768
- seriesTitle: string;
769
- title: string;
770
- season: number;
771
- episode: number;
772
- images: chrome.cast.Image[];
773
- originalAirdate: string;
774
-
775
- /** @deprecated Use metadataType instead. */
776
- type: chrome.cast.media.MetadataType;
777
- /** @deprecated Use title instead. */
778
- episodeTitle: string;
779
- /** @deprecated Use season instead. */
780
- seasonNumber: number;
781
- /** @deprecated Use episode instead. */
782
- episodeNumber: number;
783
- /** @deprecated Use originalAirdate instead. */
784
- releaseYear: number;
785
- }
72
+ export enum ReceiverType {
73
+ CAST = "cast",
74
+ DIAL = "dial",
75
+ HANGOUT = "hangout",
76
+ CUSTOM = "custom",
77
+ }
786
78
 
787
- export class MusicTrackMediaMetadata {
788
79
  /**
789
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata
80
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAction
790
81
  */
791
- constructor();
792
-
793
- metadataType: chrome.cast.media.MetadataType;
794
- albumName: string;
795
- title: string;
796
- albumArtist: string;
797
- artist: string;
798
- composer: string;
799
- songName: string;
800
- trackNumber: number;
801
- discNumber: number;
802
- images: chrome.cast.Image[];
803
- releaseDate: string;
804
-
805
- /** @deprecated Use metadataType instead. */
806
- type: chrome.cast.media.MetadataType;
807
- /** @deprecated Use artist instead. */
808
- artistName: string;
809
- /** @deprecated Use releaseDate instead. */
810
- releaseYear: number;
811
- }
82
+ export enum ReceiverAction {
83
+ CAST = "cast",
84
+ STOP = "stop",
85
+ }
812
86
 
813
- export class PhotoMediaMetadata {
814
87
  /**
815
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata
88
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SessionStatus
816
89
  */
817
- constructor();
818
-
819
- metadataType: chrome.cast.media.MetadataType;
820
- title: string;
821
- artist: string;
822
- location: string;
823
- images: chrome.cast.Image[];
824
- latitude: number;
825
- longitude: number;
826
- width: number;
827
- height: number;
828
- creationDateTime: string;
829
-
830
- /** @deprecated Use metadataType instead. */
831
- type: chrome.cast.media.MetadataType;
832
- }
90
+ export enum SessionStatus {
91
+ CONNECTED = "connected",
92
+ DISCONNECTED = "disconnected",
93
+ STOPPED = "stopped",
94
+ }
833
95
 
834
- export class MediaInfo {
835
96
  /**
836
- * @param contentId
837
- * @param contentType
838
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaInfo
97
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.VERSION
839
98
  */
840
- constructor(contentId: string, contentType: string);
841
-
842
- contentId: string;
843
- streamType: chrome.cast.media.StreamType;
844
- contentType: string;
845
- metadata: any;
846
- duration?: number | null;
847
- tracks?: chrome.cast.media.Track[] | null;
848
- textTrackStyle?: chrome.cast.media.TextTrackStyle | null;
849
- customData?: Object | null;
850
- }
99
+ export var VERSION: number[];
851
100
 
852
- export class Media {
853
101
  /**
854
- * @param sessionId
855
- * @param mediaSessionId
856
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media
102
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable
857
103
  */
858
- constructor(sessionId: string, mediaSessionId: number);
859
-
860
- activeTrackIds?: number[] | null;
861
- currentItemId?: number | null;
862
- customData?: Object | null;
863
- idleReason: chrome.cast.media.IdleReason | null;
864
- items?: chrome.cast.media.QueueItem[] | null;
865
- liveSeekableRange?: chrome.cast.media.LiveSeekableRange | undefined;
866
- loadingItemId?: number | null;
867
- media?: chrome.cast.media.MediaInfo | null;
868
- mediaSessionId: number;
869
- playbackRate: number;
870
- playerState: chrome.cast.media.PlayerState;
871
- preloadedItemId?: number | null;
872
- repeatMode: chrome.cast.media.RepeatMode;
873
- sessionId: string;
874
- supportedMediaCommands: chrome.cast.media.MediaCommand[];
875
- volume: chrome.cast.Volume;
876
-
877
- /** @deprecated Use getEstimatedTime instead */
878
- currentTime: number;
104
+ export var isAvailable: boolean;
879
105
 
880
106
  /**
881
- * @param getStatusRequest
107
+ * @param apiConfig
882
108
  * @param successCallback
883
109
  * @param errorCallback
884
110
  */
885
- getStatus(
886
- getStatusRequest: chrome.cast.media.GetStatusRequest,
111
+ export function initialize(
112
+ apiConfig: chrome.cast.ApiConfig,
887
113
  successCallback: Function,
888
114
  errorCallback: (error: chrome.cast.Error) => void,
889
115
  ): void;
890
116
 
891
117
  /**
892
- * @param playRequest
893
118
  * @param successCallback
894
119
  * @param errorCallback
120
+ * @param opt_sessionRequest
121
+ * @param opt_label
895
122
  */
896
- play(
897
- playRequest: chrome.cast.media.PlayRequest,
898
- successCallback: Function,
123
+ export function requestSession(
124
+ successCallback: (session: chrome.cast.Session) => void,
899
125
  errorCallback: (error: chrome.cast.Error) => void,
126
+ sessionRequest?: chrome.cast.SessionRequest,
127
+ label?: string,
900
128
  ): void;
901
129
 
902
130
  /**
903
- * @param pauseRequest
904
- * @param successCallback
905
- * @param errorCallback
131
+ * @param sessionId The id of the session to join.
906
132
  */
907
- pause(
908
- pauseRequest: chrome.cast.media.PauseRequest,
909
- successCallback: Function,
910
- errorCallback: (error: chrome.cast.Error) => void,
911
- ): void;
133
+ export function requestSessionById(sessionId: string): void;
912
134
 
913
135
  /**
914
- * @param seekRequest
915
- * @param successCallback
916
- * @param errorCallback
136
+ * @param listener
917
137
  */
918
- seek(
919
- seekRequest: chrome.cast.media.SeekRequest,
920
- successCallback: Function,
921
- errorCallback: (error: chrome.cast.Error) => void,
138
+ export function addReceiverActionListener(
139
+ listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
922
140
  ): void;
923
141
 
924
142
  /**
925
- * @param stopRequest
926
- * @param successCallback
927
- * @param errorCallback
143
+ * @param listener
928
144
  */
929
- stop(
930
- stopRequest: chrome.cast.media.StopRequest,
931
- successCallback: Function,
932
- errorCallback: (error: chrome.cast.Error) => void,
145
+ export function removeReceiverActionListener(
146
+ listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
933
147
  ): void;
934
148
 
935
149
  /**
936
- * @param volumeRequest
937
- * @param successCallback
938
- * @param errorCallback
150
+ * @param message The message to log.
939
151
  */
940
- setVolume(
941
- volumeRequest: chrome.cast.media.VolumeRequest,
942
- successCallback: Function,
943
- errorCallback: (error: chrome.cast.Error) => void,
944
- ): void;
152
+ export function logMessage(message: string): void;
945
153
 
946
154
  /**
947
- * @param editTracksInfoRequest
155
+ * @param receivers
948
156
  * @param successCallback
949
157
  * @param errorCallback
950
158
  */
951
- editTracksInfo(
952
- editTracksInfoRequest: chrome.cast.media.EditTracksInfoRequest,
159
+ export function setCustomReceivers(
160
+ receivers: chrome.cast.Receiver[],
953
161
  successCallback: Function,
954
162
  errorCallback: (error: chrome.cast.Error) => void,
955
163
  ): void;
956
164
 
957
165
  /**
958
- * @param command
959
- * @return whether or not the receiver supports the given chrome.cast.media.MediaCommand
960
- */
961
- supportsCommand(command: chrome.cast.media.MediaCommand): boolean;
962
-
963
- /**
964
- * @param listener
965
- */
966
- addUpdateListener(listener: (isAlive: boolean) => void): void;
967
-
968
- /**
969
- * @param listener
970
- */
971
- removeUpdateListener(listener: (isAlive: boolean) => void): void;
972
-
973
- /**
974
- * @return
975
- * @suppress {deprecated} Uses currentTime member to compute estimated time.
976
- */
977
- getEstimatedTime(): number;
978
-
979
- /**
980
- * @param item
166
+ * @param receiver
981
167
  * @param successCallback
982
168
  * @param errorCallback
983
169
  */
984
- queueAppendItem(
985
- item: chrome.cast.media.QueueItem,
170
+ export function setReceiverDisplayStatus(
171
+ receiver: chrome.cast.Receiver,
986
172
  successCallback: Function,
987
173
  errorCallback: (error: chrome.cast.Error) => void,
988
174
  ): void;
989
175
 
990
176
  /**
991
- * @param queueInsertItemsRequest
992
- * @param successCallback
993
- * @param errorCallback
994
- */
995
- queueInsertItems(
996
- queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest,
997
- successCallback: Function,
998
- errorCallback: (error: chrome.cast.Error) => void,
999
- ): void;
177
+ * @param escaped A string to unescape.
178
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.unescape
179
+ */
180
+ export function unescape(escaped: string): string;
181
+
182
+ export class ApiConfig {
183
+ /**
184
+ * @param sessionRequest
185
+ * @param sessionListener
186
+ * @param receiverListener
187
+ * @param opt_autoJoinPolicy
188
+ * @param opt_defaultActionPolicy
189
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ApiConfig
190
+ */
191
+ constructor(
192
+ sessionRequest: chrome.cast.SessionRequest,
193
+ sessionListener: (session: chrome.cast.Session) => void,
194
+ receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void,
195
+ autoJoinPolicy?: chrome.cast.AutoJoinPolicy,
196
+ defaultActionPolicy?: chrome.cast.DefaultActionPolicy,
197
+ );
198
+
199
+ sessionRequest: chrome.cast.SessionRequest;
200
+ sessionListener: (session: chrome.cast.Session) => void;
201
+ receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void;
202
+ autoJoinPolicy: chrome.cast.AutoJoinPolicy;
203
+ defaultActionPolicy: chrome.cast.DefaultActionPolicy;
204
+ }
205
+
206
+ export class Error {
207
+ /**
208
+ * @param code
209
+ * @param opt_description
210
+ * @param opt_details
211
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error
212
+ */
213
+ constructor(code: chrome.cast.ErrorCode, description?: string, details?: Object);
214
+
215
+ code: chrome.cast.ErrorCode;
216
+ description: string | null;
217
+ details: object;
218
+ }
219
+
220
+ export class Image {
221
+ /**
222
+ * @param url
223
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Image
224
+ */
225
+ constructor(url: string);
226
+
227
+ url: string;
228
+ height: number | null;
229
+ width: number | null;
230
+ }
231
+
232
+ export class SenderApplication {
233
+ /**
234
+ * @param platform
235
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderApplication
236
+ */
237
+ constructor(platform: chrome.cast.SenderPlatform);
238
+
239
+ platform: chrome.cast.SenderPlatform;
240
+ url: string | null;
241
+ packageId: string | null;
242
+ }
243
+
244
+ export class SessionRequest {
245
+ /**
246
+ * @param appId
247
+ * @param opt_capabilities
248
+ * @param opt_timeout
249
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionRequest
250
+ */
251
+ constructor(appId: string, capabilities?: chrome.cast.Capability[], timeout?: number);
252
+
253
+ appId: string;
254
+ capabilities: chrome.cast.Capability[];
255
+ requestSessionTimeout: number;
256
+ language: string | null;
257
+ }
258
+
259
+ export class Session {
260
+ /**
261
+ * @param sessionId
262
+ * @param appId
263
+ * @param displayName
264
+ * @param appImages
265
+ * @param receiver
266
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Session
267
+ */
268
+ constructor(
269
+ sessionId: string,
270
+ appId: string,
271
+ displayName: string,
272
+ appImages: chrome.cast.Image[],
273
+ receiver: chrome.cast.Receiver,
274
+ );
275
+
276
+ sessionId: string;
277
+ appId: string;
278
+ displayName: string;
279
+ appImages: chrome.cast.Image[];
280
+ receiver: chrome.cast.Receiver;
281
+ senderApps: chrome.cast.SenderApplication[];
282
+ namespaces: Array<{ name: string }>;
283
+ media: chrome.cast.media.Media[];
284
+ status: chrome.cast.SessionStatus;
285
+ statusText: string | null;
286
+ transportId: string;
287
+
288
+ /**
289
+ * @param newLevel
290
+ * @param successCallback
291
+ * @param errorCallback
292
+ */
293
+ setReceiverVolumeLevel(
294
+ newLevel: number,
295
+ successCallback: Function,
296
+ errorCallback: (error: chrome.cast.Error) => void,
297
+ ): void;
298
+
299
+ /**
300
+ * @param muted
301
+ * @param successCallback
302
+ * @param errorCallback
303
+ */
304
+ setReceiverMuted(
305
+ muted: boolean,
306
+ successCallback: Function,
307
+ errorCallback: (error: chrome.cast.Error) => void,
308
+ ): void;
309
+
310
+ /**
311
+ * @param successCallback
312
+ * @param errorCallback
313
+ */
314
+ leave(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
315
+
316
+ /**
317
+ * @param successCallback
318
+ * @param errorCallback
319
+ */
320
+ stop(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
321
+
322
+ /**
323
+ * @param namespace
324
+ * @param message
325
+ * @param successCallback
326
+ * @param errorCallback
327
+ */
328
+ sendMessage(
329
+ namespace: string,
330
+ message: string | object,
331
+ successCallback: Function,
332
+ errorCallback: (error: chrome.cast.Error) => void,
333
+ ): void;
334
+
335
+ /**
336
+ * @param listener
337
+ */
338
+ addUpdateListener(listener: (isAlive: boolean) => void): void;
339
+
340
+ /**
341
+ * @param listener
342
+ */
343
+ removeUpdateListener(listener: (isAlive: boolean) => void): void;
344
+
345
+ /**
346
+ * @param namespace
347
+ * @param listener
348
+ */
349
+ addMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
350
+
351
+ /**
352
+ * @param namespace
353
+ * @param listener
354
+ */
355
+ removeMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
356
+
357
+ /**
358
+ * @param listener
359
+ */
360
+ addMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
361
+
362
+ /**
363
+ * @param listener
364
+ */
365
+ removeMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
366
+
367
+ /**
368
+ * @param loadRequest
369
+ * @param successCallback
370
+ * @param errorCallback
371
+ */
372
+ loadMedia(
373
+ loadRequest: chrome.cast.media.LoadRequest,
374
+ successCallback: (media: chrome.cast.media.Media) => void,
375
+ errorCallback: (error: chrome.cast.Error) => void,
376
+ ): void;
377
+
378
+ /**
379
+ * @param queueLoadRequest
380
+ * @param successCallback
381
+ * @param errorCallback
382
+ */
383
+ queueLoad(
384
+ queueLoadRequest: chrome.cast.media.QueueLoadRequest,
385
+ successCallback: (media: chrome.cast.media.Media) => void,
386
+ errorCallback: (error: chrome.cast.Error) => void,
387
+ ): void;
388
+ }
389
+
390
+ export class Receiver {
391
+ /**
392
+ * @param label
393
+ * @param friendlyName
394
+ * @param opt_capabilities
395
+ * @param opt_volume
396
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Receiver
397
+ */
398
+ constructor(
399
+ label: string,
400
+ friendlyName: string,
401
+ capabilities?: chrome.cast.Capability[],
402
+ volume?: chrome.cast.Volume,
403
+ );
404
+
405
+ label: string;
406
+ friendlyName: string;
407
+ capabilities: chrome.cast.Capability[];
408
+ volume: chrome.cast.Volume;
409
+ receiverType: chrome.cast.ReceiverType;
410
+ displayStatus: chrome.cast.ReceiverDisplayStatus;
411
+ }
412
+
413
+ export class ReceiverDisplayStatus {
414
+ /**
415
+ * @param statusText
416
+ * @param appImages
417
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverDisplayStatus
418
+ */
419
+ constructor(statusText: string, appImages: chrome.cast.Image[]);
420
+
421
+ statusText: string;
422
+ appImages: chrome.cast.Image[];
423
+ }
424
+
425
+ export class Volume {
426
+ /**
427
+ * @param opt_level
428
+ * @param opt_muted
429
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Volume
430
+ */
431
+ constructor(level?: number, muted?: boolean);
432
+
433
+ level: number | null;
434
+ muted: boolean | null;
435
+ }
436
+ }
1000
437
 
1001
- /**
1002
- * @param itemId
1003
- * @param successCallback
1004
- * @param errorCallback
1005
- */
1006
- queueJumpToItem(
1007
- itemId: number,
1008
- successCallback: Function,
1009
- errorCallback: (error: chrome.cast.Error) => void,
1010
- ): void;
438
+ export namespace cast.media {
439
+ export var DEFAULT_MEDIA_RECEIVER_APP_ID: string;
1011
440
 
1012
441
  /**
1013
- * @param itemId
1014
- * @param newIndex
1015
- * @param successCallback
1016
- * @param errorCallback
442
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MediaCommand
1017
443
  */
1018
- queueMoveItemToNewIndex(
1019
- itemId: number,
1020
- newIndex: number,
1021
- successCallback: Function,
1022
- errorCallback: (error: chrome.cast.Error) => void,
1023
- ): void;
444
+ export enum MediaCommand {
445
+ PAUSE = "pause",
446
+ SEEK = "seek",
447
+ STREAM_VOLUME = "stream_volume",
448
+ STREAM_MUTE = "stream_mute",
449
+ }
1024
450
 
1025
451
  /**
1026
- * @param successCallback
1027
- * @param errorCallback
452
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MetadataType
1028
453
  */
1029
- queueNext(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
454
+ export enum MetadataType {
455
+ GENERIC,
456
+ TV_SHOW,
457
+ MOVIE,
458
+ MUSIC_TRACK,
459
+ PHOTO,
460
+ }
1030
461
 
1031
462
  /**
1032
- * @param successCallback
1033
- * @param errorCallback
1034
- */
1035
- queuePrev(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
463
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.PlayerState
464
+ */
465
+ export enum PlayerState {
466
+ IDLE = "IDLE",
467
+ PLAYING = "PLAYING",
468
+ PAUSED = "PAUSED",
469
+ BUFFERING = "BUFFERING",
470
+ }
471
+
472
+ /**
473
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.ResumeState
474
+ */
475
+ export enum ResumeState {
476
+ PLAYBACK_START = "PLAYBACK_START",
477
+ PLAYBACK_PAUSE = "PLAYBACK_PAUSE",
478
+ }
479
+
480
+ /**
481
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.StreamType
482
+ */
483
+ export enum StreamType {
484
+ BUFFERED = "BUFFERED",
485
+ LIVE = "LIVE",
486
+ OTHER = "OTHER",
487
+ }
488
+
489
+ /**
490
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.IdleReason
491
+ */
492
+ export enum IdleReason {
493
+ CANCELLED = "CANCELLED",
494
+ INTERRUPTED = "INTERRUPTED",
495
+ FINISHED = "FINISHED",
496
+ ERROR = "ERROR",
497
+ }
1036
498
 
1037
499
  /**
1038
- * @param itemId
1039
- * @param successCallback
1040
- * @param errorCallback
1041
- */
1042
- queueRemoveItem(
1043
- itemId: number,
1044
- successCallback: Function,
1045
- errorCallback: (error: chrome.cast.Error) => void,
1046
- ): void;
500
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode
501
+ */
502
+ export enum RepeatMode {
503
+ OFF = "REPEAT_OFF",
504
+ ALL = "REPEAT_ALL",
505
+ SINGLE = "REPEAT_SINGLE",
506
+ ALL_AND_SHUFFLE = "REPEAT_ALL_AND_SHUFFLE",
507
+ }
1047
508
 
1048
- /**
1049
- * @param queueReorderItemsRequest
1050
- * @param successCallback
1051
- * @param errorCallback
1052
- */
1053
- queueReorderItems(
1054
- queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest,
1055
- successCallback: Function,
1056
- errorCallback: (error: chrome.cast.Error) => void,
1057
- ): void;
509
+ export class QueueItem {
510
+ /**
511
+ * @param mediaInfo
512
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem
513
+ */
514
+ constructor(mediaInfo: chrome.cast.media.MediaInfo);
1058
515
 
1059
- /**
1060
- * @param repeatMode
1061
- * @param successCallback
1062
- * @param errorCallback
1063
- */
1064
- queueSetRepeatMode(
1065
- repeatMode: chrome.cast.media.RepeatMode,
1066
- successCallback: Function,
1067
- errorCallback: (error: chrome.cast.Error) => void,
1068
- ): void;
516
+ activeTrackIds: Number[];
517
+ autoplay: boolean;
518
+ customData: Object;
519
+ itemId: number;
520
+ media: chrome.cast.media.MediaInfo;
521
+ preloadTime: number;
522
+ startTime: number;
523
+ }
1069
524
 
1070
- /**
1071
- * @param queueUpdateItemsRequest
1072
- * @param successCallback
1073
- * @param errorCallback
1074
- */
1075
- queueUpdateItems(
1076
- queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest,
1077
- successCallback: Function,
1078
- errorCallback: (error: chrome.cast.Error) => void,
1079
- ): void;
1080
- }
525
+ export class QueueLoadRequest {
526
+ /**
527
+ * @param items
528
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest
529
+ */
530
+ constructor(items: chrome.cast.media.QueueItem[]);
1081
531
 
1082
- export class Track {
1083
- /**
1084
- * @param trackId
1085
- * @param trackType
1086
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track
1087
- */
1088
- constructor(trackId: number, trackType: chrome.cast.media.TrackType);
1089
-
1090
- trackId: number;
1091
- trackContentId: string;
1092
- trackContentType: string;
1093
- type: chrome.cast.media.TrackType;
1094
- name: string;
1095
- language: string;
1096
- subtype: chrome.cast.media.TextTrackType;
1097
- customData: Object;
1098
- }
532
+ customData: Object;
533
+ items: chrome.cast.media.QueueItem[];
534
+ repeatMode: chrome.cast.media.RepeatMode;
535
+ startIndex: number;
536
+ }
1099
537
 
1100
- export class TextTrackStyle {
1101
- /**
1102
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle
1103
- */
1104
- constructor();
1105
-
1106
- foregroundColor: string;
1107
- backgroundColor: string;
1108
- edgeType: chrome.cast.media.TextTrackEdgeType;
1109
- edgeColor: string;
1110
- windowType: chrome.cast.media.TextTrackWindowType;
1111
- windowColor: string;
1112
- windowRoundedCornerRadius: number;
1113
- fontScale: number;
1114
- fontFamily: string;
1115
- fontGenericFamily: chrome.cast.media.TextTrackFontGenericFamily;
1116
- fontStyle: chrome.cast.media.TextTrackFontStyle;
1117
- customData: Object;
538
+ export class QueueInsertItemsRequest {
539
+ /**
540
+ * @param itemsToInsert
541
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest
542
+ */
543
+ constructor(itemsToInsert: chrome.cast.media.QueueItem[]);
544
+
545
+ customData: Object;
546
+ insertBefore: number;
547
+ items: chrome.cast.media.QueueItem[];
548
+ }
549
+
550
+ export class QueueRemoveItemsRequest {
551
+ /**
552
+ * @param itemIdsToRemove
553
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest
554
+ */
555
+ constructor(itemIdsToRemove: number[]);
556
+
557
+ customData: Object;
558
+ itemIds: number[];
559
+ }
560
+
561
+ export class QueueReorderItemsRequest {
562
+ /**
563
+ * @param itemIdsToReorder
564
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest
565
+ */
566
+ constructor(itemIdsToReorder: number[]);
567
+
568
+ customData: Object;
569
+ insertBefore: number;
570
+ itemIds: number[];
571
+ }
572
+
573
+ export class QueueUpdateItemsRequest {
574
+ /**
575
+ * @param itemsToUpdate
576
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest
577
+ */
578
+ constructor(itemsToUpdate: chrome.cast.media.QueueItem[]);
579
+
580
+ customData: Object;
581
+ item: chrome.cast.media.QueueItem[];
582
+ }
583
+
584
+ /**
585
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TrackType
586
+ */
587
+ export enum TrackType {
588
+ TEXT = "TEXT",
589
+ AUDIO = "AUDIO",
590
+ VIDEO = "VIDEO",
591
+ }
592
+
593
+ /**
594
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackType
595
+ */
596
+ export enum TextTrackType {
597
+ SUBTITLES = "SUBTITLES",
598
+ CAPTIONS = "CAPTIONS",
599
+ DESCRIPTIONS = "DESCRIPTIONS",
600
+ CHAPTERS = "CHAPTERS",
601
+ METADATA = "METADATA",
602
+ }
603
+
604
+ /**
605
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackEdgeType
606
+ */
607
+ export enum TextTrackEdgeType {
608
+ NONE = "NONE",
609
+ OUTLINE = "OUTLINE",
610
+ DROP_SHADOW = "DROP_SHADOW",
611
+ RAISED = "RAISED",
612
+ DEPRESSED = "DEPRESSED",
613
+ }
614
+
615
+ /**
616
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackWindowType
617
+ */
618
+ export enum TextTrackWindowType {
619
+ NONE = "NONE",
620
+ NORMAL = "NORMAL",
621
+ ROUNDED_CORNERS = "ROUNDED_CORNERS",
622
+ }
623
+
624
+ /**
625
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontGenericFamily
626
+ */
627
+ export enum TextTrackFontGenericFamily {
628
+ SANS_SERIF = "SANS_SERIF",
629
+ MONOSPACED_SANS_SERIF = "MONOSPACED_SANS_SERIF",
630
+ SERIF = "SERIF",
631
+ MONOSPACED_SERIF = "MONOSPACED_SERIF",
632
+ CASUAL = "CASUAL",
633
+ CURSIVE = "CURSIVE",
634
+ SMALL_CAPITALS = "SMALL_CAPITALS",
635
+ }
636
+
637
+ /**
638
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontStyle
639
+ */
640
+ export enum TextTrackFontStyle {
641
+ NORMAL = "NORMAL",
642
+ BOLD = "BOLD",
643
+ BOLD_ITALIC = "BOLD_ITALIC",
644
+ ITALIC = "ITALIC",
645
+ }
646
+
647
+ export class GetStatusRequest {
648
+ /**
649
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest
650
+ */
651
+ constructor();
652
+
653
+ customData: Object;
654
+ }
655
+
656
+ export class PauseRequest {
657
+ /**
658
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest
659
+ */
660
+ constructor();
661
+
662
+ customData: Object;
663
+ }
664
+
665
+ export class PlayRequest {
666
+ /**
667
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest
668
+ */
669
+ constructor();
670
+
671
+ customData: Object;
672
+ }
673
+
674
+ export class SeekRequest {
675
+ /**
676
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest
677
+ */
678
+ constructor();
679
+
680
+ currentTime: number;
681
+ resumeState: chrome.cast.media.ResumeState;
682
+ customData: Object;
683
+ }
684
+
685
+ export class StopRequest {
686
+ /**
687
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest
688
+ */
689
+ constructor();
690
+
691
+ customData: Object;
692
+ }
693
+
694
+ export class VolumeRequest {
695
+ /**
696
+ * @param volume
697
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.VolumeRequest
698
+ */
699
+ constructor(volume: chrome.cast.Volume);
700
+
701
+ volume: chrome.cast.Volume;
702
+ customData: Object;
703
+ }
704
+
705
+ export class LoadRequest {
706
+ /**
707
+ * @param mediaInfo
708
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LoadRequest
709
+ */
710
+ constructor(mediaInfo: chrome.cast.media.MediaInfo);
711
+
712
+ activeTrackIds: number[];
713
+ autoplay: boolean;
714
+ currentTime: number;
715
+ customData: Object;
716
+ media: chrome.cast.media.MediaInfo;
717
+ playbackRate?: number | undefined;
718
+ }
719
+
720
+ export class EditTracksInfoRequest {
721
+ /**
722
+ * @param opt_activeTrackIds
723
+ * @param opt_textTrackStyle
724
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.EditTracksInfoRequest
725
+ */
726
+ constructor(activeTrackIds?: number[], textTrackStyle?: chrome.cast.media.TextTrackStyle);
727
+
728
+ activeTrackIds: number[];
729
+ textTrackStyle: chrome.cast.media.TextTrackStyle;
730
+ }
731
+
732
+ export class GenericMediaMetadata {
733
+ images: chrome.cast.Image[];
734
+ metadataType: chrome.cast.media.MetadataType;
735
+ releaseDate: string;
736
+ /** @deprecated Use releaseDate instead. */
737
+ releaseYear: number;
738
+ subtitle: string;
739
+ title: string;
740
+ /** @deprecated Use metadataType instead. */
741
+ type: chrome.cast.media.MetadataType;
742
+ }
743
+
744
+ export class MovieMediaMetadata {
745
+ /**
746
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata
747
+ */
748
+ constructor();
749
+
750
+ images: chrome.cast.Image[];
751
+ metadataType: chrome.cast.media.MetadataType;
752
+ releaseDate: string;
753
+ /** @deprecated Use releaseDate instead. */
754
+ releaseYear: number;
755
+ subtitle: string;
756
+ title: string;
757
+ studio: string;
758
+ /** @deprecated Use metadataType instead. */
759
+ type: chrome.cast.media.MetadataType;
760
+ }
761
+
762
+ export class TvShowMediaMetadata {
763
+ /**
764
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata
765
+ */
766
+ constructor();
767
+
768
+ metadataType: chrome.cast.media.MetadataType;
769
+ seriesTitle: string;
770
+ title: string;
771
+ season: number;
772
+ episode: number;
773
+ images: chrome.cast.Image[];
774
+ originalAirdate: string;
775
+
776
+ /** @deprecated Use metadataType instead. */
777
+ type: chrome.cast.media.MetadataType;
778
+ /** @deprecated Use title instead. */
779
+ episodeTitle: string;
780
+ /** @deprecated Use season instead. */
781
+ seasonNumber: number;
782
+ /** @deprecated Use episode instead. */
783
+ episodeNumber: number;
784
+ /** @deprecated Use originalAirdate instead. */
785
+ releaseYear: number;
786
+ }
787
+
788
+ export class MusicTrackMediaMetadata {
789
+ /**
790
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata
791
+ */
792
+ constructor();
793
+
794
+ metadataType: chrome.cast.media.MetadataType;
795
+ albumName: string;
796
+ title: string;
797
+ albumArtist: string;
798
+ artist: string;
799
+ composer: string;
800
+ songName: string;
801
+ trackNumber: number;
802
+ discNumber: number;
803
+ images: chrome.cast.Image[];
804
+ releaseDate: string;
805
+
806
+ /** @deprecated Use metadataType instead. */
807
+ type: chrome.cast.media.MetadataType;
808
+ /** @deprecated Use artist instead. */
809
+ artistName: string;
810
+ /** @deprecated Use releaseDate instead. */
811
+ releaseYear: number;
812
+ }
813
+
814
+ export class PhotoMediaMetadata {
815
+ /**
816
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata
817
+ */
818
+ constructor();
819
+
820
+ metadataType: chrome.cast.media.MetadataType;
821
+ title: string;
822
+ artist: string;
823
+ location: string;
824
+ images: chrome.cast.Image[];
825
+ latitude: number;
826
+ longitude: number;
827
+ width: number;
828
+ height: number;
829
+ creationDateTime: string;
830
+
831
+ /** @deprecated Use metadataType instead. */
832
+ type: chrome.cast.media.MetadataType;
833
+ }
834
+
835
+ export class MediaInfo {
836
+ /**
837
+ * @param contentId
838
+ * @param contentType
839
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaInfo
840
+ */
841
+ constructor(contentId: string, contentType: string);
842
+
843
+ contentId: string;
844
+ streamType: chrome.cast.media.StreamType;
845
+ contentType: string;
846
+ metadata: any;
847
+ duration?: number | null;
848
+ tracks?: chrome.cast.media.Track[] | null;
849
+ textTrackStyle?: chrome.cast.media.TextTrackStyle | null;
850
+ customData?: Object | null;
851
+ }
852
+
853
+ export class Media {
854
+ /**
855
+ * @param sessionId
856
+ * @param mediaSessionId
857
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media
858
+ */
859
+ constructor(sessionId: string, mediaSessionId: number);
860
+
861
+ activeTrackIds?: number[] | null;
862
+ currentItemId?: number | null;
863
+ customData?: Object | null;
864
+ idleReason: chrome.cast.media.IdleReason | null;
865
+ items?: chrome.cast.media.QueueItem[] | null;
866
+ liveSeekableRange?: chrome.cast.media.LiveSeekableRange | undefined;
867
+ loadingItemId?: number | null;
868
+ media?: chrome.cast.media.MediaInfo | null;
869
+ mediaSessionId: number;
870
+ playbackRate: number;
871
+ playerState: chrome.cast.media.PlayerState;
872
+ preloadedItemId?: number | null;
873
+ repeatMode: chrome.cast.media.RepeatMode;
874
+ sessionId: string;
875
+ supportedMediaCommands: chrome.cast.media.MediaCommand[];
876
+ volume: chrome.cast.Volume;
877
+
878
+ /** @deprecated Use getEstimatedTime instead */
879
+ currentTime: number;
880
+
881
+ /**
882
+ * @param getStatusRequest
883
+ * @param successCallback
884
+ * @param errorCallback
885
+ */
886
+ getStatus(
887
+ getStatusRequest: chrome.cast.media.GetStatusRequest,
888
+ successCallback: Function,
889
+ errorCallback: (error: chrome.cast.Error) => void,
890
+ ): void;
891
+
892
+ /**
893
+ * @param playRequest
894
+ * @param successCallback
895
+ * @param errorCallback
896
+ */
897
+ play(
898
+ playRequest: chrome.cast.media.PlayRequest,
899
+ successCallback: Function,
900
+ errorCallback: (error: chrome.cast.Error) => void,
901
+ ): void;
902
+
903
+ /**
904
+ * @param pauseRequest
905
+ * @param successCallback
906
+ * @param errorCallback
907
+ */
908
+ pause(
909
+ pauseRequest: chrome.cast.media.PauseRequest,
910
+ successCallback: Function,
911
+ errorCallback: (error: chrome.cast.Error) => void,
912
+ ): void;
913
+
914
+ /**
915
+ * @param seekRequest
916
+ * @param successCallback
917
+ * @param errorCallback
918
+ */
919
+ seek(
920
+ seekRequest: chrome.cast.media.SeekRequest,
921
+ successCallback: Function,
922
+ errorCallback: (error: chrome.cast.Error) => void,
923
+ ): void;
924
+
925
+ /**
926
+ * @param stopRequest
927
+ * @param successCallback
928
+ * @param errorCallback
929
+ */
930
+ stop(
931
+ stopRequest: chrome.cast.media.StopRequest,
932
+ successCallback: Function,
933
+ errorCallback: (error: chrome.cast.Error) => void,
934
+ ): void;
935
+
936
+ /**
937
+ * @param volumeRequest
938
+ * @param successCallback
939
+ * @param errorCallback
940
+ */
941
+ setVolume(
942
+ volumeRequest: chrome.cast.media.VolumeRequest,
943
+ successCallback: Function,
944
+ errorCallback: (error: chrome.cast.Error) => void,
945
+ ): void;
946
+
947
+ /**
948
+ * @param editTracksInfoRequest
949
+ * @param successCallback
950
+ * @param errorCallback
951
+ */
952
+ editTracksInfo(
953
+ editTracksInfoRequest: chrome.cast.media.EditTracksInfoRequest,
954
+ successCallback: Function,
955
+ errorCallback: (error: chrome.cast.Error) => void,
956
+ ): void;
957
+
958
+ /**
959
+ * @param command
960
+ * @return whether or not the receiver supports the given chrome.cast.media.MediaCommand
961
+ */
962
+ supportsCommand(command: chrome.cast.media.MediaCommand): boolean;
963
+
964
+ /**
965
+ * @param listener
966
+ */
967
+ addUpdateListener(listener: (isAlive: boolean) => void): void;
968
+
969
+ /**
970
+ * @param listener
971
+ */
972
+ removeUpdateListener(listener: (isAlive: boolean) => void): void;
973
+
974
+ /**
975
+ * @return
976
+ * @suppress {deprecated} Uses currentTime member to compute estimated time.
977
+ */
978
+ getEstimatedTime(): number;
979
+
980
+ /**
981
+ * @param item
982
+ * @param successCallback
983
+ * @param errorCallback
984
+ */
985
+ queueAppendItem(
986
+ item: chrome.cast.media.QueueItem,
987
+ successCallback: Function,
988
+ errorCallback: (error: chrome.cast.Error) => void,
989
+ ): void;
990
+
991
+ /**
992
+ * @param queueInsertItemsRequest
993
+ * @param successCallback
994
+ * @param errorCallback
995
+ */
996
+ queueInsertItems(
997
+ queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest,
998
+ successCallback: Function,
999
+ errorCallback: (error: chrome.cast.Error) => void,
1000
+ ): void;
1001
+
1002
+ /**
1003
+ * @param itemId
1004
+ * @param successCallback
1005
+ * @param errorCallback
1006
+ */
1007
+ queueJumpToItem(
1008
+ itemId: number,
1009
+ successCallback: Function,
1010
+ errorCallback: (error: chrome.cast.Error) => void,
1011
+ ): void;
1012
+
1013
+ /**
1014
+ * @param itemId
1015
+ * @param newIndex
1016
+ * @param successCallback
1017
+ * @param errorCallback
1018
+ */
1019
+ queueMoveItemToNewIndex(
1020
+ itemId: number,
1021
+ newIndex: number,
1022
+ successCallback: Function,
1023
+ errorCallback: (error: chrome.cast.Error) => void,
1024
+ ): void;
1025
+
1026
+ /**
1027
+ * @param successCallback
1028
+ * @param errorCallback
1029
+ */
1030
+ queueNext(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
1031
+
1032
+ /**
1033
+ * @param successCallback
1034
+ * @param errorCallback
1035
+ */
1036
+ queuePrev(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
1037
+
1038
+ /**
1039
+ * @param itemId
1040
+ * @param successCallback
1041
+ * @param errorCallback
1042
+ */
1043
+ queueRemoveItem(
1044
+ itemId: number,
1045
+ successCallback: Function,
1046
+ errorCallback: (error: chrome.cast.Error) => void,
1047
+ ): void;
1048
+
1049
+ /**
1050
+ * @param queueReorderItemsRequest
1051
+ * @param successCallback
1052
+ * @param errorCallback
1053
+ */
1054
+ queueReorderItems(
1055
+ queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest,
1056
+ successCallback: Function,
1057
+ errorCallback: (error: chrome.cast.Error) => void,
1058
+ ): void;
1059
+
1060
+ /**
1061
+ * @param repeatMode
1062
+ * @param successCallback
1063
+ * @param errorCallback
1064
+ */
1065
+ queueSetRepeatMode(
1066
+ repeatMode: chrome.cast.media.RepeatMode,
1067
+ successCallback: Function,
1068
+ errorCallback: (error: chrome.cast.Error) => void,
1069
+ ): void;
1070
+
1071
+ /**
1072
+ * @param queueUpdateItemsRequest
1073
+ * @param successCallback
1074
+ * @param errorCallback
1075
+ */
1076
+ queueUpdateItems(
1077
+ queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest,
1078
+ successCallback: Function,
1079
+ errorCallback: (error: chrome.cast.Error) => void,
1080
+ ): void;
1081
+ }
1082
+
1083
+ export class Track {
1084
+ /**
1085
+ * @param trackId
1086
+ * @param trackType
1087
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track
1088
+ */
1089
+ constructor(trackId: number, trackType: chrome.cast.media.TrackType);
1090
+
1091
+ trackId: number;
1092
+ trackContentId: string;
1093
+ trackContentType: string;
1094
+ type: chrome.cast.media.TrackType;
1095
+ name: string;
1096
+ language: string;
1097
+ subtype: chrome.cast.media.TextTrackType;
1098
+ customData: Object;
1099
+ }
1100
+
1101
+ export class TextTrackStyle {
1102
+ /**
1103
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle
1104
+ */
1105
+ constructor();
1106
+
1107
+ foregroundColor: string;
1108
+ backgroundColor: string;
1109
+ edgeType: chrome.cast.media.TextTrackEdgeType;
1110
+ edgeColor: string;
1111
+ windowType: chrome.cast.media.TextTrackWindowType;
1112
+ windowColor: string;
1113
+ windowRoundedCornerRadius: number;
1114
+ fontScale: number;
1115
+ fontFamily: string;
1116
+ fontGenericFamily: chrome.cast.media.TextTrackFontGenericFamily;
1117
+ fontStyle: chrome.cast.media.TextTrackFontStyle;
1118
+ customData: Object;
1119
+ }
1120
+
1121
+ export class LiveSeekableRange {
1122
+ /**
1123
+ * @param start
1124
+ * @param end
1125
+ * @param isMovingWindow
1126
+ * @param isLiveDone
1127
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LiveSeekableRange
1128
+ */
1129
+ constructor(start?: number, end?: number, isMovingWindow?: boolean, isLiveDone?: boolean);
1130
+
1131
+ start?: number | undefined;
1132
+ end?: number | undefined;
1133
+ isMovingWindow?: boolean | undefined;
1134
+ isLiveDone?: boolean | undefined;
1135
+ }
1118
1136
  }
1119
1137
 
1120
- export class LiveSeekableRange {
1121
- /**
1122
- * @param start
1123
- * @param end
1124
- * @param isMovingWindow
1125
- * @param isLiveDone
1126
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LiveSeekableRange
1127
- */
1128
- constructor(start?: number, end?: number, isMovingWindow?: boolean, isLiveDone?: boolean);
1129
-
1130
- start?: number | undefined;
1131
- end?: number | undefined;
1132
- isMovingWindow?: boolean | undefined;
1133
- isLiveDone?: boolean | undefined;
1138
+ /**
1139
+ * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout
1140
+ */
1141
+ export namespace cast.media.timeout {
1142
+ export var load: number;
1143
+ export var getStatus: number;
1144
+ export var play: number;
1145
+ export var pause: number;
1146
+ export var seek: number;
1147
+ export var stop: number;
1148
+ export var setVolume: number;
1149
+ export var editTracksInfo: number;
1150
+ export var queueInsert: number;
1151
+ export var queueLoad: number;
1152
+ export var queueRemove: number;
1153
+ export var queueReorder: number;
1154
+ export var queueUpdate: number;
1134
1155
  }
1135
1156
  }
1136
-
1137
- /**
1138
- * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout
1139
- */
1140
- declare namespace chrome.cast.media.timeout {
1141
- export var load: number;
1142
- export var getStatus: number;
1143
- export var play: number;
1144
- export var pause: number;
1145
- export var seek: number;
1146
- export var stop: number;
1147
- export var setVolume: number;
1148
- export var editTracksInfo: number;
1149
- export var queueInsert: number;
1150
- export var queueLoad: number;
1151
- export var queueRemove: number;
1152
- export var queueReorder: number;
1153
- export var queueUpdate: number;
1154
- }