@tivio/sdk-react 3.6.0 → 3.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2653 @@
1
+ import { ComponentType } from 'react';
2
+ import { FunctionComponentElement } from 'react';
3
+ import { default as React_2 } from 'react';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+ export declare interface AdExternal {
9
+ /**
10
+ * Can user seek out of it?
11
+ */
12
+ canSeek: boolean;
13
+ /**
14
+ * Can it be skipped right now?
15
+ */
16
+ canSkip: boolean;
17
+ durationMs: number;
18
+ /**
19
+ * Is it skippable in general?
20
+ */
21
+ isSkippable: boolean;
22
+ order: number | null;
23
+ secondsToSkippable: number | null;
24
+ /**
25
+ * Countdown for un-skippable ads
26
+ */
27
+ secondsToEnd: number;
28
+ skipDelayMs: number | null;
29
+ /**
30
+ * How many ads are there in total
31
+ */
32
+ totalCount: number | null;
33
+ click: () => void;
34
+ /**
35
+ * @private
36
+ */
37
+ skip: () => void;
38
+ }
39
+
40
+ declare type AdSegment = {
41
+ id: string;
42
+ /**
43
+ * @deprecated alias to secondsToEnd * 1000
44
+ */
45
+ remainingMs: number;
46
+ secondsToEnd: number;
47
+ secondsToSkippable: number | null;
48
+ canSeek: boolean;
49
+ /**
50
+ * true if is skippable and skip countdown has passed
51
+ */
52
+ canSkip: boolean;
53
+ /**
54
+ * true ad if is skippable after some skipDelayMs (if it is skippable, skipDelayMs is defined)
55
+ */
56
+ isSkippable: boolean;
57
+ skip: () => any;
58
+ };
59
+
60
+ /**
61
+ * @public
62
+ */
63
+ export declare type AdSource = {
64
+ new (uri: string, name: string, description: string, skipDelayMs: number | null, adDurationMs: number, trackingContext?: any, // internal Tivio types
65
+ adMarker?: any, // internal Tivio types
66
+ packInfo?: any, // internal Tivio types
67
+ provider?: any): AdSource;
68
+ description: string;
69
+ name: string;
70
+ uri: string;
71
+ durationMs: number;
72
+ skipDelayMs: number | null;
73
+ type: 'ad';
74
+ /**
75
+ * true if is skippable and skip countdown has passed
76
+ */
77
+ canSkip: boolean;
78
+ /**
79
+ * true ad if is skippable after some skipDelayMs (if it is skippable, skipDelayMs is defined)
80
+ */
81
+ isSkippable: boolean;
82
+ /**
83
+ * Skip ad. Only works when canSkip is true
84
+ */
85
+ skip: () => void;
86
+ /**
87
+ * Order in ad break (ad break is a group of ads played right after each other)
88
+ */
89
+ order: number;
90
+ /**
91
+ * Total number of ads in ad break (ad break is a group of ads played right after each other)
92
+ */
93
+ totalCount: number;
94
+ secondsToEnd: number;
95
+ secondsToSkippable: number | null;
96
+ };
97
+
98
+ /**
99
+ * @public
100
+ */
101
+ export declare enum ALGOLIA_INDEX_NAME {
102
+ VIDEOS = "videos",
103
+ VIDEOSDESC = "videos_created_desc",
104
+ TAGS = "tags",
105
+ TV_CHANNELS = "tvChannels",
106
+ USERS = "users"
107
+ }
108
+
109
+ /**
110
+ * @public
111
+ */
112
+ export declare interface Asset {
113
+ background: string;
114
+ }
115
+
116
+ /**
117
+ * @public
118
+ */
119
+ export declare type Assets = {
120
+ [assetName: string]: ScalableAsset;
121
+ };
122
+
123
+ /**
124
+ * @public
125
+ */
126
+ export declare type AuthOverlayPayload = {
127
+ prefilledData?: {
128
+ email: string;
129
+ };
130
+ /**
131
+ * "Goto" function (see router.utils.ts) to run after the overlay is closed. Null if no redirect is required.
132
+ * Defaults to homepage.
133
+ */
134
+ redirectAfterSubmit?: ((...args: any[]) => void) | null;
135
+ };
136
+
137
+ /**
138
+ * @public
139
+ */
140
+ export declare type AuthOverlayState = {
141
+ type: AuthOverlayType;
142
+ closeAuthOverlay: () => void;
143
+ openAuthOverlay: (type: AuthOverlayType, payload?: AuthOverlayPayload) => void;
144
+ payload?: AuthOverlayPayload | null;
145
+ };
146
+
147
+ /**
148
+ * @public
149
+ */
150
+ export declare type AuthOverlayType = 'login' | 'registration' | 'closed' | 'reset-password';
151
+
152
+ /**
153
+ * @public
154
+ */
155
+ export declare interface AvailableSeason {
156
+ seasonNumber: number;
157
+ }
158
+
159
+ /**
160
+ * @public
161
+ */
162
+ export declare type AvatarProps = {
163
+ cover?: string;
164
+ isLoading?: boolean;
165
+ size?: number;
166
+ };
167
+
168
+ /**
169
+ * @public
170
+ */
171
+ export declare type BadRequestError = Error & {
172
+ details?: {
173
+ reason?: 'DOES_NOT_EXIST' | 'EXPIRED' | 'ALREADY_USED';
174
+ };
175
+ };
176
+
177
+ /**
178
+ * @public
179
+ */
180
+ export declare type BannerProps = {
181
+ isLoading: boolean;
182
+ text: string;
183
+ focused: boolean;
184
+ onClick?: () => void;
185
+ hoverable: boolean;
186
+ broadcastInfo: string;
187
+ height: number;
188
+ coverPadding: CoverPadding;
189
+ cover: string;
190
+ fullWidth: boolean;
191
+ coverContainerPaddingTop: string;
192
+ width: number;
193
+ overlay: boolean;
194
+ price: string;
195
+ hasRoundCorners: boolean;
196
+ buttonText?: string;
197
+ onButtonClick?: () => void;
198
+ };
199
+
200
+ /**
201
+ * @public
202
+ */
203
+ export declare type BannerPropsPartial = Partial<BannerProps>;
204
+
205
+ /**
206
+ * @public
207
+ */
208
+ export declare type BasicTivioBundle = {
209
+ components: TivioComponents;
210
+ getters: TivioGetters;
211
+ auth: TivioAuth;
212
+ hooks: TivioHooks;
213
+ sources: TivioSources;
214
+ subscriptions: TivioSubscriptions;
215
+ purchaseVideoWithQerko: (videoId: string, monetizationId: string, voucher?: {
216
+ expirationDate: Date;
217
+ }) => Promise<QerkoPaymentInfo>;
218
+ purchaseSubscriptionWithQerko: (monetizationId: string, voucher?: {
219
+ expirationDate: Date;
220
+ }) => Promise<QerkoPaymentInfo>;
221
+ cancelSubscriptionWithQerko: (subscriptionId: string) => Promise<QerkoCancellationInfo>;
222
+ /**
223
+ * Set tivio language.
224
+ * @param language
225
+ */
226
+ setLanguage: (language: LangCode) => void;
227
+ setUser: (userId: string | null, userPayload?: UserPayload) => Promise<void>;
228
+ showConsentPreferences: () => void;
229
+ /**
230
+ * Contains hooks and providers for internal usages.
231
+ * They used in our apps, e.g. web, or in sdk-react (e.g. some sdk hooks are just wrappers for core-react-dom hooks)
232
+ * TODO should not be the part of public API
233
+ */
234
+ internal: TivioInternalBundle;
235
+ destroy: () => Promise<void>;
236
+ };
237
+
238
+ /**
239
+ * @public
240
+ */
241
+ export declare type BetOffer = {
242
+ betService: string;
243
+ league: string;
244
+ odds: {
245
+ winner: string;
246
+ rate: number;
247
+ }[];
248
+ sport: string;
249
+ opponent1: string;
250
+ opponent2: string;
251
+ time: Date;
252
+ };
253
+
254
+ /**
255
+ * rejects when bundle is not available
256
+ * @public
257
+ */
258
+ export declare const bundlePromise: Promise<RemoteBundleState>;
259
+
260
+ /**
261
+ * @internal
262
+ */
263
+ export declare type ButtonOptions = {
264
+ backgroundImage: string;
265
+ borderRadius: string | number;
266
+ };
267
+
268
+ /**
269
+ * @public
270
+ */
271
+ export declare type Callback = () => void;
272
+
273
+ /**
274
+ * @public
275
+ */
276
+ export declare interface Channel {
277
+ id: string;
278
+ name: string;
279
+ header: string;
280
+ headerLogo: string;
281
+ recentVideos: Video[];
282
+ }
283
+
284
+ /**
285
+ * @public
286
+ */
287
+ export declare const ChannelsContext: React_2.Context<DataState<Channel>>;
288
+
289
+ /**
290
+ * @public
291
+ */
292
+ export declare type ChannelSource = {
293
+ new (uri: string, originalOptions: Record<string, any>, channelName: string, programName: string, programDescription: string, from: Date, to: Date): ChannelSource;
294
+ description: string;
295
+ name: string;
296
+ uri: string;
297
+ from: Date;
298
+ channelName: string;
299
+ to: Date;
300
+ type: 'channel';
301
+ watchWithoutAdsRecommendation: {
302
+ showPurchaseDialog: () => void;
303
+ } | null;
304
+ };
305
+
306
+ /**
307
+ * @public
308
+ */
309
+ export declare interface ChannelSourcePojo {
310
+ type: 'ChannelSource';
311
+ uri: string;
312
+ originalOptions: any;
313
+ channelName: string;
314
+ programName: string;
315
+ programDescription: string;
316
+ from: Date;
317
+ to: Date;
318
+ poster?: string;
319
+ }
320
+
321
+ /**
322
+ * @public
323
+ */
324
+ export declare type Chapter = any;
325
+
326
+ /**
327
+ * TODO it's the same as Customizations, not?
328
+ * @internal
329
+ */
330
+ export declare type Components = {
331
+ menu: {
332
+ height: number;
333
+ };
334
+ row: {
335
+ paddingLeft: number;
336
+ paddingVertical: number;
337
+ };
338
+ banner: {
339
+ height: number;
340
+ };
341
+ };
342
+
343
+ /**
344
+ * @public
345
+ */
346
+ export declare type Config = Pick<InternalConfig, 'bundleUrlOverride' | 'currency' | 'disableUnmounting' | 'capabilitiesOptions' | 'enable' | 'enableSentry' | 'ErrorComponent' | 'language' | 'LoaderComponent' | 'logger' | 'secret' | 'verbose' | 'forceCloudFnResolver'> & {
347
+ deviceCapabilities: PlayerCapability[] | 'auto';
348
+ /**
349
+ * @private
350
+ * Run HTML, CSS and JS feature support check
351
+ */
352
+ runFeatureSupportCheck?: boolean;
353
+ };
354
+
355
+ /**
356
+ * @public
357
+ * @TODO move somewhere else
358
+ */
359
+ export declare type CoverPadding = {
360
+ top?: number;
361
+ bottom?: number;
362
+ left?: number;
363
+ right?: number;
364
+ };
365
+
366
+ /**
367
+ * @public
368
+ */
369
+ export declare const createPubSub: () => PubSub;
370
+
371
+ /**
372
+ * Fetch & load CommonJS remote module.
373
+ * @public
374
+ */
375
+ export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig) => Promise<TivioBundle>;
376
+
377
+ /**
378
+ * @public
379
+ */
380
+ export declare const createUseRemoteBundle: () => (conf: InternalConfig) => RemoteBundleState;
381
+
382
+ /**
383
+ * @public
384
+ */
385
+ export declare type CreateUserWithEmailAndPassword = (email: string, password: string, username?: string, phoneNumber?: string, referralToken?: string) => Promise<string | null>;
386
+
387
+ /**
388
+ * @public
389
+ */
390
+ export declare const CURRENCIES: string[];
391
+
392
+ /**
393
+ * @public
394
+ */
395
+ export declare type Currency = 'CZK' | 'EUR' | 'USD';
396
+
397
+ /**
398
+ * @public
399
+ */
400
+ export declare enum CUSTOMER_BUILD {
401
+ OKTAGON = "OKTAGON",
402
+ JOJ = "JOJ",
403
+ MALL = "MALL",
404
+ GARAZ = "GARAZ",
405
+ U_KULATEHO_STOLU = "U_KULATEHO_STOLU",
406
+ INVESTOREES = "INVESTOREES"
407
+ }
408
+
409
+ /**
410
+ * @internal
411
+ */
412
+ export declare type Customizations = {
413
+ Tile: TileOptions;
414
+ Button: ButtonOptions;
415
+ Banner: {
416
+ backgroundImage: string;
417
+ /**
418
+ * Height in %
419
+ */
420
+ paddingTop: string;
421
+ /**
422
+ * Width in px
423
+ */
424
+ coverWidth: number;
425
+ fontWeight: string | number;
426
+ };
427
+ Header: {
428
+ backgroundColor: string;
429
+ activeLinkUnderlineColor: string;
430
+ logoHeight: string;
431
+ };
432
+ Input: InputOptions;
433
+ landing: {
434
+ row: {
435
+ backgroundColor: string;
436
+ };
437
+ };
438
+ global: {
439
+ /**
440
+ * Main application background style.
441
+ */
442
+ appBackground: string;
443
+ /**
444
+ * Application background image url - used to replace main gradient
445
+ */
446
+ appBackgroundImageUrl?: string;
447
+ /**
448
+ * Background style of success icon on "/pair" site.
449
+ */
450
+ pairSuccessBackground: string;
451
+ };
452
+ };
453
+
454
+ /**
455
+ * @internal
456
+ */
457
+ export declare interface CustomTheme {
458
+ customizations?: Customizations;
459
+ components: Components;
460
+ size: (size: number) => number;
461
+ }
462
+
463
+ /**
464
+ * @internal
465
+ */
466
+ export declare interface CustomThemeOptions {
467
+ customizations?: Customizations;
468
+ components: Components;
469
+ size: (size: number) => number;
470
+ }
471
+
472
+ declare interface DataState<T> {
473
+ data: {
474
+ [key: string]: HookData<T>;
475
+ };
476
+ setData: (key: string, data: HookData<T>) => void;
477
+ }
478
+
479
+ /**
480
+ * @public
481
+ */
482
+ export declare const DEFAULT_ORDER_BY: {
483
+ field: DefaultOrderByField;
484
+ directionStr: OrderByDirection;
485
+ }[];
486
+
487
+ /**
488
+ * @public
489
+ */
490
+ export declare type DefaultOrderByField = 'created';
491
+
492
+ /**
493
+ * @public
494
+ */
495
+ export declare type DetailedPrice = {
496
+ amount: number;
497
+ currency: Currency;
498
+ frequency?: MONETIZATION_FREQUENCY;
499
+ };
500
+
501
+ /**
502
+ * @public
503
+ */
504
+ export declare type Disposer = () => void;
505
+
506
+ /**
507
+ * @public
508
+ */
509
+ declare type Disposer_2 = () => void;
510
+
511
+ /**
512
+ * @public
513
+ */
514
+ export declare type DividerProps = {
515
+ verticalSpacing?: number;
516
+ horizontalSpacing?: number;
517
+ };
518
+
519
+ /**
520
+ * @public
521
+ */
522
+ export declare type DocumentOptions = Partial<{
523
+ lazyLoading: boolean;
524
+ subscribeOnChanges: boolean;
525
+ }>;
526
+
527
+ /**
528
+ * @public
529
+ */
530
+ export declare type Empty = void | Promise<void> | undefined | Promise<undefined>;
531
+
532
+ /**
533
+ * @public
534
+ */
535
+ export declare type Events = {
536
+ 'on-ready': RemoteBundleState;
537
+ 'on-error': Error;
538
+ };
539
+
540
+ /**
541
+ * @public
542
+ */
543
+ export declare type ExternalTvConfig = {
544
+ logo: string;
545
+ };
546
+
547
+ /**
548
+ * @throws if fetch fails
549
+ * @public
550
+ */
551
+ export declare const fetchBundle: (secret: string, conf: InternalConfig) => Promise<string>;
552
+
553
+ /**
554
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
555
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
556
+ */
557
+ declare type FetchPackage = (url: string) => Promise<string>;
558
+
559
+ /**
560
+ * @public
561
+ */
562
+ export declare interface GenericOnCallError {
563
+ code: string;
564
+ message?: string;
565
+ details?: string[];
566
+ }
567
+
568
+ /**
569
+ * Share singleton instance
570
+ * @public
571
+ */
572
+ export declare const getPubSub: () => PubSub;
573
+
574
+ declare interface HookData<T> {
575
+ data: PaginationData<T> | null;
576
+ error: Error | null;
577
+ isLoading: boolean;
578
+ }
579
+
580
+ /**
581
+ * @public
582
+ */
583
+ export declare interface IndexedObject {
584
+ objectID: string;
585
+ path: string;
586
+ }
587
+
588
+ /**
589
+ * @public
590
+ */
591
+ export declare interface IndexedTag extends IndexedObject {
592
+ tagId: string;
593
+ tagTypePath?: string;
594
+ organizationPath: string;
595
+ created: Date;
596
+ name: Translation;
597
+ description?: string;
598
+ }
599
+
600
+ /**
601
+ * @public
602
+ */
603
+ export declare interface IndexedTvChannel extends IndexedObject {
604
+ channelKey: string;
605
+ created: Date;
606
+ filters: string[];
607
+ name: string;
608
+ organizationPath: string;
609
+ }
610
+
611
+ /**
612
+ * @public
613
+ */
614
+ export declare interface IndexedUser extends IndexedObject {
615
+ authUserId: string;
616
+ type: string;
617
+ externalUserId?: string;
618
+ email?: string;
619
+ organizationPath?: string;
620
+ }
621
+
622
+ /**
623
+ * @public
624
+ */
625
+ export declare interface IndexedVideo extends IndexedObject {
626
+ organizationPath?: string;
627
+ tagPaths?: string[];
628
+ created: Date;
629
+ isDraft: boolean;
630
+ type: VideoType;
631
+ contentType?: VideoContentType;
632
+ name: string;
633
+ description: string;
634
+ hide: boolean;
635
+ isDuplicate: boolean;
636
+ externals?: VideoExternals;
637
+ }
638
+
639
+ /**
640
+ * @internal
641
+ */
642
+ export declare type InputOptions = {
643
+ borderRadius: string;
644
+ };
645
+
646
+ /**
647
+ * @public
648
+ */
649
+ export declare type InputSource = AdSource | ChannelSource | VodTivioSource | VodExternalSource;
650
+
651
+ /**
652
+ * @public
653
+ */
654
+ export declare type InternalConfig = {
655
+ /**
656
+ * @private URL of remote code bundle to be fetched directly (without using resolver)
657
+ */
658
+ bundleUrlOverride?: string;
659
+ /**
660
+ * Tells Tivio which technologies/protocols etc. is the device capable to play.
661
+ * If not provided, Tivio will try to guess it (based on the browser).
662
+ */
663
+ deviceCapabilities: PlayerCapability[];
664
+ /**
665
+ * Additional options for deviceCapabilities
666
+ */
667
+ capabilitiesOptions?: {
668
+ /**
669
+ * Should the player prefer HTTP sources instead HTTPs if they are available.
670
+ * This can be used on platforms that support mixed content but do not support
671
+ * specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
672
+ */
673
+ preferHttp?: boolean;
674
+ };
675
+ secret: string | null;
676
+ language?: LangCode;
677
+ verbose?: boolean;
678
+ currency: Currency;
679
+ disableUnmounting?: boolean;
680
+ enable?: boolean;
681
+ enableSentry?: boolean;
682
+ ErrorComponent?: ComponentType<{
683
+ error: string | null;
684
+ }>;
685
+ fetchPackage: FetchPackage;
686
+ LoaderComponent?: ComponentType;
687
+ logger?: Logger | null;
688
+ pubSub: PubSub;
689
+ /**
690
+ * @private URL of resolver. Resolver is a script used to fetch remove code bundle
691
+ */
692
+ resolverUrl: string;
693
+ sdkVersion: string;
694
+ /**
695
+ * @private
696
+ */
697
+ forceCloudFnResolver?: boolean;
698
+ };
699
+
700
+ /**
701
+ * @public
702
+ */
703
+ export declare type InternalTvConfig = {
704
+ logo: string;
705
+ screens: ScreenConfig[];
706
+ };
707
+
708
+ declare interface IntroMarker {
709
+ marker: Marker;
710
+ skip: () => void;
711
+ }
712
+
713
+ /**
714
+ * @public
715
+ */
716
+ export declare type ItemsInRow = Tag | Video | TvChannel;
717
+
718
+ /**
719
+ * Enum of all supported languages codes as in ISO 639-1
720
+ * @public
721
+ */
722
+ export declare enum LangCode {
723
+ CS = "cs",
724
+ DE = "de",
725
+ EN = "en",
726
+ FR = "fr",
727
+ PL = "pl",
728
+ SK = "sk",
729
+ SP = "sp"
730
+ }
731
+
732
+ /**
733
+ * All supported languages codes as in ISO 639-1
734
+ * @public
735
+ */
736
+ export declare const languages: LangCode[];
737
+
738
+ /**
739
+ * Possible language key of all supported language mutations.
740
+ * @public
741
+ */
742
+ export declare type LanguageType = `${LangCode}`;
743
+
744
+ /**
745
+ * @public
746
+ */
747
+ export declare type LinkedVideo = {
748
+ video: Video;
749
+ type: 'CUT' | 'TRAILER' | 'BONUS' | 'CHILD';
750
+ };
751
+
752
+ declare interface Logger {
753
+ /** important messages */
754
+ warn(...data: LoggerArgs): void;
755
+ /** errors */
756
+ error(...data: LoggerArgs): void;
757
+ /** critical errors */
758
+ exception(...data: LoggerArgs): void;
759
+ /** metrics */
760
+ info(...data: LoggerArgs): void;
761
+ /** non-production messages */
762
+ debug(...data: LoggerArgs): void;
763
+ }
764
+
765
+ /**
766
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
767
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
768
+ */
769
+ declare type LoggerArgs = any[];
770
+
771
+ /**
772
+ * @public
773
+ */
774
+ export declare type Marker = {
775
+ id: string;
776
+ type: string;
777
+ from: Date;
778
+ to: Date;
779
+ count?: number;
780
+ fromMs?: number;
781
+ toMs?: number;
782
+ };
783
+
784
+ /**
785
+ * @public
786
+ */
787
+ export declare interface Monetization {
788
+ id: string;
789
+ price?: string | number;
790
+ type?: MonetizationType;
791
+ frequency?: MONETIZATION_FREQUENCY;
792
+ isPurchased?: boolean;
793
+ name?: string;
794
+ description?: string;
795
+ benefits?: Translation[];
796
+ localizedBenefits?: string[];
797
+ }
798
+
799
+ /**
800
+ * @public
801
+ */
802
+ export declare enum MONETIZATION_FREQUENCY {
803
+ ONE_TIME_PAYMENT = "ONE_TIME_PAYMENT",
804
+ DAILY = "DAILY",
805
+ WEEKLY = "WEEKLY",
806
+ MONTHLY = "MONTHLY",
807
+ ANNUALLY = "ANNUALLY"
808
+ }
809
+
810
+ /**
811
+ * @public
812
+ * @TODO change to enum
813
+ */
814
+ export declare type MonetizationType = 'advertisement' | 'transaction' | 'subscription';
815
+
816
+ /**
817
+ * TODO: Duplicate, because we can't import types from core-js.
818
+ */
819
+ /**
820
+ * @public
821
+ */
822
+ export declare type NewVoucher = {
823
+ expirationDate: Date | number;
824
+ };
825
+
826
+ /**
827
+ * @public
828
+ */
829
+ export declare type Nullable<T> = {
830
+ [P in keyof T]: T[P] | null;
831
+ };
832
+
833
+ /**
834
+ * @public
835
+ */
836
+ export declare type ObjectType = Record<string, any>;
837
+
838
+ /**
839
+ * @public
840
+ */
841
+ export declare interface OrderBy {
842
+ field: string;
843
+ directionStr?: OrderByDirection;
844
+ }
845
+
846
+ declare type OrderByDirection = 'desc' | 'asc';
847
+
848
+ /**
849
+ * @public
850
+ */
851
+ export declare interface Organization {
852
+ }
853
+
854
+ declare type PaginationData<T> = {
855
+ items: T[];
856
+ hasNextPage: boolean;
857
+ fetchMore: Function;
858
+ };
859
+
860
+ /**
861
+ * @public
862
+ */
863
+ export declare type PaginationInterface<Entity> = {
864
+ items: Entity[];
865
+ fetchMore: () => void;
866
+ hasNextPage?: boolean;
867
+ loading?: boolean;
868
+ };
869
+
870
+ /**
871
+ * @public
872
+ */
873
+ export declare type PaginationOptions = Partial<{
874
+ limit: number;
875
+ noLimit: boolean;
876
+ }>;
877
+
878
+ /**
879
+ * @public
880
+ */
881
+ export declare enum PLATFORM {
882
+ MOBILE = "MOBILE",
883
+ WEB = "WEB",
884
+ TV = "TV"
885
+ }
886
+
887
+ /**
888
+ * @public
889
+ */
890
+ export declare interface PlayerCapability {
891
+ codec: 'h264' | 'h265';
892
+ encryption: 'fairplay' | 'none' | 'playready' | 'widevine';
893
+ protocol: 'dash' | 'hls' | 'mp4';
894
+ }
895
+
896
+ /**
897
+ * @public
898
+ */
899
+ export declare interface PlayerInterface {
900
+ pause: () => void;
901
+ /**
902
+ * unpause
903
+ */
904
+ play: () => void;
905
+ /**
906
+ * @param {number} ms - milliseconds relative to start of video (relative to 0 ms)
907
+ * or in case of TV programs relative to start of the program (relative to source.from ms)
908
+ */
909
+ seekTo: (ms: number) => void;
910
+ /**
911
+ * Source to be passed to player.
912
+ *
913
+ * Depending on autoplay settings it should either start playing
914
+ * immediately or just be loaded by player and stay paused.
915
+ */
916
+ setSource: (source: InputSource | null) => void;
917
+ /**
918
+ * volume in [0,1]
919
+ */
920
+ setVolume?: (volume: number) => void;
921
+ mute?: () => void;
922
+ /**
923
+ * restore volume to previous value
924
+ */
925
+ unmute?: () => void;
926
+ }
927
+
928
+ /**
929
+ * @public
930
+ */
931
+ export declare const PlayerProvider: ({ children, playerWrapperId, }: PlayerProviderProps) => FunctionComponentElement<PlayerProviderProps>;
932
+
933
+ /**
934
+ * @public
935
+ */
936
+ export declare type PlayerProviderProps = {
937
+ children: React_2.ReactNode;
938
+ playerWrapperId?: string;
939
+ };
940
+
941
+ declare type PlayerState = 'playing' | 'paused' | 'idle';
942
+
943
+ /**
944
+ * @public
945
+ */
946
+ export declare type PlayerWrapper = {
947
+ /**
948
+ * Report that playback of video has finished
949
+ */
950
+ onPlaybackEnded: () => void;
951
+ /**
952
+ * Report video progress in milliseconds
953
+ */
954
+ onTimeChanged: (ms: number) => void;
955
+ /**
956
+ * Report that video state changed
957
+ */
958
+ onStateChanged: (state: PlayerState) => void;
959
+ /**
960
+ * Send source to Tivio
961
+ */
962
+ onSourceChanged: (source: InputSource | null) => void;
963
+ /**
964
+ * Report that video failed to load (never started playing)
965
+ */
966
+ onLoadError: (error: Error) => void;
967
+ /**
968
+ * Report that video failed during playback (successfully loaded and then failed, e.g. part of stream is invalid)
969
+ */
970
+ onError: (error: Error) => void;
971
+ /**
972
+ * Unpause video
973
+ */
974
+ play: () => void;
975
+ /**
976
+ * Pause video
977
+ */
978
+ pause: () => void;
979
+ /**
980
+ * Currently playing source
981
+ */
982
+ source: InputSource | null;
983
+ events: {
984
+ isSupported: (even: string) => boolean;
985
+ addListener: <T = any>(event: string, cb: (value: T) => Empty) => void;
986
+ removeListener: <T = any>(event: string, cb: (value: T) => Empty) => void;
987
+ removeAllListeners: () => void;
988
+ };
989
+ /**
990
+ * Register a low level player that implements player methods, like play video, change volume, etc.
991
+ */
992
+ register: (playerInterface: PlayerInterface) => void;
993
+ /**
994
+ * duration of current source in ms (both setter and getter)
995
+ */
996
+ durationMs: number | null;
997
+ isPlaybackStarted: boolean;
998
+ isPaused: boolean;
999
+ isPlaying: boolean;
1000
+ isIdle: boolean;
1001
+ error: Error | null;
1002
+ /**
1003
+ * Replay the video that finished playback
1004
+ */
1005
+ replay: () => void;
1006
+ /**
1007
+ * Retry to play a video that failed to start playing (e.g. due to a network error)
1008
+ */
1009
+ retry: () => void;
1010
+ togglePlayPause: () => void;
1011
+ seekTo: (ms: number) => void;
1012
+ /**
1013
+ * set volume to value between 0,1
1014
+ */
1015
+ setVolume: (volume: number) => void;
1016
+ /**
1017
+ * change volume by value between -1,1
1018
+ */
1019
+ changeVolumeBy: (volume: number) => void;
1020
+ setMuted: (muted: boolean) => void;
1021
+ toggleMuted: () => void;
1022
+ };
1023
+
1024
+ /**
1025
+ * @public
1026
+ */
1027
+ export declare interface PubSub {
1028
+ publish: <K extends keyof Events>(triggerName: K, payload: Events[K]) => Empty;
1029
+ subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
1030
+ }
1031
+
1032
+ /**
1033
+ * @public
1034
+ */
1035
+ export declare type Purchase = {
1036
+ id: string;
1037
+ isPurchased: boolean;
1038
+ monetizationRef: any | null;
1039
+ monetization: PurchaseMonetization | null;
1040
+ monetizationId: string | null;
1041
+ type: MonetizationType | null;
1042
+ videoId: string | null;
1043
+ status: PurchaseStatus | null;
1044
+ video: Video | null;
1045
+ videoRef: any | null;
1046
+ expirationDate: Date | null;
1047
+ isExpired: boolean;
1048
+ voucherId?: string;
1049
+ };
1050
+
1051
+ /**
1052
+ * @public
1053
+ */
1054
+ export declare type PurchaseMonetization = {
1055
+ currency?: Currency;
1056
+ period?: number;
1057
+ price?: number;
1058
+ type: MonetizationType;
1059
+ title?: string;
1060
+ frequency?: MONETIZATION_FREQUENCY | null;
1061
+ /**
1062
+ * If set, purchase (subscription) activated by voucher will stay valid for this amount of seconds.
1063
+ * Otherwise, purchase will be valid for one "monetization frequency" period.
1064
+ */
1065
+ voucherPurchaseDuration?: number;
1066
+ };
1067
+
1068
+ /**
1069
+ * @public
1070
+ */
1071
+ export declare enum PurchaseStatus {
1072
+ NEW = "NEW",
1073
+ PAID = "PAID",
1074
+ CANCELLED = "CANCELLED",
1075
+ ERROR = "ERROR",
1076
+ /**
1077
+ * Used when purchase is terminated due to terms and conditions violation (e.g. restreaming).
1078
+ */
1079
+ KILL = "KILL"
1080
+ }
1081
+
1082
+ /**
1083
+ * @public
1084
+ */
1085
+ export declare interface QerkoCancellationInfo {
1086
+ purchaseId: string;
1087
+ status: PurchaseStatus;
1088
+ }
1089
+
1090
+ /**
1091
+ * @public
1092
+ */
1093
+ export declare interface QerkoData {
1094
+ monetization: Monetization;
1095
+ video?: Video;
1096
+ onPurchase?: () => void;
1097
+ onClose?: () => void;
1098
+ }
1099
+
1100
+ /**
1101
+ * @public
1102
+ */
1103
+ export declare interface QerkoOverlayState {
1104
+ data: QerkoData | null;
1105
+ openQerkoOverlay: ((data: QerkoData) => void);
1106
+ closeQerkoOverlay: () => void;
1107
+ }
1108
+
1109
+ /**
1110
+ * @public
1111
+ */
1112
+ export declare interface QerkoPaymentInfo {
1113
+ webPaymentGatewayLink: string;
1114
+ gatewayUri: string;
1115
+ paymentQRCodeUri: string;
1116
+ purchaseId: string;
1117
+ currency: string;
1118
+ amount: number;
1119
+ monetizationType: MonetizationType;
1120
+ recovery?: boolean;
1121
+ monetizationFrequency: MONETIZATION_FREQUENCY;
1122
+ }
1123
+
1124
+ /**
1125
+ * @public
1126
+ */
1127
+ export declare interface QerkoPaymentProps {
1128
+ transaction: QerkoTransaction;
1129
+ qrCodeCaption?: string;
1130
+ renderErrorComponent: () => any;
1131
+ enablePayByCard?: boolean;
1132
+ payByCardCaption?: string;
1133
+ visaLogoUrl?: string;
1134
+ masterCardLogoUrl?: string;
1135
+ }
1136
+
1137
+ /**
1138
+ * @public
1139
+ */
1140
+ export declare interface QerkoTransaction {
1141
+ paymentInfo: QerkoPaymentInfo | null;
1142
+ paymentError: string | null;
1143
+ paymentStatus: string | null;
1144
+ getPaymentInfo: () => Promise<void>;
1145
+ voucherId?: string;
1146
+ }
1147
+
1148
+ /**
1149
+ * @public
1150
+ */
1151
+ export declare type RemoteBundleState = {
1152
+ config: InternalConfig;
1153
+ error: string | null;
1154
+ settings: Settings;
1155
+ state: 'loading' | 'error' | 'ready';
1156
+ } & Nullable<TivioBundle>;
1157
+
1158
+ /**
1159
+ * @public
1160
+ */
1161
+ export declare type RemoteProviderProps = {
1162
+ disableUnmounting?: boolean;
1163
+ language?: string;
1164
+ children: any;
1165
+ };
1166
+
1167
+ /**
1168
+ * @public
1169
+ */
1170
+ export declare interface RouterOverrides {
1171
+ goToVideoDetailPage: (videoId: string) => void;
1172
+ goToSeriesDetailPage: (tagId: string) => void;
1173
+ goToTagPage: (tagId: string) => void;
1174
+ goToLoginScreen: () => void;
1175
+ goBack: () => void;
1176
+ goLivePlayer: (videoId: string) => void;
1177
+ goVodPlayer: (tvChannelId: string) => void;
1178
+ }
1179
+
1180
+ /**
1181
+ * @public
1182
+ */
1183
+ export declare interface RouterOverridesContextState {
1184
+ routerOverrides: RouterOverrides;
1185
+ }
1186
+
1187
+ /**
1188
+ * @public
1189
+ */
1190
+ export declare interface Row {
1191
+ id: string;
1192
+ rowId: string;
1193
+ name: string;
1194
+ description?: string;
1195
+ itemComponent: RowItemComponent;
1196
+ rowComponent: RowComponent;
1197
+ assets: Assets;
1198
+ type: ScreenRowType;
1199
+ isLiveRow: boolean;
1200
+ }
1201
+
1202
+ /**
1203
+ * @public
1204
+ */
1205
+ export declare enum ROW_ITEM_TYPES {
1206
+ VIDEO = "VIDEO",
1207
+ TAG = "TAG",
1208
+ TV_CHANNEL = "TV_CHANNEL"
1209
+ }
1210
+
1211
+ /**
1212
+ * @public
1213
+ */
1214
+ export declare enum RowComponent {
1215
+ ROW = "ROW",
1216
+ BANNER = "BANNER"
1217
+ }
1218
+
1219
+ /**
1220
+ * @public
1221
+ */
1222
+ export declare interface RowItem extends RowItemAssets {
1223
+ itemType: ROW_ITEM_TYPES;
1224
+ name?: string;
1225
+ description?: string;
1226
+ assets: Assets | null;
1227
+ }
1228
+
1229
+ /**
1230
+ * @public
1231
+ */
1232
+ export declare interface RowItemAssets {
1233
+ landscape?: string | null;
1234
+ portrait?: string | null;
1235
+ circled?: string | null;
1236
+ banner?: string | null;
1237
+ }
1238
+
1239
+ /**
1240
+ * @public
1241
+ */
1242
+ export declare enum RowItemComponent {
1243
+ ROW_ITEM_PORTRAIT = "ROW_ITEM_PORTRAIT",
1244
+ ROW_ITEM_LANDSCAPE = "ROW_ITEM_LANDSCAPE",
1245
+ ROW_ITEM_CIRCLED = "ROW_ITEM_CIRCLED"
1246
+ }
1247
+
1248
+ /**
1249
+ * Listen to items in row of a screen
1250
+ * @param rowId - row ID (user defined ID via studio.tiv.io)
1251
+ * @param cb - callback on items changes or error, with information
1252
+ * whether data is loading and a fetchMore function
1253
+ * @param limit - max item count (default 10)
1254
+ * @returns Disposer
1255
+ * @public
1256
+ */
1257
+ export declare type RowItemsSubscription = (rowId: string, cb: (error: Error | null, data: {
1258
+ items: Video[];
1259
+ hasNextPage: boolean;
1260
+ } | null, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => Disposer_2;
1261
+
1262
+ /**
1263
+ * @public
1264
+ */
1265
+ export declare type ScalableAsset = {
1266
+ '@1': Asset;
1267
+ '@2'?: Asset;
1268
+ '@3'?: Asset;
1269
+ };
1270
+
1271
+ /**
1272
+ * @public
1273
+ */
1274
+ export declare type Scale = '@1' | '@2' | '@3';
1275
+
1276
+ /**
1277
+ * @public
1278
+ */
1279
+ declare interface Screen_2 {
1280
+ id: string;
1281
+ name: string;
1282
+ description?: string;
1283
+ assets: Assets;
1284
+ rows: Row[];
1285
+ }
1286
+ export { Screen_2 as Screen }
1287
+
1288
+ /**
1289
+ * @public
1290
+ */
1291
+ export declare type ScreenConfig = {
1292
+ id: string;
1293
+ name: string;
1294
+ };
1295
+
1296
+ /**
1297
+ * @public
1298
+ */
1299
+ export declare type ScreenOptions = Partial<{
1300
+ language: LangCode;
1301
+ initRows: boolean;
1302
+ }> & DocumentOptions;
1303
+
1304
+ /**
1305
+ * @public
1306
+ */
1307
+ export declare type ScreenRowType = 'filter' | 'custom' | 'continueToWatch' | 'favourites';
1308
+
1309
+ /**
1310
+ * Listen to screen data
1311
+ * @param screenId - screen ID (user defined ID via studio.tiv.io)
1312
+ * @param cb - callback on screen data change or error
1313
+ * @returns Disposer
1314
+ * @public
1315
+ */
1316
+ export declare type ScreenSubscription = (screenId: string, cb: (error: Error | null, data: Screen_2 | null) => void) => Disposer_2;
1317
+
1318
+ /**
1319
+ * @public
1320
+ */
1321
+ export declare interface Section {
1322
+ id: string;
1323
+ name: string;
1324
+ channel: Channel;
1325
+ videos: Video[];
1326
+ }
1327
+
1328
+ /**
1329
+ * @public
1330
+ */
1331
+ export declare const SectionsContext: React_2.Context<DataState<Section>>;
1332
+
1333
+ /**
1334
+ * @public
1335
+ */
1336
+ export declare type Settings = {
1337
+ /**
1338
+ * @deprecated TIV-994 in favour of setUser from libs/sdk-react/src/services/login.ts
1339
+ */
1340
+ setUser: (userId: string, userPayload: unknown) => Promise<void>;
1341
+ };
1342
+
1343
+ /**
1344
+ * Used for entities, that can be global (e.g. asset presets, tag types).
1345
+ * Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
1346
+ * Global is stored in separate collection and shown only for super-admin.
1347
+ * @public
1348
+ */
1349
+ export declare interface SettingsItem {
1350
+ name: string;
1351
+ isGlobal?: boolean;
1352
+ }
1353
+
1354
+ /**
1355
+ * Set user to sign in/out.
1356
+ *
1357
+ * Sign in - setUser('userID', { token: 'xxx' })
1358
+ * Sign out - setUser(null)
1359
+ * @public
1360
+ */
1361
+ export declare const setUser: (userId: string | null, payload?: UserPayload | undefined) => Promise<void>;
1362
+
1363
+ /**
1364
+ * @public
1365
+ */
1366
+ export declare const showGdprConsentPreferences: () => Promise<void>;
1367
+
1368
+ /**
1369
+ * @public
1370
+ */
1371
+ export declare type SubscribeToItemsInRow = (rowId: string, cb: (error: Error | null, data: PaginationInterface<ItemsInRow> | null) => void, options?: SubscribeToItemsInRowOptions) => Disposer_2;
1372
+
1373
+ /**
1374
+ * @public
1375
+ */
1376
+ export declare type SubscribeToItemsInRowOptions = Partial<{
1377
+ fetchTags: boolean;
1378
+ }> & PaginationOptions;
1379
+
1380
+ /**
1381
+ * @public
1382
+ */
1383
+ export declare type SubscribeToRowsInScreen = (screenId: string, cb: (error: Error | null, data: PaginationInterface<Row> | null) => void, options?: PaginationOptions) => Disposer_2;
1384
+
1385
+ /**
1386
+ * @public
1387
+ */
1388
+ export declare type SubscribeToScreen = (screenId: string, cb: (error: Error | null, data: Screen_2 | null) => void, options?: ScreenOptions) => Disposer_2;
1389
+
1390
+ /**
1391
+ * @public
1392
+ */
1393
+ export declare type SubscribeToTaggedVideos = (tagIds: string[], cb: (error: Error | null, data: PaginationInterface<Video> | null) => void, options?: SubscribeToTaggedVideosOptions) => Disposer_2;
1394
+
1395
+ /**
1396
+ * @public
1397
+ */
1398
+ export declare type SubscribeToTaggedVideosOptions = SubscribeToItemsInRowOptions & {
1399
+ orderBy?: (Omit<OrderBy, 'field'> & {
1400
+ field: TaggedVideosOrderByField;
1401
+ })[];
1402
+ where?: WhereFilter[];
1403
+ };
1404
+
1405
+ /**
1406
+ * @public
1407
+ */
1408
+ export declare interface SubscriptionCardProps {
1409
+ subscription: Monetization;
1410
+ onClick: (subscription: Monetization) => void;
1411
+ buttonLabel: string;
1412
+ purchased: boolean;
1413
+ focused?: boolean;
1414
+ }
1415
+
1416
+ declare type SubscriptionInfo = {
1417
+ type: 'subscription';
1418
+ name: string;
1419
+ benefits: string[];
1420
+ frequency: string;
1421
+ };
1422
+
1423
+ /**
1424
+ * @public
1425
+ */
1426
+ export declare interface SubscriptionOverlayData {
1427
+ subscriptions?: Monetization[];
1428
+ onPurchase?: () => void;
1429
+ onClose?: () => void;
1430
+ }
1431
+
1432
+ /**
1433
+ * @public
1434
+ */
1435
+ export declare type SubscriptionOverlayState = {
1436
+ data: SubscriptionOverlayData | null;
1437
+ closeSubscriptionOverlay: () => void;
1438
+ openSubscriptionOverlay: (data: SubscriptionOverlayData) => void;
1439
+ };
1440
+
1441
+ /**
1442
+ * @public
1443
+ */
1444
+ export declare interface Tag extends RowItem {
1445
+ id: string;
1446
+ tagId: string;
1447
+ type?: string | null;
1448
+ metadata?: any[];
1449
+ color?: string;
1450
+ detailBanner?: string;
1451
+ availableSeasons?: AvailableSeason[];
1452
+ isFavorite: boolean;
1453
+ addToFavorites: () => void;
1454
+ removeFromFavorites: () => void;
1455
+ }
1456
+
1457
+ /**
1458
+ * @public
1459
+ */
1460
+ export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
1461
+
1462
+ /**
1463
+ * @internal
1464
+ */
1465
+ export declare type TileOptions = {
1466
+ focusedShadow: boolean;
1467
+ focusedShadowColor?: string;
1468
+ borderColor: string;
1469
+ innerLabel: {
1470
+ /**
1471
+ * Font size in px
1472
+ */
1473
+ fontSize: number;
1474
+ };
1475
+ bottomLabel: {
1476
+ opacity: string | number;
1477
+ fontWeight: string;
1478
+ };
1479
+ };
1480
+
1481
+ /**
1482
+ * @public
1483
+ */
1484
+ export declare type TileProps = {
1485
+ cover: string;
1486
+ isLoading: boolean;
1487
+ bottomLabel: string;
1488
+ bottomLabelAreaHeight: number;
1489
+ innerLabel: string;
1490
+ duration: string;
1491
+ price: string | null;
1492
+ focused: boolean;
1493
+ onClick?: () => void;
1494
+ hoverable: boolean;
1495
+ overlay: boolean;
1496
+ coverPadding: CoverPadding;
1497
+ variant: RowItemComponent;
1498
+ coverWidth: number;
1499
+ progress?: number;
1500
+ time?: string;
1501
+ logo?: string;
1502
+ coverHeight: number;
1503
+ /**
1504
+ * Margin of inner TileContainer.
1505
+ * Now used for backward compatibility for WebTileGrid. Consider to use it other way.
1506
+ */
1507
+ containerMargin?: number | string;
1508
+ };
1509
+
1510
+ /**
1511
+ * @public
1512
+ */
1513
+ export declare type TilePropsPartial = Partial<TileProps>;
1514
+
1515
+ /**
1516
+ * @public
1517
+ */
1518
+ export declare interface TivioAuth {
1519
+ changePassword: (newPassword: string) => Promise<void>;
1520
+ changeUserPhoto(file: any): Promise<void>;
1521
+ removeUserPhoto(): Promise<void>;
1522
+ getPurchasedVodsWithInitializedVideos: () => Promise<Purchase[]>;
1523
+ /**
1524
+ * @param email
1525
+ * @param password
1526
+ */
1527
+ createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
1528
+ /**
1529
+ * Sign in the user and starts listening on his purchases
1530
+ * @param email
1531
+ * @param password
1532
+ */
1533
+ signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
1534
+ initializeUser: () => Promise<void>;
1535
+ signOut: () => Promise<void>;
1536
+ /**
1537
+ * Used for reset forgotten password by user
1538
+ */
1539
+ resetPassword: (email: string) => Promise<void>;
1540
+ createFreePurchase: (monetizationId: string) => Promise<void>;
1541
+ }
1542
+
1543
+ /**
1544
+ * @public
1545
+ */
1546
+ export declare type TivioBundle = BasicTivioBundle & {
1547
+ init: (config: Config) => void | Promise<void>;
1548
+ };
1549
+
1550
+ /**
1551
+ * @public
1552
+ */
1553
+ export declare type TivioBundleFile = {
1554
+ Tivio: TivioBundle;
1555
+ };
1556
+
1557
+ /**
1558
+ * @public
1559
+ */
1560
+ export declare type TivioComponents = {
1561
+ Markers: React_2.ReactNode;
1562
+ PlayerDataContext: React_2.ReactNode;
1563
+ Provider: React_2.ComponentType<RemoteProviderProps>;
1564
+ /**
1565
+ * @deprecated will be removed in in @tivio/sdk-react@4
1566
+ */
1567
+ VideoAdBanner: React_2.ReactNode;
1568
+ WebPlayer: React_2.ComponentType<WebPlayerProps>;
1569
+ Widget: React_2.ComponentType<TivioWidgetProps>;
1570
+ PlayerDataContextProvider: React_2.ComponentType<{
1571
+ id: string;
1572
+ }>;
1573
+ SkipButtonTv: React_2.ComponentType<{
1574
+ Button: React_2.ComponentType;
1575
+ Label: React_2.ComponentType;
1576
+ Container: React_2.ComponentType;
1577
+ onStarted?: () => any;
1578
+ onEnded?: () => any;
1579
+ }>;
1580
+ TvApp: React_2.ComponentType<TvAppProps>;
1581
+ FeatureSupportCheck: React_2.ComponentType<{}>;
1582
+ CustomerScreen: React_2.ComponentType<{
1583
+ screenId: string;
1584
+ }>;
1585
+ WebTagScreen: React_2.ComponentType<{
1586
+ tagId: string;
1587
+ onError?: (error: Error) => void;
1588
+ }>;
1589
+ WebSearchScreen: React_2.ComponentType<{
1590
+ searchQuery?: string;
1591
+ }>;
1592
+ WebRow: React_2.ComponentType<WebRowProps>;
1593
+ WebTile: React_2.ComponentType<{
1594
+ item?: ItemsInRow;
1595
+ } & TilePropsPartial>;
1596
+ AdIndicationButtonWeb: React_2.ReactNode;
1597
+ Recommendation: React_2.ReactNode;
1598
+ SkipButtonWeb: React_2.ReactNode;
1599
+ TvPlayer: React_2.ComponentType<WebPlayerProps>;
1600
+ };
1601
+
1602
+ /**
1603
+ * @public
1604
+ */
1605
+ export declare const TivioContext: React_2.Context<RemoteBundleState | null>;
1606
+
1607
+ /**
1608
+ * @public
1609
+ */
1610
+ export declare type TivioGetters = {
1611
+ isTivioLoaded: (cb: (isLoaded: boolean) => void) => void;
1612
+ isSignedIn: () => boolean;
1613
+ /**
1614
+ * @deprecated is here only for backward compatibility
1615
+ */
1616
+ getExportedConfig: () => Promise<{
1617
+ showMarkers: true;
1618
+ }>;
1619
+ /**
1620
+ * Get channel by its id.
1621
+ * @param channelId - channel id
1622
+ * @returns {Promise<Channel | null>} channel or null if channel does not exists
1623
+ */
1624
+ getChannelById: (channelId: string) => Promise<Channel | null>;
1625
+ /**
1626
+ * Get (or create) player wrapper instance
1627
+ * @param opt - player getter options
1628
+ * @returns {PlayerWrapper} player wrapper instance
1629
+ */
1630
+ getPlayerWrapper: (opt: {
1631
+ playerWrapperId?: string;
1632
+ }) => any;
1633
+ getOrganizationSubscriptions: () => Promise<Monetization[] | undefined>;
1634
+ /**
1635
+ * Get section by its id.
1636
+ * @param sectionId - section id
1637
+ * @returns {Promise<{section: Section, channel: Channel} | null>} section and channel or null if channel or section does not exists
1638
+ */
1639
+ getSectionById: (sectionId: string) => Promise<Section | null>;
1640
+ /**
1641
+ * Get video by its id.
1642
+ * @param videoId - video id
1643
+ * @returns {Promise<Video | null>} video or null if video does not exists
1644
+ */
1645
+ getVideoById: (videoId: string) => Promise<Video | null>;
1646
+ /**
1647
+ * Get widget by its id.
1648
+ * @param widgetId - widget id
1649
+ * @returns {Promise<Widget | null>} widget or null if widget does not exists
1650
+ */
1651
+ getWidgetById: (widgetId: string) => Promise<Widget | null>;
1652
+ /**
1653
+ * Get player capabilities based on user's browser and OS as resolved by Tivio.
1654
+ * @returns PlayerCapability[]
1655
+ */
1656
+ getPlayerCapabilities: () => PlayerCapability[];
1657
+ };
1658
+
1659
+ /**
1660
+ * @public
1661
+ */
1662
+ export declare type TivioHooks = {
1663
+ useAd: () => [(AdSource | null)];
1664
+ useAdSegment: () => AdSegment | null;
1665
+ useCancelSubscription: UseCancelSubscription;
1666
+ useItemsInRow: (rowId: string, options: PaginationOptions) => {
1667
+ pagination: PaginationInterface<ItemsInRow> | null;
1668
+ error: Error | null;
1669
+ };
1670
+ usePurchaseRecovery: () => {
1671
+ purchaseRecoveryResult?: string;
1672
+ loading: boolean;
1673
+ error?: GenericOnCallError;
1674
+ purchaseRecovery: (monetizationId: string) => void;
1675
+ };
1676
+ useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
1677
+ usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
1678
+ useRowsInScreen: (screenId: string, options: PaginationOptions) => {
1679
+ pagination: PaginationInterface<Row> | null;
1680
+ error: Error | null;
1681
+ };
1682
+ useTaggedVideos: (tagIds: string[], options: SubscribeToItemsInRowOptions) => {
1683
+ pagination: PaginationInterface<Video> | null;
1684
+ error: Error | null;
1685
+ };
1686
+ useSearch: UseSearch;
1687
+ useVideo: (videoId: string) => {
1688
+ data: Video | null;
1689
+ error: string | null;
1690
+ };
1691
+ useVoucher: (voucherId: string) => any;
1692
+ /**
1693
+ * @deprecated will be removed in version
1694
+ */
1695
+ useLastVideoByWidgetId: (widgetId: string) => Video | null;
1696
+ useWatchWithoutAdsOffer: () => {
1697
+ canPurchaseWatchWithoutAds: boolean;
1698
+ showPurchaseDialog: () => void;
1699
+ };
1700
+ useApplyInviteCode: () => {
1701
+ applyInviteCodeResult?: boolean;
1702
+ loading: boolean;
1703
+ error?: GenericOnCallError;
1704
+ applyInviteCode: (code: string) => void;
1705
+ inviteCodeReset: () => void;
1706
+ };
1707
+ };
1708
+
1709
+ /**
1710
+ * @public
1711
+ */
1712
+ export declare type TivioInternalBundle = {
1713
+ components: TivioInternalComponents;
1714
+ hooks: TivioInternalHooks;
1715
+ providers: TivioInternalProviders;
1716
+ };
1717
+
1718
+ /**
1719
+ * @public
1720
+ */
1721
+ export declare type TivioInternalComponents = {
1722
+ PrimaryButton: React_2.ComponentType;
1723
+ WebLandingScreen: React_2.ComponentType<{
1724
+ logo?: string;
1725
+ }>;
1726
+ WebVideoScreen: React_2.ComponentType<{
1727
+ videoId: string;
1728
+ }>;
1729
+ WebSeriesDetailScreen: React_2.ComponentType<WebSeriesDetailScreenProps>;
1730
+ };
1731
+
1732
+ /**
1733
+ * @public
1734
+ */
1735
+ export declare type TivioInternalHooks = {
1736
+ useAuthOverlay: () => AuthOverlayState;
1737
+ useSubscriptionsOverlay: () => SubscriptionOverlayState;
1738
+ useQerkoOverlay: () => QerkoOverlayState;
1739
+ usePurchasesWithVideos: () => {
1740
+ purchases: Purchase[];
1741
+ };
1742
+ useOrganizationSubscriptions: () => {
1743
+ subscriptions: Monetization[];
1744
+ };
1745
+ useIsMonetizationPurchased: () => {
1746
+ isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
1747
+ };
1748
+ useReferralInfo: any;
1749
+ useTvChannel: UseTvChannel;
1750
+ useChannelSource: UseChannelSource;
1751
+ useUser: () => {
1752
+ user: User | null;
1753
+ error: string | null;
1754
+ isInitialized: boolean;
1755
+ };
1756
+ };
1757
+
1758
+ /**
1759
+ * @public
1760
+ */
1761
+ export declare type TivioInternalProviders = {
1762
+ AppThemeProvider: React_2.ComponentType;
1763
+ AuthOverlayContextProvider: React_2.ComponentType;
1764
+ CustomerProvider: React_2.ComponentType<{
1765
+ customer: CUSTOMER_BUILD;
1766
+ platform: PLATFORM;
1767
+ children: any;
1768
+ }>;
1769
+ ConfigProvider: React_2.ComponentType;
1770
+ UserContextProvider: React_2.ComponentType;
1771
+ SubscriptionOverlayContextProvider: React_2.ComponentType;
1772
+ QerkoOverlayContextProvider: React_2.ComponentType;
1773
+ PurchasesWithVideosContextProvider: React_2.ComponentType;
1774
+ OrganizationSubscriptionsContextProvider: React_2.ComponentType;
1775
+ RouterOverridesContextProvider: React_2.ComponentType<RouterOverridesContextState>;
1776
+ };
1777
+
1778
+ /**
1779
+ * @public
1780
+ */
1781
+ export declare const TivioProvider: React_2.FC<TivioProviderProps>;
1782
+
1783
+ /**
1784
+ * @public
1785
+ */
1786
+ export declare type TivioProviderProps = {
1787
+ /**
1788
+ * This prop must be set only once and not change value afterwards
1789
+ */
1790
+ conf: Config | undefined | null;
1791
+ children: React_2.ReactNode;
1792
+ };
1793
+
1794
+ /**
1795
+ * @public
1796
+ */
1797
+ export declare type TivioSources = {
1798
+ AdSource: any;
1799
+ ChannelSource: any;
1800
+ VodExternalSource: any;
1801
+ VodTivioSource: any;
1802
+ };
1803
+
1804
+ /**
1805
+ * @public
1806
+ */
1807
+ export declare type TivioSubscriptions = {
1808
+ subscribeToUser: (cb: (error: string | null, user: User | null) => void) => void;
1809
+ /**
1810
+ * Listen to widget changes.
1811
+ * @param widgetId - widget id
1812
+ * @param cb - callback on widget updates or on error
1813
+ */
1814
+ subscribeToWidget: (widgetId: string, cb: (error: Error | null, data: Widget | null, disposer?: Disposer_2) => void) => void;
1815
+ /**
1816
+ * Listen to channel changes.
1817
+ * @param channelId - channel id
1818
+ * @param cb - callback on channel updates or on error
1819
+ */
1820
+ subscribeToChannel: (channelId: string, cb: (error: Error | null, data: Channel | null) => void) => void;
1821
+ /**
1822
+ * Listen to section changes.
1823
+ * @param sectionId - section id
1824
+ * @param cb - callback on section updates or on error
1825
+ */
1826
+ subscribeToSection: (sectionId: string, cb: (error: Error | null, data: Section | null) => void) => void;
1827
+ /**
1828
+ * Listen to video changes.
1829
+ * @param videoId - video id
1830
+ * @param cb - callback on video updates or on error
1831
+ */
1832
+ subscribeToVideo: (videoId: string, cb: (error: Error | null, data: Video | null, disposer?: Disposer_2) => void) => void;
1833
+ /**
1834
+ * Listen to videos in section changes.
1835
+ * @param sectionId - section id
1836
+ * @param cb - callback on videos change or error
1837
+ * @param limit - videos count
1838
+ */
1839
+ subscribeToVideosInSection: (sectionId: string, cb: (error: null | Error, data: null | {
1840
+ videos: Video[];
1841
+ hasNextPage: boolean;
1842
+ }, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
1843
+ /**
1844
+ * Listen to section in channel changes
1845
+ * @param channelId - channel id
1846
+ * @param cb - callback on sections change or error
1847
+ * @param limit - sections count
1848
+ */
1849
+ subscribeToSectionsInChannel: (channelId: string, cb: (error: null | Error, data: null | {
1850
+ sections: Section[];
1851
+ hasNextPage: boolean;
1852
+ }, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
1853
+ /**
1854
+ * Listen to channels in widget changes
1855
+ * @param widgetId - widget id
1856
+ * @param cb - callback on channels change or error
1857
+ * @param limit - channels count
1858
+ */
1859
+ subscribeToChannelsInWidget: (widgetId: string, cb: (error: null | Error, data: null | {
1860
+ channels: Channel[];
1861
+ hasNextPage: boolean;
1862
+ }, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
1863
+ subscribeToScreen: SubscribeToScreen;
1864
+ subscribeToItemsInRow: SubscribeToItemsInRow;
1865
+ subscribeToRowsInScreen: SubscribeToRowsInScreen;
1866
+ subscribeToTaggedVideos: SubscribeToTaggedVideos;
1867
+ registerOverlayCallbacks: (callbacks: {
1868
+ onShow: () => void;
1869
+ onHide: () => void;
1870
+ }) => void;
1871
+ };
1872
+
1873
+ /**
1874
+ * @public
1875
+ */
1876
+ export declare const TivioWidget: React_2.ForwardRefExoticComponent<Pick<TivioWidgetProps, "id" | "onEnabled" | "onBlur"> & React_2.RefAttributes<TivioWidgetRef>>;
1877
+
1878
+ /**
1879
+ * @public
1880
+ */
1881
+ export declare const TivioWidgetError: React_2.FC<TivioWidgetErrorProps>;
1882
+
1883
+ declare type TivioWidgetErrorProps = {
1884
+ error: string | null;
1885
+ };
1886
+
1887
+ /**
1888
+ * @public
1889
+ */
1890
+ export declare const TivioWidgetLoader: React_2.FC;
1891
+
1892
+ /**
1893
+ * @public
1894
+ */
1895
+ export declare interface TivioWidgetProps {
1896
+ id: string;
1897
+ ref: React_2.MutableRefObject<TivioWidgetRef>;
1898
+ onEnabled?: (enabled: boolean) => any;
1899
+ onBlur?: (event: {
1900
+ key: string;
1901
+ width: number;
1902
+ x: number;
1903
+ }) => any;
1904
+ }
1905
+
1906
+ /**
1907
+ * @public
1908
+ */
1909
+ export declare interface TivioWidgetRef {
1910
+ focus: (args: {
1911
+ x?: number;
1912
+ }) => void;
1913
+ handleKey: (key: string) => ({
1914
+ handled: boolean;
1915
+ x: number;
1916
+ });
1917
+ unfocus: () => ({
1918
+ x: number;
1919
+ });
1920
+ }
1921
+
1922
+ declare type TransactionInfo = {
1923
+ type: 'transaction';
1924
+ name: string;
1925
+ videoId: string;
1926
+ cover: string;
1927
+ description: string;
1928
+ };
1929
+
1930
+ /**
1931
+ * Represents one string in every supported language mutation.
1932
+ * @public
1933
+ */
1934
+ export declare type Translation = {
1935
+ [key in LangCode]: string;
1936
+ };
1937
+
1938
+ /**
1939
+ * @public
1940
+ */
1941
+ export declare type TvAppProps = {
1942
+ customer: CUSTOMER_BUILD;
1943
+ };
1944
+
1945
+ /**
1946
+ * @public
1947
+ */
1948
+ export declare interface TvChannel extends RowItem {
1949
+ name: string;
1950
+ id: string;
1951
+ path: string;
1952
+ itemType: ROW_ITEM_TYPES;
1953
+ country?: string;
1954
+ filters: string[];
1955
+ logo?: string;
1956
+ hls: string;
1957
+ dash: string;
1958
+ purchasableMonetization: any | null;
1959
+ price: number;
1960
+ }
1961
+
1962
+ /**
1963
+ * @public
1964
+ */
1965
+ export declare const TvTivioProvider: React_2.FC<TivioProviderProps>;
1966
+
1967
+ /**
1968
+ * @public
1969
+ */
1970
+ export declare const useAd: () => AdSource | null;
1971
+
1972
+ /**
1973
+ * @public
1974
+ */
1975
+ export declare const useAdSegment: () => {
1976
+ id: string;
1977
+ remainingMs: number;
1978
+ secondsToEnd: number;
1979
+ secondsToSkippable: number | null;
1980
+ canSeek: boolean;
1981
+ canSkip: boolean;
1982
+ isSkippable: boolean;
1983
+ skip: () => any;
1984
+ } | null;
1985
+
1986
+ /**
1987
+ * Is used to login user through different device in which user is already logged in.
1988
+ * (e.g. login in tv app through web app)
1989
+ *
1990
+ * @return applyInviteCodeResult - true if code was applied successfully, false otherwise.
1991
+ * loading - loading state
1992
+ * error - error in case request failure
1993
+ * applyInviteCode - function to apply invite code
1994
+ * inviteCodeReset - function to reset to initial state
1995
+ * @public
1996
+ */
1997
+ export declare function useApplyInviteCode(): {
1998
+ applyInviteCodeResult?: boolean | undefined;
1999
+ loading: boolean;
2000
+ error?: GenericOnCallError | undefined;
2001
+ applyInviteCode: (code: string) => void;
2002
+ inviteCodeReset: () => void;
2003
+ };
2004
+
2005
+ /**
2006
+ * @public
2007
+ */
2008
+ export declare const useBetOffer: () => BetOffer | null;
2009
+
2010
+ /**
2011
+ * @public
2012
+ */
2013
+ export declare type UseCancelSubscription = (subscriptionId: string) => {
2014
+ cancelSubscription: () => Promise<void>;
2015
+ cancellationInfo: QerkoCancellationInfo | null;
2016
+ error?: string | null;
2017
+ };
2018
+
2019
+ /**
2020
+ * @public
2021
+ */
2022
+ export declare const useCancelSubscription: UseCancelSubscription;
2023
+
2024
+ /**
2025
+ * Use channel
2026
+ * @param channelId - channel id
2027
+ * @public
2028
+ */
2029
+ export declare const useChannel: (channelId: string) => {
2030
+ error: string | null;
2031
+ data: Channel | null;
2032
+ };
2033
+
2034
+ /**
2035
+ * Use channels in widget
2036
+ * @param widgetId - widget id
2037
+ * @param [limit] - channels count, defaults to 10
2038
+ * @public
2039
+ */
2040
+ export declare const useChannelsInWidget: (widgetId: string, limit?: number) => {
2041
+ error: Error | null;
2042
+ data: PaginationData<Channel> | null;
2043
+ isLoading: boolean;
2044
+ };
2045
+
2046
+ /**
2047
+ * @public
2048
+ */
2049
+ export declare type UseChannelSource = (tvChannelId: string) => {
2050
+ source: ChannelSourcePojo | null;
2051
+ error: Error | null;
2052
+ };
2053
+
2054
+ /**
2055
+ * @public
2056
+ */
2057
+ export declare const useCurrentMarker: () => Marker | null;
2058
+
2059
+ /**
2060
+ * @public
2061
+ */
2062
+ export declare const useFreePurchase: () => {
2063
+ purchase: (monetizationId: string) => Promise<void>;
2064
+ };
2065
+
2066
+ /**
2067
+ * @public
2068
+ */
2069
+ export declare const useIntro: () => IntroMarker | null;
2070
+
2071
+ /**
2072
+ * @public
2073
+ */
2074
+ export declare const useIsLoaded: () => {
2075
+ isTivioLoaded: boolean;
2076
+ };
2077
+
2078
+ /**
2079
+ * @public
2080
+ */
2081
+ export declare const useIsMonetizationPurchased: () => {
2082
+ isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
2083
+ };
2084
+
2085
+ /**
2086
+ * Use row items
2087
+ * @param rowId - row ID
2088
+ * @param options - subscription options
2089
+ * @public
2090
+ */
2091
+ export declare const useItemsInRow: (rowId: string, options?: SubscribeToItemsInRowOptions) => {
2092
+ pagination: PaginationInterface<ItemsInRow> | null;
2093
+ error: Error | null;
2094
+ };
2095
+
2096
+ /**
2097
+ * @deprecated will be removed in v4
2098
+ * @public
2099
+ */
2100
+ export declare function useLastVideoByWidgetId(widgetId: string): Video | null;
2101
+
2102
+ /**
2103
+ * @public
2104
+ */
2105
+ export declare const useMarkers: () => Marker[] | null;
2106
+
2107
+ /**
2108
+ * @public
2109
+ */
2110
+ export declare const useOrganizationSubscriptions: () => {
2111
+ subscriptions: Monetization[];
2112
+ };
2113
+
2114
+ /**
2115
+ * @public
2116
+ */
2117
+ export declare type UsePlayerEvent = <T = any>(eventName: string) => T | null;
2118
+
2119
+ /**
2120
+ * @public
2121
+ */
2122
+ export declare const usePlayerEvent: UsePlayerEvent;
2123
+
2124
+ /**
2125
+ * Is used to mark purchase in recovery state as PAID.
2126
+ *
2127
+ * @return purchaseRecoveryResult - message describing result of the recovery
2128
+ * loading - loading state
2129
+ * error - error in case request failure
2130
+ * purchaseRecovery - functions to execute purchase recovery
2131
+ * @public
2132
+ */
2133
+ export declare function usePurchaseRecovery(): {
2134
+ purchaseRecoveryResult?: string | undefined;
2135
+ loading: boolean;
2136
+ error?: GenericOnCallError | undefined;
2137
+ purchaseRecovery: (monetizationId: string) => void;
2138
+ };
2139
+
2140
+ /**
2141
+ * @public
2142
+ */
2143
+ export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
2144
+
2145
+ /**
2146
+ * Return purchases with initialized video (purchases[i].video not null)
2147
+ * @public
2148
+ */
2149
+ export declare const usePurchasesWithVideos: () => {
2150
+ purchases: Purchase[];
2151
+ };
2152
+
2153
+ /**
2154
+ * @public
2155
+ */
2156
+ export declare type User = {
2157
+ purchases: Purchase[];
2158
+ allPurchases: Purchase[];
2159
+ purchasedVods: Purchase[];
2160
+ purchasedSubscriptions: Purchase[];
2161
+ isPurchasesInitialized: boolean;
2162
+ isSignedIn: boolean;
2163
+ email?: string;
2164
+ type?: UserType;
2165
+ photoURL: string | null;
2166
+ name?: string;
2167
+ authUserId?: string;
2168
+ favorites: any[];
2169
+ watchedPositions: any[];
2170
+ };
2171
+
2172
+ /**
2173
+ * @public
2174
+ */
2175
+ export declare const useRowsInScreen: (screenId: string, options?: PaginationOptions) => {
2176
+ pagination: PaginationInterface<Row> | null;
2177
+ error: Error | null;
2178
+ };
2179
+
2180
+ /**
2181
+ * @public
2182
+ */
2183
+ export declare type UserPayload = Record<string, any>;
2184
+
2185
+ /**
2186
+ * @public
2187
+ */
2188
+ export declare enum UserType {
2189
+ ORGANIZATION_USER = "ORGANIZATION_USER",
2190
+ TIVIO_USER = "TIVIO_USER"
2191
+ }
2192
+
2193
+ /**
2194
+ * @deprecated
2195
+ *
2196
+ * Use app screen
2197
+ * @param screenId - screen ID
2198
+ * @param options - subscribe to screen options
2199
+ * @public
2200
+ */
2201
+ export declare const useScreen: (screenId: string, options?: ScreenOptions | undefined) => never;
2202
+
2203
+ /**
2204
+ * @public
2205
+ */
2206
+ export declare type UseSearch = <T extends ALGOLIA_INDEX_NAME>(indexName: T, options?: UseSearchOptions) => {
2207
+ search: (query: string) => void;
2208
+ pagination: PaginationInterface<UseSearchResult<T>> | null;
2209
+ error: Error | null;
2210
+ isLoading: boolean;
2211
+ lastQuery: string;
2212
+ };
2213
+
2214
+ /**
2215
+ * Full text search that returns entities based on search query.
2216
+ * @param indexName - index that search would be performed on ('videos', 'tags', etc.)
2217
+ * @param options - pagination options
2218
+ * @public
2219
+ */
2220
+ export declare const useSearch: UseSearch;
2221
+
2222
+ /**
2223
+ * @public
2224
+ */
2225
+ export declare type UseSearchOptions = PaginationOptions & Partial<{
2226
+ minQueryLength: number;
2227
+ }>;
2228
+
2229
+ /**
2230
+ * @public
2231
+ */
2232
+ export declare type UseSearchResult<T extends ALGOLIA_INDEX_NAME> = T extends ALGOLIA_INDEX_NAME.VIDEOS ? Video : T extends ALGOLIA_INDEX_NAME.TAGS ? Tag : T extends ALGOLIA_INDEX_NAME.TV_CHANNELS ? TvChannel : unknown;
2233
+
2234
+ /**
2235
+ * Use section
2236
+ * @param sectionId - section id
2237
+ * @public
2238
+ */
2239
+ export declare const useSection: (sectionId: string) => {
2240
+ error: string | null;
2241
+ data: Section | null;
2242
+ };
2243
+
2244
+ /**
2245
+ * Use section in channel
2246
+ * @param channelId - channel id
2247
+ * @param [limit] - sections count, defaults to 10
2248
+ * @public
2249
+ */
2250
+ export declare const useSectionsInChannel: (channelId: string, limit?: number) => {
2251
+ error: Error | null;
2252
+ data: PaginationData<Section> | null;
2253
+ isLoading: boolean;
2254
+ };
2255
+
2256
+ /**
2257
+ * @public
2258
+ */
2259
+ export declare const useSeekState: () => boolean | null;
2260
+
2261
+ /**
2262
+ * Returns videos with given tag ids
2263
+ * @param tagIds - tag ids
2264
+ * @param options - subscription options
2265
+ * @public
2266
+ */
2267
+ export declare const useTaggedVideos: (tagIds: string[], options?: SubscribeToItemsInRowOptions) => {
2268
+ pagination: PaginationInterface<Video> | null;
2269
+ error: Error | null;
2270
+ };
2271
+
2272
+ /**
2273
+ * @public
2274
+ */
2275
+ export declare const useTivioData: () => RemoteBundleState;
2276
+
2277
+ /**
2278
+ * @public
2279
+ */
2280
+ export declare const useTivioReadyData: () => RemoteBundleState | null;
2281
+
2282
+ /**
2283
+ * @public
2284
+ */
2285
+ export declare const useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
2286
+
2287
+ /**
2288
+ * @public
2289
+ */
2290
+ export declare type UseTvChannel = (tvChannelId: string) => {
2291
+ tvChannel: TvChannel | null;
2292
+ error: Error | null;
2293
+ loading: boolean;
2294
+ };
2295
+
2296
+ /**
2297
+ * @public
2298
+ */
2299
+ export declare const useUser: () => {
2300
+ user: User | null;
2301
+ error: string | null;
2302
+ isInitialized: boolean;
2303
+ };
2304
+
2305
+ /**
2306
+ * Use video
2307
+ * @param videoId - video id
2308
+ * @public
2309
+ */
2310
+ export declare const useVideo: (videoId?: string | undefined) => {
2311
+ data: Video | null;
2312
+ error: string | null;
2313
+ };
2314
+
2315
+ /**
2316
+ * Use videos in section
2317
+ * @param sectionId - section id
2318
+ * @param [limit] - videos count, defaults to 10
2319
+ * @public
2320
+ */
2321
+ export declare const useVideosInSection: (sectionId?: string | undefined, limit?: number) => {
2322
+ error: Error | null;
2323
+ data: PaginationData<Video> | null;
2324
+ isLoading: boolean;
2325
+ };
2326
+
2327
+ /**
2328
+ * @public
2329
+ */
2330
+ export declare const useVoucher: (voucherId: string) => {
2331
+ activate: (() => Promise<void>) | null;
2332
+ voucher: Voucher | null;
2333
+ /**
2334
+ * You can check error.details if you need to know error type when you want your own error messages
2335
+ * (can be one of "DOES_NOT_EXIST", "EXPIRED" and "ALREADY_USED").
2336
+ */
2337
+ error: Error | BadRequestError | null;
2338
+ /**
2339
+ * True if voucher has been successfully activated in current session.
2340
+ */
2341
+ activationSuccess: boolean;
2342
+ };
2343
+
2344
+ /**
2345
+ * @public
2346
+ */
2347
+ export declare const useWatchWithoutAdsOffer: () => {
2348
+ canPurchaseWatchWithoutAds: boolean;
2349
+ showPurchaseDialog: () => void;
2350
+ };
2351
+
2352
+ /**
2353
+ * Use widget
2354
+ * @param widgetId - widget id
2355
+ * @public
2356
+ */
2357
+ export declare const useWidget: (widgetId: string) => {
2358
+ error: string;
2359
+ widget: Widget | null;
2360
+ };
2361
+
2362
+ /**
2363
+ * @public
2364
+ */
2365
+ export declare const VAST_PROVIDERS: ({
2366
+ id: VastProvider;
2367
+ name: string;
2368
+ development?: undefined;
2369
+ } | {
2370
+ id: VastProvider;
2371
+ name: string;
2372
+ development: boolean;
2373
+ })[];
2374
+
2375
+ /**
2376
+ * @public
2377
+ */
2378
+ export declare enum VastProvider {
2379
+ CNC_PREBID = "cnc-prebid",
2380
+ ETARGET_PREBID = "etarget-prebid",
2381
+ FALLBACK_HLS = "fallback-hls",
2382
+ FALLBACK_MP4 = "fallback",
2383
+ GARAZ_TV = "garaz.tv",
2384
+ GARAZ_TV_DEV = "garaz.tv.dev",
2385
+ IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
2386
+ JOJ = "joj",
2387
+ MALL_TV = "malltv",
2388
+ MALL_TV_PREBID = "malltv-prebid",
2389
+ PRIMA = "prima",
2390
+ TEST = "test"
2391
+ }
2392
+
2393
+ /**
2394
+ * @public
2395
+ */
2396
+ export declare interface Video extends RowItem {
2397
+ id: string;
2398
+ /**
2399
+ * @deprecated use assets instead
2400
+ */
2401
+ cover: string | null;
2402
+ created: Date;
2403
+ sectionId: string | null;
2404
+ channelId: string | null;
2405
+ /**
2406
+ * seconds
2407
+ */
2408
+ duration: number;
2409
+ path: string;
2410
+ tags: Tag[];
2411
+ image: string | null;
2412
+ isPlayable: boolean;
2413
+ monetizations: Monetization[];
2414
+ monetization: Monetization | undefined;
2415
+ transactionId?: string;
2416
+ transaction: Monetization | undefined;
2417
+ subscriptions: Monetization[];
2418
+ subscriptionIds: string[];
2419
+ isPlaylist: boolean;
2420
+ name: string;
2421
+ description?: string;
2422
+ price: number | null;
2423
+ detailedPrice: DetailedPrice | null;
2424
+ uri: string;
2425
+ url: string;
2426
+ adMonetizationId?: string;
2427
+ from?: Date;
2428
+ to?: Date;
2429
+ detailBanner?: string;
2430
+ linkedVideosRaw: any[];
2431
+ linkedVideos: LinkedVideo[];
2432
+ purchasableMonetization: any | null;
2433
+ contentType: VideoContentType | null;
2434
+ year?: number;
2435
+ episodeNumber?: number;
2436
+ seasonNumber?: number;
2437
+ getTagsOfType: (type: string) => Tag[];
2438
+ loadLinkedVideos: () => any;
2439
+ getLinkedVideos: (type: any) => any;
2440
+ trailer: Video | null;
2441
+ watchPosition: number | null;
2442
+ isFavorite: boolean;
2443
+ addToFavorites: () => void;
2444
+ removeFromFavorites: () => void;
2445
+ availability: VideoAvailability | null;
2446
+ }
2447
+
2448
+ /**
2449
+ * @public
2450
+ */
2451
+ export declare type VideoAvailability = {
2452
+ from: Date;
2453
+ to: Date | null;
2454
+ manual: boolean;
2455
+ };
2456
+
2457
+ /**
2458
+ * @public
2459
+ */
2460
+ export declare enum VideoContentType {
2461
+ /**
2462
+ * Default video content type
2463
+ */
2464
+ VIDEO = "VIDEO",
2465
+ FILM = "FILM",
2466
+ SERIES = "SERIES"
2467
+ }
2468
+
2469
+ /**
2470
+ * @public
2471
+ */
2472
+ export declare interface VideoExternals {
2473
+ tvProfiProgramId?: string;
2474
+ tvProfiContentId?: string;
2475
+ tvProfiSerialId?: string;
2476
+ contentId?: string;
2477
+ provysId?: string;
2478
+ mallTvEntityId?: string;
2479
+ /**
2480
+ * DRM content Key ID - should't be more connected with buyDRM or streamOnline? It is not general thing
2481
+ */
2482
+ keyId?: string;
2483
+ }
2484
+
2485
+ declare type VideoPath = string;
2486
+
2487
+ /**
2488
+ * @public
2489
+ */
2490
+ export declare const VideosContext: React_2.Context<DataState<Video>>;
2491
+
2492
+ /**
2493
+ * Video type.
2494
+ * @public
2495
+ */
2496
+ export declare enum VideoType {
2497
+ /**
2498
+ * Video is composed of several other videos.
2499
+ */
2500
+ PLAYLIST = "PLAYLIST",
2501
+ /**
2502
+ * Video is a standard single video.
2503
+ */
2504
+ VIDEO = "VIDEO",
2505
+ TV_PROGRAM = "TV_PROGRAM"
2506
+ }
2507
+
2508
+ /**
2509
+ * @public
2510
+ */
2511
+ export declare type VodExternalSource = {
2512
+ new (uri: string, monetizationId: string, name: string, description: string, originalOptions: Record<string, any>): VodTivioSource;
2513
+ type: 'vod_external';
2514
+ description: string;
2515
+ name: string;
2516
+ uri: string;
2517
+ };
2518
+
2519
+ /**
2520
+ * @public
2521
+ */
2522
+ export declare type VodTivioSource = {
2523
+ new (uri: string, videoId: string, name: string, description: string, adMonetizationId?: string): VodTivioSource;
2524
+ type: 'vod_tivio';
2525
+ description: string;
2526
+ name: string;
2527
+ uri: string;
2528
+ };
2529
+
2530
+ declare interface VodTivioSourcePojo {
2531
+ type: 'VodTivioSource';
2532
+ description: string;
2533
+ path: string;
2534
+ name: string;
2535
+ uri: string;
2536
+ poster?: string;
2537
+ adMonetizationId?: string;
2538
+ availability: VideoAvailability | null;
2539
+ }
2540
+
2541
+ /**
2542
+ * TODO: Should be in core-js, we can't import types from it, though.
2543
+ */
2544
+ declare type Voucher = {
2545
+ activate: () => void;
2546
+ isUsed: boolean;
2547
+ isExpired: boolean;
2548
+ status: 'NEW' | 'USED';
2549
+ voucherInfo: SubscriptionInfo | TransactionInfo;
2550
+ };
2551
+
2552
+ /**
2553
+ * @public
2554
+ */
2555
+ export declare interface WebPlayerProps {
2556
+ id: string;
2557
+ source?: VodTivioSourcePojo | ChannelSourcePojo | VideoPath | null;
2558
+ onEnded?: () => any;
2559
+ /**
2560
+ * If this function is specified, then "Back" button is shown in top right corner.
2561
+ */
2562
+ onBack?: () => void;
2563
+ className?: string;
2564
+ /**
2565
+ * default false
2566
+ *
2567
+ * If you choose `autoplay` make sure that autoplay is allowed in the specific situation.
2568
+ * In some cases it may not be allowed, e.g. before the user interacted with the site, and the video
2569
+ * will stay paused.
2570
+ *
2571
+ * Source: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
2572
+ */
2573
+ autoplay?: boolean;
2574
+ /**
2575
+ * default false
2576
+ */
2577
+ canReplay?: boolean;
2578
+ /**
2579
+ * default false
2580
+ */
2581
+ showMarkers?: boolean;
2582
+ /**
2583
+ * number[] is array of keyboard event.which numeric codes
2584
+ * (see https://keycode.info/)
2585
+ */
2586
+ customShortcuts?: Partial<{
2587
+ toggleFullscreen: number[];
2588
+ togglePause: number[];
2589
+ toggleMute: number[];
2590
+ jumpForward: number[];
2591
+ jumpBack: number[];
2592
+ volumeUp: number[];
2593
+ volumeDown: number[];
2594
+ }>;
2595
+ /**
2596
+ * default true
2597
+ */
2598
+ enableKeyboardShortcuts?: boolean;
2599
+ onProgress?: (event: React_2.ChangeEvent<HTMLVideoElement>) => void;
2600
+ /**
2601
+ * @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
2602
+ */
2603
+ onPlayerControllerCreated?: (playerController: any) => void;
2604
+ }
2605
+
2606
+ /**
2607
+ * @public
2608
+ */
2609
+ export declare type WebRowProps = {
2610
+ items?: ItemsInRow[];
2611
+ variant?: RowItemComponent;
2612
+ rowName?: string | any;
2613
+ fetchMore?: () => void;
2614
+ onTileClick?: (item: ItemsInRow) => void;
2615
+ };
2616
+
2617
+ /**
2618
+ * @public
2619
+ */
2620
+ export declare type WebSeriesDetailScreenProps = {
2621
+ tagId: string;
2622
+ };
2623
+
2624
+ /**
2625
+ * @public
2626
+ */
2627
+ export declare interface WhereFilter {
2628
+ field: string;
2629
+ operator: WhereFilterOp;
2630
+ value: any;
2631
+ }
2632
+
2633
+ declare type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
2634
+
2635
+ /**
2636
+ * @public
2637
+ */
2638
+ export declare type Widget = {
2639
+ id: string;
2640
+ channels: Channel[];
2641
+ isEnabled: boolean | null;
2642
+ name: string | null;
2643
+ recentVideos: Video[] | null;
2644
+ widgetId: string | null;
2645
+ lastVideo: Video | null;
2646
+ };
2647
+
2648
+ /**
2649
+ * @public
2650
+ */
2651
+ export declare function withPlayerContext(id: string): <P>(WrappedComponent: React_2.ComponentType<P>) => (props: P) => JSX.Element;
2652
+
2653
+ export { }