@tivio/sdk-react 3.6.1 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2661 @@
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
+ /**
1037
+ * Timestamp of the purchase creation in milliseconds.
1038
+ */
1039
+ created: number | null;
1040
+ expirationDate: Date | null;
1041
+ id: string;
1042
+ isExpired: boolean;
1043
+ isPurchased: boolean;
1044
+ monetization: PurchaseMonetization | null;
1045
+ monetizationId: string | null;
1046
+ monetizationRef: any | null;
1047
+ status: PurchaseStatus | null;
1048
+ type: MonetizationType | null;
1049
+ /**
1050
+ * Timestamp of the last purchase status update in milliseconds.
1051
+ */
1052
+ updated: number | null;
1053
+ video: Video | null;
1054
+ videoId: string | null;
1055
+ videoRef: any | null;
1056
+ voucherId?: string;
1057
+ };
1058
+
1059
+ /**
1060
+ * @public
1061
+ */
1062
+ export declare type PurchaseMonetization = {
1063
+ currency?: Currency;
1064
+ period?: number;
1065
+ price?: number;
1066
+ type: MonetizationType;
1067
+ title?: string;
1068
+ frequency?: MONETIZATION_FREQUENCY | null;
1069
+ /**
1070
+ * If set, purchase (subscription) activated by voucher will stay valid for this amount of seconds.
1071
+ * Otherwise, purchase will be valid for one "monetization frequency" period.
1072
+ */
1073
+ voucherPurchaseDuration?: number;
1074
+ };
1075
+
1076
+ /**
1077
+ * @public
1078
+ */
1079
+ export declare enum PurchaseStatus {
1080
+ NEW = "NEW",
1081
+ PAID = "PAID",
1082
+ CANCELLED = "CANCELLED",
1083
+ ERROR = "ERROR",
1084
+ /**
1085
+ * Used when purchase is terminated due to terms and conditions violation (e.g. restreaming).
1086
+ */
1087
+ KILL = "KILL"
1088
+ }
1089
+
1090
+ /**
1091
+ * @public
1092
+ */
1093
+ export declare interface QerkoCancellationInfo {
1094
+ purchaseId: string;
1095
+ status: PurchaseStatus;
1096
+ }
1097
+
1098
+ /**
1099
+ * @public
1100
+ */
1101
+ export declare interface QerkoData {
1102
+ monetization: Monetization;
1103
+ video?: Video;
1104
+ onPurchase?: () => void;
1105
+ onClose?: () => void;
1106
+ }
1107
+
1108
+ /**
1109
+ * @public
1110
+ */
1111
+ export declare interface QerkoOverlayState {
1112
+ data: QerkoData | null;
1113
+ openQerkoOverlay: ((data: QerkoData) => void);
1114
+ closeQerkoOverlay: () => void;
1115
+ }
1116
+
1117
+ /**
1118
+ * @public
1119
+ */
1120
+ export declare interface QerkoPaymentInfo {
1121
+ webPaymentGatewayLink: string;
1122
+ gatewayUri: string;
1123
+ paymentQRCodeUri: string;
1124
+ purchaseId: string;
1125
+ currency: string;
1126
+ amount: number;
1127
+ monetizationType: MonetizationType;
1128
+ recovery?: boolean;
1129
+ monetizationFrequency: MONETIZATION_FREQUENCY;
1130
+ }
1131
+
1132
+ /**
1133
+ * @public
1134
+ */
1135
+ export declare interface QerkoPaymentProps {
1136
+ transaction: QerkoTransaction;
1137
+ qrCodeCaption?: string;
1138
+ renderErrorComponent: () => any;
1139
+ enablePayByCard?: boolean;
1140
+ payByCardCaption?: string;
1141
+ visaLogoUrl?: string;
1142
+ masterCardLogoUrl?: string;
1143
+ }
1144
+
1145
+ /**
1146
+ * @public
1147
+ */
1148
+ export declare interface QerkoTransaction {
1149
+ paymentInfo: QerkoPaymentInfo | null;
1150
+ paymentError: string | null;
1151
+ paymentStatus: string | null;
1152
+ getPaymentInfo: () => Promise<void>;
1153
+ voucherId?: string;
1154
+ }
1155
+
1156
+ /**
1157
+ * @public
1158
+ */
1159
+ export declare type RemoteBundleState = {
1160
+ config: InternalConfig;
1161
+ error: string | null;
1162
+ settings: Settings;
1163
+ state: 'loading' | 'error' | 'ready';
1164
+ } & Nullable<TivioBundle>;
1165
+
1166
+ /**
1167
+ * @public
1168
+ */
1169
+ export declare type RemoteProviderProps = {
1170
+ disableUnmounting?: boolean;
1171
+ language?: string;
1172
+ children: any;
1173
+ };
1174
+
1175
+ /**
1176
+ * @public
1177
+ */
1178
+ export declare interface RouterOverrides {
1179
+ goToVideoDetailPage: (videoId: string) => void;
1180
+ goToSeriesDetailPage: (tagId: string) => void;
1181
+ goToTagPage: (tagId: string) => void;
1182
+ goToLoginScreen: () => void;
1183
+ goBack: () => void;
1184
+ goLivePlayer: (videoId: string) => void;
1185
+ goVodPlayer: (tvChannelId: string) => void;
1186
+ }
1187
+
1188
+ /**
1189
+ * @public
1190
+ */
1191
+ export declare interface RouterOverridesContextState {
1192
+ routerOverrides: RouterOverrides;
1193
+ }
1194
+
1195
+ /**
1196
+ * @public
1197
+ */
1198
+ export declare interface Row {
1199
+ id: string;
1200
+ rowId: string;
1201
+ name: string;
1202
+ description?: string;
1203
+ itemComponent: RowItemComponent;
1204
+ rowComponent: RowComponent;
1205
+ assets: Assets;
1206
+ type: ScreenRowType;
1207
+ isLiveRow: boolean;
1208
+ }
1209
+
1210
+ /**
1211
+ * @public
1212
+ */
1213
+ export declare enum ROW_ITEM_TYPES {
1214
+ VIDEO = "VIDEO",
1215
+ TAG = "TAG",
1216
+ TV_CHANNEL = "TV_CHANNEL"
1217
+ }
1218
+
1219
+ /**
1220
+ * @public
1221
+ */
1222
+ export declare enum RowComponent {
1223
+ ROW = "ROW",
1224
+ BANNER = "BANNER"
1225
+ }
1226
+
1227
+ /**
1228
+ * @public
1229
+ */
1230
+ export declare interface RowItem extends RowItemAssets {
1231
+ itemType: ROW_ITEM_TYPES;
1232
+ name?: string;
1233
+ description?: string;
1234
+ assets: Assets | null;
1235
+ }
1236
+
1237
+ /**
1238
+ * @public
1239
+ */
1240
+ export declare interface RowItemAssets {
1241
+ landscape?: string | null;
1242
+ portrait?: string | null;
1243
+ circled?: string | null;
1244
+ banner?: string | null;
1245
+ }
1246
+
1247
+ /**
1248
+ * @public
1249
+ */
1250
+ export declare enum RowItemComponent {
1251
+ ROW_ITEM_PORTRAIT = "ROW_ITEM_PORTRAIT",
1252
+ ROW_ITEM_LANDSCAPE = "ROW_ITEM_LANDSCAPE",
1253
+ ROW_ITEM_CIRCLED = "ROW_ITEM_CIRCLED"
1254
+ }
1255
+
1256
+ /**
1257
+ * Listen to items in row of a screen
1258
+ * @param rowId - row ID (user defined ID via studio.tiv.io)
1259
+ * @param cb - callback on items changes or error, with information
1260
+ * whether data is loading and a fetchMore function
1261
+ * @param limit - max item count (default 10)
1262
+ * @returns Disposer
1263
+ * @public
1264
+ */
1265
+ export declare type RowItemsSubscription = (rowId: string, cb: (error: Error | null, data: {
1266
+ items: Video[];
1267
+ hasNextPage: boolean;
1268
+ } | null, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => Disposer_2;
1269
+
1270
+ /**
1271
+ * @public
1272
+ */
1273
+ export declare type ScalableAsset = {
1274
+ '@1': Asset;
1275
+ '@2'?: Asset;
1276
+ '@3'?: Asset;
1277
+ };
1278
+
1279
+ /**
1280
+ * @public
1281
+ */
1282
+ export declare type Scale = '@1' | '@2' | '@3';
1283
+
1284
+ /**
1285
+ * @public
1286
+ */
1287
+ declare interface Screen_2 {
1288
+ id: string;
1289
+ name: string;
1290
+ description?: string;
1291
+ assets: Assets;
1292
+ rows: Row[];
1293
+ }
1294
+ export { Screen_2 as Screen }
1295
+
1296
+ /**
1297
+ * @public
1298
+ */
1299
+ export declare type ScreenConfig = {
1300
+ id: string;
1301
+ name: string;
1302
+ };
1303
+
1304
+ /**
1305
+ * @public
1306
+ */
1307
+ export declare type ScreenOptions = Partial<{
1308
+ language: LangCode;
1309
+ initRows: boolean;
1310
+ }> & DocumentOptions;
1311
+
1312
+ /**
1313
+ * @public
1314
+ */
1315
+ export declare type ScreenRowType = 'filter' | 'custom' | 'continueToWatch' | 'favourites';
1316
+
1317
+ /**
1318
+ * Listen to screen data
1319
+ * @param screenId - screen ID (user defined ID via studio.tiv.io)
1320
+ * @param cb - callback on screen data change or error
1321
+ * @returns Disposer
1322
+ * @public
1323
+ */
1324
+ export declare type ScreenSubscription = (screenId: string, cb: (error: Error | null, data: Screen_2 | null) => void) => Disposer_2;
1325
+
1326
+ /**
1327
+ * @public
1328
+ */
1329
+ export declare interface Section {
1330
+ id: string;
1331
+ name: string;
1332
+ channel: Channel;
1333
+ videos: Video[];
1334
+ }
1335
+
1336
+ /**
1337
+ * @public
1338
+ */
1339
+ export declare const SectionsContext: React_2.Context<DataState<Section>>;
1340
+
1341
+ /**
1342
+ * @public
1343
+ */
1344
+ export declare type Settings = {
1345
+ /**
1346
+ * @deprecated TIV-994 in favour of setUser from libs/sdk-react/src/services/login.ts
1347
+ */
1348
+ setUser: (userId: string, userPayload: unknown) => Promise<void>;
1349
+ };
1350
+
1351
+ /**
1352
+ * Used for entities, that can be global (e.g. asset presets, tag types).
1353
+ * Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
1354
+ * Global is stored in separate collection and shown only for super-admin.
1355
+ * @public
1356
+ */
1357
+ export declare interface SettingsItem {
1358
+ name: string;
1359
+ isGlobal?: boolean;
1360
+ }
1361
+
1362
+ /**
1363
+ * Set user to sign in/out.
1364
+ *
1365
+ * Sign in - setUser('userID', { token: 'xxx' })
1366
+ * Sign out - setUser(null)
1367
+ * @public
1368
+ */
1369
+ export declare const setUser: (userId: string | null, payload?: UserPayload | undefined) => Promise<void>;
1370
+
1371
+ /**
1372
+ * @public
1373
+ */
1374
+ export declare const showGdprConsentPreferences: () => Promise<void>;
1375
+
1376
+ /**
1377
+ * @public
1378
+ */
1379
+ export declare type SubscribeToItemsInRow = (rowId: string, cb: (error: Error | null, data: PaginationInterface<ItemsInRow> | null) => void, options?: SubscribeToItemsInRowOptions) => Disposer_2;
1380
+
1381
+ /**
1382
+ * @public
1383
+ */
1384
+ export declare type SubscribeToItemsInRowOptions = Partial<{
1385
+ fetchTags: boolean;
1386
+ }> & PaginationOptions;
1387
+
1388
+ /**
1389
+ * @public
1390
+ */
1391
+ export declare type SubscribeToRowsInScreen = (screenId: string, cb: (error: Error | null, data: PaginationInterface<Row> | null) => void, options?: PaginationOptions) => Disposer_2;
1392
+
1393
+ /**
1394
+ * @public
1395
+ */
1396
+ export declare type SubscribeToScreen = (screenId: string, cb: (error: Error | null, data: Screen_2 | null) => void, options?: ScreenOptions) => Disposer_2;
1397
+
1398
+ /**
1399
+ * @public
1400
+ */
1401
+ export declare type SubscribeToTaggedVideos = (tagIds: string[], cb: (error: Error | null, data: PaginationInterface<Video> | null) => void, options?: SubscribeToTaggedVideosOptions) => Disposer_2;
1402
+
1403
+ /**
1404
+ * @public
1405
+ */
1406
+ export declare type SubscribeToTaggedVideosOptions = SubscribeToItemsInRowOptions & {
1407
+ orderBy?: (Omit<OrderBy, 'field'> & {
1408
+ field: TaggedVideosOrderByField;
1409
+ })[];
1410
+ where?: WhereFilter[];
1411
+ };
1412
+
1413
+ /**
1414
+ * @public
1415
+ */
1416
+ export declare interface SubscriptionCardProps {
1417
+ subscription: Monetization;
1418
+ onClick: (subscription: Monetization) => void;
1419
+ buttonLabel: string;
1420
+ purchased: boolean;
1421
+ focused?: boolean;
1422
+ }
1423
+
1424
+ declare type SubscriptionInfo = {
1425
+ type: 'subscription';
1426
+ name: string;
1427
+ benefits: string[];
1428
+ frequency: string;
1429
+ };
1430
+
1431
+ /**
1432
+ * @public
1433
+ */
1434
+ export declare interface SubscriptionOverlayData {
1435
+ subscriptions?: Monetization[];
1436
+ onPurchase?: () => void;
1437
+ onClose?: () => void;
1438
+ }
1439
+
1440
+ /**
1441
+ * @public
1442
+ */
1443
+ export declare type SubscriptionOverlayState = {
1444
+ data: SubscriptionOverlayData | null;
1445
+ closeSubscriptionOverlay: () => void;
1446
+ openSubscriptionOverlay: (data: SubscriptionOverlayData) => void;
1447
+ };
1448
+
1449
+ /**
1450
+ * @public
1451
+ */
1452
+ export declare interface Tag extends RowItem {
1453
+ id: string;
1454
+ tagId: string;
1455
+ type?: string | null;
1456
+ metadata?: any[];
1457
+ color?: string;
1458
+ detailBanner?: string;
1459
+ availableSeasons?: AvailableSeason[];
1460
+ isFavorite: boolean;
1461
+ addToFavorites: () => void;
1462
+ removeFromFavorites: () => void;
1463
+ }
1464
+
1465
+ /**
1466
+ * @public
1467
+ */
1468
+ export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber' | 'contentType' | DefaultOrderByField;
1469
+
1470
+ /**
1471
+ * @internal
1472
+ */
1473
+ export declare type TileOptions = {
1474
+ focusedShadow: boolean;
1475
+ focusedShadowColor?: string;
1476
+ borderColor: string;
1477
+ innerLabel: {
1478
+ /**
1479
+ * Font size in px
1480
+ */
1481
+ fontSize: number;
1482
+ };
1483
+ bottomLabel: {
1484
+ opacity: string | number;
1485
+ fontWeight: string;
1486
+ };
1487
+ };
1488
+
1489
+ /**
1490
+ * @public
1491
+ */
1492
+ export declare type TileProps = {
1493
+ cover: string;
1494
+ isLoading: boolean;
1495
+ bottomLabel: string;
1496
+ bottomLabelAreaHeight: number;
1497
+ innerLabel: string;
1498
+ duration: string;
1499
+ price: string | null;
1500
+ focused: boolean;
1501
+ onClick?: () => void;
1502
+ hoverable: boolean;
1503
+ overlay: boolean;
1504
+ coverPadding: CoverPadding;
1505
+ variant: RowItemComponent;
1506
+ coverWidth: number;
1507
+ progress?: number;
1508
+ time?: string;
1509
+ logo?: string;
1510
+ coverHeight: number;
1511
+ /**
1512
+ * Margin of inner TileContainer.
1513
+ * Now used for backward compatibility for WebTileGrid. Consider to use it other way.
1514
+ */
1515
+ containerMargin?: number | string;
1516
+ };
1517
+
1518
+ /**
1519
+ * @public
1520
+ */
1521
+ export declare type TilePropsPartial = Partial<TileProps>;
1522
+
1523
+ /**
1524
+ * @public
1525
+ */
1526
+ export declare interface TivioAuth {
1527
+ changePassword: (newPassword: string) => Promise<void>;
1528
+ changeUserPhoto(file: any): Promise<void>;
1529
+ removeUserPhoto(): Promise<void>;
1530
+ getPurchasedVodsWithInitializedVideos: () => Promise<Purchase[]>;
1531
+ /**
1532
+ * @param email
1533
+ * @param password
1534
+ */
1535
+ createUserWithEmailAndPassword: CreateUserWithEmailAndPassword;
1536
+ /**
1537
+ * Sign in the user and starts listening on his purchases
1538
+ * @param email
1539
+ * @param password
1540
+ */
1541
+ signInWithEmailAndPassword: (email: string, password: string) => Promise<string | null>;
1542
+ initializeUser: () => Promise<void>;
1543
+ signOut: () => Promise<void>;
1544
+ /**
1545
+ * Used for reset forgotten password by user
1546
+ */
1547
+ resetPassword: (email: string) => Promise<void>;
1548
+ createFreePurchase: (monetizationId: string) => Promise<void>;
1549
+ }
1550
+
1551
+ /**
1552
+ * @public
1553
+ */
1554
+ export declare type TivioBundle = BasicTivioBundle & {
1555
+ init: (config: Config) => void | Promise<void>;
1556
+ };
1557
+
1558
+ /**
1559
+ * @public
1560
+ */
1561
+ export declare type TivioBundleFile = {
1562
+ Tivio: TivioBundle;
1563
+ };
1564
+
1565
+ /**
1566
+ * @public
1567
+ */
1568
+ export declare type TivioComponents = {
1569
+ Markers: React_2.ReactNode;
1570
+ PlayerDataContext: React_2.ReactNode;
1571
+ Provider: React_2.ComponentType<RemoteProviderProps>;
1572
+ /**
1573
+ * @deprecated will be removed in in @tivio/sdk-react@4
1574
+ */
1575
+ VideoAdBanner: React_2.ReactNode;
1576
+ WebPlayer: React_2.ComponentType<WebPlayerProps>;
1577
+ Widget: React_2.ComponentType<TivioWidgetProps>;
1578
+ PlayerDataContextProvider: React_2.ComponentType<{
1579
+ id: string;
1580
+ }>;
1581
+ SkipButtonTv: React_2.ComponentType<{
1582
+ Button: React_2.ComponentType;
1583
+ Label: React_2.ComponentType;
1584
+ Container: React_2.ComponentType;
1585
+ onStarted?: () => any;
1586
+ onEnded?: () => any;
1587
+ }>;
1588
+ TvApp: React_2.ComponentType<TvAppProps>;
1589
+ FeatureSupportCheck: React_2.ComponentType<{}>;
1590
+ CustomerScreen: React_2.ComponentType<{
1591
+ screenId: string;
1592
+ }>;
1593
+ WebTagScreen: React_2.ComponentType<{
1594
+ tagId: string;
1595
+ onError?: (error: Error) => void;
1596
+ }>;
1597
+ WebSearchScreen: React_2.ComponentType<{
1598
+ searchQuery?: string;
1599
+ }>;
1600
+ WebRow: React_2.ComponentType<WebRowProps>;
1601
+ WebTile: React_2.ComponentType<{
1602
+ item?: ItemsInRow;
1603
+ } & TilePropsPartial>;
1604
+ AdIndicationButtonWeb: React_2.ReactNode;
1605
+ Recommendation: React_2.ReactNode;
1606
+ SkipButtonWeb: React_2.ReactNode;
1607
+ TvPlayer: React_2.ComponentType<WebPlayerProps>;
1608
+ };
1609
+
1610
+ /**
1611
+ * @public
1612
+ */
1613
+ export declare const TivioContext: React_2.Context<RemoteBundleState | null>;
1614
+
1615
+ /**
1616
+ * @public
1617
+ */
1618
+ export declare type TivioGetters = {
1619
+ isTivioLoaded: (cb: (isLoaded: boolean) => void) => void;
1620
+ isSignedIn: () => boolean;
1621
+ /**
1622
+ * @deprecated is here only for backward compatibility
1623
+ */
1624
+ getExportedConfig: () => Promise<{
1625
+ showMarkers: true;
1626
+ }>;
1627
+ /**
1628
+ * Get channel by its id.
1629
+ * @param channelId - channel id
1630
+ * @returns {Promise<Channel | null>} channel or null if channel does not exists
1631
+ */
1632
+ getChannelById: (channelId: string) => Promise<Channel | null>;
1633
+ /**
1634
+ * Get (or create) player wrapper instance
1635
+ * @param opt - player getter options
1636
+ * @returns {PlayerWrapper} player wrapper instance
1637
+ */
1638
+ getPlayerWrapper: (opt: {
1639
+ playerWrapperId?: string;
1640
+ }) => any;
1641
+ getOrganizationSubscriptions: () => Promise<Monetization[] | undefined>;
1642
+ /**
1643
+ * Get section by its id.
1644
+ * @param sectionId - section id
1645
+ * @returns {Promise<{section: Section, channel: Channel} | null>} section and channel or null if channel or section does not exists
1646
+ */
1647
+ getSectionById: (sectionId: string) => Promise<Section | null>;
1648
+ /**
1649
+ * Get video by its id.
1650
+ * @param videoId - video id
1651
+ * @returns {Promise<Video | null>} video or null if video does not exists
1652
+ */
1653
+ getVideoById: (videoId: string) => Promise<Video | null>;
1654
+ /**
1655
+ * Get widget by its id.
1656
+ * @param widgetId - widget id
1657
+ * @returns {Promise<Widget | null>} widget or null if widget does not exists
1658
+ */
1659
+ getWidgetById: (widgetId: string) => Promise<Widget | null>;
1660
+ /**
1661
+ * Get player capabilities based on user's browser and OS as resolved by Tivio.
1662
+ * @returns PlayerCapability[]
1663
+ */
1664
+ getPlayerCapabilities: () => PlayerCapability[];
1665
+ };
1666
+
1667
+ /**
1668
+ * @public
1669
+ */
1670
+ export declare type TivioHooks = {
1671
+ useAd: () => [(AdSource | null)];
1672
+ useAdSegment: () => AdSegment | null;
1673
+ useCancelSubscription: UseCancelSubscription;
1674
+ useItemsInRow: (rowId: string, options: PaginationOptions) => {
1675
+ pagination: PaginationInterface<ItemsInRow> | null;
1676
+ error: Error | null;
1677
+ };
1678
+ usePurchaseRecovery: () => {
1679
+ purchaseRecoveryResult?: string;
1680
+ loading: boolean;
1681
+ error?: GenericOnCallError;
1682
+ purchaseRecovery: (monetizationId: string) => void;
1683
+ };
1684
+ useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
1685
+ usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
1686
+ useRowsInScreen: (screenId: string, options: PaginationOptions) => {
1687
+ pagination: PaginationInterface<Row> | null;
1688
+ error: Error | null;
1689
+ };
1690
+ useTaggedVideos: (tagIds: string[], options: SubscribeToItemsInRowOptions) => {
1691
+ pagination: PaginationInterface<Video> | null;
1692
+ error: Error | null;
1693
+ };
1694
+ useSearch: UseSearch;
1695
+ useVideo: (videoId: string) => {
1696
+ data: Video | null;
1697
+ error: string | null;
1698
+ };
1699
+ useVoucher: (voucherId: string) => any;
1700
+ /**
1701
+ * @deprecated will be removed in version
1702
+ */
1703
+ useLastVideoByWidgetId: (widgetId: string) => Video | null;
1704
+ useWatchWithoutAdsOffer: () => {
1705
+ canPurchaseWatchWithoutAds: boolean;
1706
+ showPurchaseDialog: () => void;
1707
+ };
1708
+ useApplyInviteCode: () => {
1709
+ applyInviteCodeResult?: boolean;
1710
+ loading: boolean;
1711
+ error?: GenericOnCallError;
1712
+ applyInviteCode: (code: string) => void;
1713
+ inviteCodeReset: () => void;
1714
+ };
1715
+ };
1716
+
1717
+ /**
1718
+ * @public
1719
+ */
1720
+ export declare type TivioInternalBundle = {
1721
+ components: TivioInternalComponents;
1722
+ hooks: TivioInternalHooks;
1723
+ providers: TivioInternalProviders;
1724
+ };
1725
+
1726
+ /**
1727
+ * @public
1728
+ */
1729
+ export declare type TivioInternalComponents = {
1730
+ PrimaryButton: React_2.ComponentType;
1731
+ WebLandingScreen: React_2.ComponentType<{
1732
+ logo?: string;
1733
+ }>;
1734
+ WebVideoScreen: React_2.ComponentType<{
1735
+ videoId: string;
1736
+ }>;
1737
+ WebSeriesDetailScreen: React_2.ComponentType<WebSeriesDetailScreenProps>;
1738
+ };
1739
+
1740
+ /**
1741
+ * @public
1742
+ */
1743
+ export declare type TivioInternalHooks = {
1744
+ useAuthOverlay: () => AuthOverlayState;
1745
+ useSubscriptionsOverlay: () => SubscriptionOverlayState;
1746
+ useQerkoOverlay: () => QerkoOverlayState;
1747
+ usePurchasesWithVideos: () => {
1748
+ purchases: Purchase[];
1749
+ };
1750
+ useOrganizationSubscriptions: () => {
1751
+ subscriptions: Monetization[];
1752
+ };
1753
+ useIsMonetizationPurchased: () => {
1754
+ isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
1755
+ };
1756
+ useReferralInfo: any;
1757
+ useTvChannel: UseTvChannel;
1758
+ useChannelSource: UseChannelSource;
1759
+ useUser: () => {
1760
+ user: User | null;
1761
+ error: string | null;
1762
+ isInitialized: boolean;
1763
+ };
1764
+ };
1765
+
1766
+ /**
1767
+ * @public
1768
+ */
1769
+ export declare type TivioInternalProviders = {
1770
+ AppThemeProvider: React_2.ComponentType;
1771
+ AuthOverlayContextProvider: React_2.ComponentType;
1772
+ CustomerProvider: React_2.ComponentType<{
1773
+ customer: CUSTOMER_BUILD;
1774
+ platform: PLATFORM;
1775
+ children: any;
1776
+ }>;
1777
+ ConfigProvider: React_2.ComponentType;
1778
+ UserContextProvider: React_2.ComponentType;
1779
+ SubscriptionOverlayContextProvider: React_2.ComponentType;
1780
+ QerkoOverlayContextProvider: React_2.ComponentType;
1781
+ PurchasesWithVideosContextProvider: React_2.ComponentType;
1782
+ OrganizationSubscriptionsContextProvider: React_2.ComponentType;
1783
+ RouterOverridesContextProvider: React_2.ComponentType<RouterOverridesContextState>;
1784
+ };
1785
+
1786
+ /**
1787
+ * @public
1788
+ */
1789
+ export declare const TivioProvider: React_2.FC<TivioProviderProps>;
1790
+
1791
+ /**
1792
+ * @public
1793
+ */
1794
+ export declare type TivioProviderProps = {
1795
+ /**
1796
+ * This prop must be set only once and not change value afterwards
1797
+ */
1798
+ conf: Config | undefined | null;
1799
+ children: React_2.ReactNode;
1800
+ };
1801
+
1802
+ /**
1803
+ * @public
1804
+ */
1805
+ export declare type TivioSources = {
1806
+ AdSource: any;
1807
+ ChannelSource: any;
1808
+ VodExternalSource: any;
1809
+ VodTivioSource: any;
1810
+ };
1811
+
1812
+ /**
1813
+ * @public
1814
+ */
1815
+ export declare type TivioSubscriptions = {
1816
+ subscribeToUser: (cb: (error: string | null, user: User | null) => void) => void;
1817
+ /**
1818
+ * Listen to widget changes.
1819
+ * @param widgetId - widget id
1820
+ * @param cb - callback on widget updates or on error
1821
+ */
1822
+ subscribeToWidget: (widgetId: string, cb: (error: Error | null, data: Widget | null, disposer?: Disposer_2) => void) => void;
1823
+ /**
1824
+ * Listen to channel changes.
1825
+ * @param channelId - channel id
1826
+ * @param cb - callback on channel updates or on error
1827
+ */
1828
+ subscribeToChannel: (channelId: string, cb: (error: Error | null, data: Channel | null) => void) => void;
1829
+ /**
1830
+ * Listen to section changes.
1831
+ * @param sectionId - section id
1832
+ * @param cb - callback on section updates or on error
1833
+ */
1834
+ subscribeToSection: (sectionId: string, cb: (error: Error | null, data: Section | null) => void) => void;
1835
+ /**
1836
+ * Listen to video changes.
1837
+ * @param videoId - video id
1838
+ * @param cb - callback on video updates or on error
1839
+ */
1840
+ subscribeToVideo: (videoId: string, cb: (error: Error | null, data: Video | null, disposer?: Disposer_2) => void) => void;
1841
+ /**
1842
+ * Listen to videos in section changes.
1843
+ * @param sectionId - section id
1844
+ * @param cb - callback on videos change or error
1845
+ * @param limit - videos count
1846
+ */
1847
+ subscribeToVideosInSection: (sectionId: string, cb: (error: null | Error, data: null | {
1848
+ videos: Video[];
1849
+ hasNextPage: boolean;
1850
+ }, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
1851
+ /**
1852
+ * Listen to section in channel changes
1853
+ * @param channelId - channel id
1854
+ * @param cb - callback on sections change or error
1855
+ * @param limit - sections count
1856
+ */
1857
+ subscribeToSectionsInChannel: (channelId: string, cb: (error: null | Error, data: null | {
1858
+ sections: Section[];
1859
+ hasNextPage: boolean;
1860
+ }, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
1861
+ /**
1862
+ * Listen to channels in widget changes
1863
+ * @param widgetId - widget id
1864
+ * @param cb - callback on channels change or error
1865
+ * @param limit - channels count
1866
+ */
1867
+ subscribeToChannelsInWidget: (widgetId: string, cb: (error: null | Error, data: null | {
1868
+ channels: Channel[];
1869
+ hasNextPage: boolean;
1870
+ }, fetchMore: null | ((count?: number) => void), isLoading: boolean) => void, limit?: number) => void;
1871
+ subscribeToScreen: SubscribeToScreen;
1872
+ subscribeToItemsInRow: SubscribeToItemsInRow;
1873
+ subscribeToRowsInScreen: SubscribeToRowsInScreen;
1874
+ subscribeToTaggedVideos: SubscribeToTaggedVideos;
1875
+ registerOverlayCallbacks: (callbacks: {
1876
+ onShow: () => void;
1877
+ onHide: () => void;
1878
+ }) => void;
1879
+ };
1880
+
1881
+ /**
1882
+ * @public
1883
+ */
1884
+ export declare const TivioWidget: React_2.ForwardRefExoticComponent<Pick<TivioWidgetProps, "id" | "onEnabled" | "onBlur"> & React_2.RefAttributes<TivioWidgetRef>>;
1885
+
1886
+ /**
1887
+ * @public
1888
+ */
1889
+ export declare const TivioWidgetError: React_2.FC<TivioWidgetErrorProps>;
1890
+
1891
+ declare type TivioWidgetErrorProps = {
1892
+ error: string | null;
1893
+ };
1894
+
1895
+ /**
1896
+ * @public
1897
+ */
1898
+ export declare const TivioWidgetLoader: React_2.FC;
1899
+
1900
+ /**
1901
+ * @public
1902
+ */
1903
+ export declare interface TivioWidgetProps {
1904
+ id: string;
1905
+ ref: React_2.MutableRefObject<TivioWidgetRef>;
1906
+ onEnabled?: (enabled: boolean) => any;
1907
+ onBlur?: (event: {
1908
+ key: string;
1909
+ width: number;
1910
+ x: number;
1911
+ }) => any;
1912
+ }
1913
+
1914
+ /**
1915
+ * @public
1916
+ */
1917
+ export declare interface TivioWidgetRef {
1918
+ focus: (args: {
1919
+ x?: number;
1920
+ }) => void;
1921
+ handleKey: (key: string) => ({
1922
+ handled: boolean;
1923
+ x: number;
1924
+ });
1925
+ unfocus: () => ({
1926
+ x: number;
1927
+ });
1928
+ }
1929
+
1930
+ declare type TransactionInfo = {
1931
+ type: 'transaction';
1932
+ name: string;
1933
+ videoId: string;
1934
+ cover: string;
1935
+ description: string;
1936
+ };
1937
+
1938
+ /**
1939
+ * Represents one string in every supported language mutation.
1940
+ * @public
1941
+ */
1942
+ export declare type Translation = {
1943
+ [key in LangCode]: string;
1944
+ };
1945
+
1946
+ /**
1947
+ * @public
1948
+ */
1949
+ export declare type TvAppProps = {
1950
+ customer: CUSTOMER_BUILD;
1951
+ };
1952
+
1953
+ /**
1954
+ * @public
1955
+ */
1956
+ export declare interface TvChannel extends RowItem {
1957
+ name: string;
1958
+ id: string;
1959
+ path: string;
1960
+ itemType: ROW_ITEM_TYPES;
1961
+ country?: string;
1962
+ filters: string[];
1963
+ logo?: string;
1964
+ hls: string;
1965
+ dash: string;
1966
+ purchasableMonetization: any | null;
1967
+ price: number;
1968
+ }
1969
+
1970
+ /**
1971
+ * @public
1972
+ */
1973
+ export declare const TvTivioProvider: React_2.FC<TivioProviderProps>;
1974
+
1975
+ /**
1976
+ * @public
1977
+ */
1978
+ export declare const useAd: () => AdSource | null;
1979
+
1980
+ /**
1981
+ * @public
1982
+ */
1983
+ export declare const useAdSegment: () => {
1984
+ id: string;
1985
+ remainingMs: number;
1986
+ secondsToEnd: number;
1987
+ secondsToSkippable: number | null;
1988
+ canSeek: boolean;
1989
+ canSkip: boolean;
1990
+ isSkippable: boolean;
1991
+ skip: () => any;
1992
+ } | null;
1993
+
1994
+ /**
1995
+ * Is used to login user through different device in which user is already logged in.
1996
+ * (e.g. login in tv app through web app)
1997
+ *
1998
+ * @return applyInviteCodeResult - true if code was applied successfully, false otherwise.
1999
+ * loading - loading state
2000
+ * error - error in case request failure
2001
+ * applyInviteCode - function to apply invite code
2002
+ * inviteCodeReset - function to reset to initial state
2003
+ * @public
2004
+ */
2005
+ export declare function useApplyInviteCode(): {
2006
+ applyInviteCodeResult?: boolean | undefined;
2007
+ loading: boolean;
2008
+ error?: GenericOnCallError | undefined;
2009
+ applyInviteCode: (code: string) => void;
2010
+ inviteCodeReset: () => void;
2011
+ };
2012
+
2013
+ /**
2014
+ * @public
2015
+ */
2016
+ export declare const useBetOffer: () => BetOffer | null;
2017
+
2018
+ /**
2019
+ * @public
2020
+ */
2021
+ export declare type UseCancelSubscription = (subscriptionId: string) => {
2022
+ cancelSubscription: () => Promise<void>;
2023
+ cancellationInfo: QerkoCancellationInfo | null;
2024
+ error?: string | null;
2025
+ };
2026
+
2027
+ /**
2028
+ * @public
2029
+ */
2030
+ export declare const useCancelSubscription: UseCancelSubscription;
2031
+
2032
+ /**
2033
+ * Use channel
2034
+ * @param channelId - channel id
2035
+ * @public
2036
+ */
2037
+ export declare const useChannel: (channelId: string) => {
2038
+ error: string | null;
2039
+ data: Channel | null;
2040
+ };
2041
+
2042
+ /**
2043
+ * Use channels in widget
2044
+ * @param widgetId - widget id
2045
+ * @param [limit] - channels count, defaults to 10
2046
+ * @public
2047
+ */
2048
+ export declare const useChannelsInWidget: (widgetId: string, limit?: number) => {
2049
+ error: Error | null;
2050
+ data: PaginationData<Channel> | null;
2051
+ isLoading: boolean;
2052
+ };
2053
+
2054
+ /**
2055
+ * @public
2056
+ */
2057
+ export declare type UseChannelSource = (tvChannelId: string) => {
2058
+ source: ChannelSourcePojo | null;
2059
+ error: Error | null;
2060
+ };
2061
+
2062
+ /**
2063
+ * @public
2064
+ */
2065
+ export declare const useCurrentMarker: () => Marker | null;
2066
+
2067
+ /**
2068
+ * @public
2069
+ */
2070
+ export declare const useFreePurchase: () => {
2071
+ purchase: (monetizationId: string) => Promise<void>;
2072
+ };
2073
+
2074
+ /**
2075
+ * @public
2076
+ */
2077
+ export declare const useIntro: () => IntroMarker | null;
2078
+
2079
+ /**
2080
+ * @public
2081
+ */
2082
+ export declare const useIsLoaded: () => {
2083
+ isTivioLoaded: boolean;
2084
+ };
2085
+
2086
+ /**
2087
+ * @public
2088
+ */
2089
+ export declare const useIsMonetizationPurchased: () => {
2090
+ isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
2091
+ };
2092
+
2093
+ /**
2094
+ * Use row items
2095
+ * @param rowId - row ID
2096
+ * @param options - subscription options
2097
+ * @public
2098
+ */
2099
+ export declare const useItemsInRow: (rowId: string, options?: SubscribeToItemsInRowOptions) => {
2100
+ pagination: PaginationInterface<ItemsInRow> | null;
2101
+ error: Error | null;
2102
+ };
2103
+
2104
+ /**
2105
+ * @deprecated will be removed in v4
2106
+ * @public
2107
+ */
2108
+ export declare function useLastVideoByWidgetId(widgetId: string): Video | null;
2109
+
2110
+ /**
2111
+ * @public
2112
+ */
2113
+ export declare const useMarkers: () => Marker[] | null;
2114
+
2115
+ /**
2116
+ * @public
2117
+ */
2118
+ export declare const useOrganizationSubscriptions: () => {
2119
+ subscriptions: Monetization[];
2120
+ };
2121
+
2122
+ /**
2123
+ * @public
2124
+ */
2125
+ export declare type UsePlayerEvent = <T = any>(eventName: string) => T | null;
2126
+
2127
+ /**
2128
+ * @public
2129
+ */
2130
+ export declare const usePlayerEvent: UsePlayerEvent;
2131
+
2132
+ /**
2133
+ * Is used to mark purchase in recovery state as PAID.
2134
+ *
2135
+ * @return purchaseRecoveryResult - message describing result of the recovery
2136
+ * loading - loading state
2137
+ * error - error in case request failure
2138
+ * purchaseRecovery - functions to execute purchase recovery
2139
+ * @public
2140
+ */
2141
+ export declare function usePurchaseRecovery(): {
2142
+ purchaseRecoveryResult?: string | undefined;
2143
+ loading: boolean;
2144
+ error?: GenericOnCallError | undefined;
2145
+ purchaseRecovery: (monetizationId: string) => void;
2146
+ };
2147
+
2148
+ /**
2149
+ * @public
2150
+ */
2151
+ export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
2152
+
2153
+ /**
2154
+ * Return purchases with initialized video (purchases[i].video not null)
2155
+ * @public
2156
+ */
2157
+ export declare const usePurchasesWithVideos: () => {
2158
+ purchases: Purchase[];
2159
+ };
2160
+
2161
+ /**
2162
+ * @public
2163
+ */
2164
+ export declare type User = {
2165
+ purchases: Purchase[];
2166
+ allPurchases: Purchase[];
2167
+ purchasedVods: Purchase[];
2168
+ purchasedSubscriptions: Purchase[];
2169
+ isPurchasesInitialized: boolean;
2170
+ isSignedIn: boolean;
2171
+ email?: string;
2172
+ type?: UserType;
2173
+ photoURL: string | null;
2174
+ name?: string;
2175
+ authUserId?: string;
2176
+ favorites: any[];
2177
+ watchedPositions: any[];
2178
+ };
2179
+
2180
+ /**
2181
+ * @public
2182
+ */
2183
+ export declare const useRowsInScreen: (screenId: string, options?: PaginationOptions) => {
2184
+ pagination: PaginationInterface<Row> | null;
2185
+ error: Error | null;
2186
+ };
2187
+
2188
+ /**
2189
+ * @public
2190
+ */
2191
+ export declare type UserPayload = Record<string, any>;
2192
+
2193
+ /**
2194
+ * @public
2195
+ */
2196
+ export declare enum UserType {
2197
+ ORGANIZATION_USER = "ORGANIZATION_USER",
2198
+ TIVIO_USER = "TIVIO_USER"
2199
+ }
2200
+
2201
+ /**
2202
+ * @deprecated
2203
+ *
2204
+ * Use app screen
2205
+ * @param screenId - screen ID
2206
+ * @param options - subscribe to screen options
2207
+ * @public
2208
+ */
2209
+ export declare const useScreen: (screenId: string, options?: ScreenOptions | undefined) => never;
2210
+
2211
+ /**
2212
+ * @public
2213
+ */
2214
+ export declare type UseSearch = <T extends ALGOLIA_INDEX_NAME>(indexName: T, options?: UseSearchOptions) => {
2215
+ search: (query: string) => void;
2216
+ pagination: PaginationInterface<UseSearchResult<T>> | null;
2217
+ error: Error | null;
2218
+ isLoading: boolean;
2219
+ lastQuery: string;
2220
+ };
2221
+
2222
+ /**
2223
+ * Full text search that returns entities based on search query.
2224
+ * @param indexName - index that search would be performed on ('videos', 'tags', etc.)
2225
+ * @param options - pagination options
2226
+ * @public
2227
+ */
2228
+ export declare const useSearch: UseSearch;
2229
+
2230
+ /**
2231
+ * @public
2232
+ */
2233
+ export declare type UseSearchOptions = PaginationOptions & Partial<{
2234
+ minQueryLength: number;
2235
+ }>;
2236
+
2237
+ /**
2238
+ * @public
2239
+ */
2240
+ 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;
2241
+
2242
+ /**
2243
+ * Use section
2244
+ * @param sectionId - section id
2245
+ * @public
2246
+ */
2247
+ export declare const useSection: (sectionId: string) => {
2248
+ error: string | null;
2249
+ data: Section | null;
2250
+ };
2251
+
2252
+ /**
2253
+ * Use section in channel
2254
+ * @param channelId - channel id
2255
+ * @param [limit] - sections count, defaults to 10
2256
+ * @public
2257
+ */
2258
+ export declare const useSectionsInChannel: (channelId: string, limit?: number) => {
2259
+ error: Error | null;
2260
+ data: PaginationData<Section> | null;
2261
+ isLoading: boolean;
2262
+ };
2263
+
2264
+ /**
2265
+ * @public
2266
+ */
2267
+ export declare const useSeekState: () => boolean | null;
2268
+
2269
+ /**
2270
+ * Returns videos with given tag ids
2271
+ * @param tagIds - tag ids
2272
+ * @param options - subscription options
2273
+ * @public
2274
+ */
2275
+ export declare const useTaggedVideos: (tagIds: string[], options?: SubscribeToItemsInRowOptions) => {
2276
+ pagination: PaginationInterface<Video> | null;
2277
+ error: Error | null;
2278
+ };
2279
+
2280
+ /**
2281
+ * @public
2282
+ */
2283
+ export declare const useTivioData: () => RemoteBundleState;
2284
+
2285
+ /**
2286
+ * @public
2287
+ */
2288
+ export declare const useTivioReadyData: () => RemoteBundleState | null;
2289
+
2290
+ /**
2291
+ * @public
2292
+ */
2293
+ export declare const useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
2294
+
2295
+ /**
2296
+ * @public
2297
+ */
2298
+ export declare type UseTvChannel = (tvChannelId: string) => {
2299
+ tvChannel: TvChannel | null;
2300
+ error: Error | null;
2301
+ loading: boolean;
2302
+ };
2303
+
2304
+ /**
2305
+ * @public
2306
+ */
2307
+ export declare const useUser: () => {
2308
+ user: User | null;
2309
+ error: string | null;
2310
+ isInitialized: boolean;
2311
+ };
2312
+
2313
+ /**
2314
+ * Use video
2315
+ * @param videoId - video id
2316
+ * @public
2317
+ */
2318
+ export declare const useVideo: (videoId?: string | undefined) => {
2319
+ data: Video | null;
2320
+ error: string | null;
2321
+ };
2322
+
2323
+ /**
2324
+ * Use videos in section
2325
+ * @param sectionId - section id
2326
+ * @param [limit] - videos count, defaults to 10
2327
+ * @public
2328
+ */
2329
+ export declare const useVideosInSection: (sectionId?: string | undefined, limit?: number) => {
2330
+ error: Error | null;
2331
+ data: PaginationData<Video> | null;
2332
+ isLoading: boolean;
2333
+ };
2334
+
2335
+ /**
2336
+ * @public
2337
+ */
2338
+ export declare const useVoucher: (voucherId: string) => {
2339
+ activate: (() => Promise<void>) | null;
2340
+ voucher: Voucher | null;
2341
+ /**
2342
+ * You can check error.details if you need to know error type when you want your own error messages
2343
+ * (can be one of "DOES_NOT_EXIST", "EXPIRED" and "ALREADY_USED").
2344
+ */
2345
+ error: Error | BadRequestError | null;
2346
+ /**
2347
+ * True if voucher has been successfully activated in current session.
2348
+ */
2349
+ activationSuccess: boolean;
2350
+ };
2351
+
2352
+ /**
2353
+ * @public
2354
+ */
2355
+ export declare const useWatchWithoutAdsOffer: () => {
2356
+ canPurchaseWatchWithoutAds: boolean;
2357
+ showPurchaseDialog: () => void;
2358
+ };
2359
+
2360
+ /**
2361
+ * Use widget
2362
+ * @param widgetId - widget id
2363
+ * @public
2364
+ */
2365
+ export declare const useWidget: (widgetId: string) => {
2366
+ error: string;
2367
+ widget: Widget | null;
2368
+ };
2369
+
2370
+ /**
2371
+ * @public
2372
+ */
2373
+ export declare const VAST_PROVIDERS: ({
2374
+ id: VastProvider;
2375
+ name: string;
2376
+ development?: undefined;
2377
+ } | {
2378
+ id: VastProvider;
2379
+ name: string;
2380
+ development: boolean;
2381
+ })[];
2382
+
2383
+ /**
2384
+ * @public
2385
+ */
2386
+ export declare enum VastProvider {
2387
+ CNC_PREBID = "cnc-prebid",
2388
+ ETARGET_PREBID = "etarget-prebid",
2389
+ FALLBACK_HLS = "fallback-hls",
2390
+ FALLBACK_MP4 = "fallback",
2391
+ GARAZ_TV = "garaz.tv",
2392
+ GARAZ_TV_DEV = "garaz.tv.dev",
2393
+ IMPRESSION_MEDIA_PREBID = "impressionMedia-prebid",
2394
+ JOJ = "joj",
2395
+ MALL_TV = "malltv",
2396
+ MALL_TV_PREBID = "malltv-prebid",
2397
+ PRIMA = "prima",
2398
+ TEST = "test"
2399
+ }
2400
+
2401
+ /**
2402
+ * @public
2403
+ */
2404
+ export declare interface Video extends RowItem {
2405
+ id: string;
2406
+ /**
2407
+ * @deprecated use assets instead
2408
+ */
2409
+ cover: string | null;
2410
+ created: Date;
2411
+ sectionId: string | null;
2412
+ channelId: string | null;
2413
+ /**
2414
+ * seconds
2415
+ */
2416
+ duration: number;
2417
+ path: string;
2418
+ tags: Tag[];
2419
+ image: string | null;
2420
+ isPlayable: boolean;
2421
+ monetizations: Monetization[];
2422
+ monetization: Monetization | undefined;
2423
+ transactionId?: string;
2424
+ transaction: Monetization | undefined;
2425
+ subscriptions: Monetization[];
2426
+ subscriptionIds: string[];
2427
+ isPlaylist: boolean;
2428
+ name: string;
2429
+ description?: string;
2430
+ price: number | null;
2431
+ detailedPrice: DetailedPrice | null;
2432
+ uri: string;
2433
+ url: string;
2434
+ adMonetizationId?: string;
2435
+ from?: Date;
2436
+ to?: Date;
2437
+ detailBanner?: string;
2438
+ linkedVideosRaw: any[];
2439
+ linkedVideos: LinkedVideo[];
2440
+ purchasableMonetization: any | null;
2441
+ contentType: VideoContentType | null;
2442
+ year?: number;
2443
+ episodeNumber?: number;
2444
+ seasonNumber?: number;
2445
+ getTagsOfType: (type: string) => Tag[];
2446
+ loadLinkedVideos: () => any;
2447
+ getLinkedVideos: (type: any) => any;
2448
+ trailer: Video | null;
2449
+ watchPosition: number | null;
2450
+ isFavorite: boolean;
2451
+ addToFavorites: () => void;
2452
+ removeFromFavorites: () => void;
2453
+ availability: VideoAvailability | null;
2454
+ }
2455
+
2456
+ /**
2457
+ * @public
2458
+ */
2459
+ export declare type VideoAvailability = {
2460
+ from: Date;
2461
+ to: Date | null;
2462
+ manual: boolean;
2463
+ };
2464
+
2465
+ /**
2466
+ * @public
2467
+ */
2468
+ export declare enum VideoContentType {
2469
+ /**
2470
+ * Default video content type
2471
+ */
2472
+ VIDEO = "VIDEO",
2473
+ FILM = "FILM",
2474
+ SERIES = "SERIES"
2475
+ }
2476
+
2477
+ /**
2478
+ * @public
2479
+ */
2480
+ export declare interface VideoExternals {
2481
+ tvProfiProgramId?: string;
2482
+ tvProfiContentId?: string;
2483
+ tvProfiSerialId?: string;
2484
+ contentId?: string;
2485
+ provysId?: string;
2486
+ mallTvEntityId?: string;
2487
+ /**
2488
+ * DRM content Key ID - should't be more connected with buyDRM or streamOnline? It is not general thing
2489
+ */
2490
+ keyId?: string;
2491
+ }
2492
+
2493
+ declare type VideoPath = string;
2494
+
2495
+ /**
2496
+ * @public
2497
+ */
2498
+ export declare const VideosContext: React_2.Context<DataState<Video>>;
2499
+
2500
+ /**
2501
+ * Video type.
2502
+ * @public
2503
+ */
2504
+ export declare enum VideoType {
2505
+ /**
2506
+ * Video is composed of several other videos.
2507
+ */
2508
+ PLAYLIST = "PLAYLIST",
2509
+ /**
2510
+ * Video is a standard single video.
2511
+ */
2512
+ VIDEO = "VIDEO",
2513
+ TV_PROGRAM = "TV_PROGRAM"
2514
+ }
2515
+
2516
+ /**
2517
+ * @public
2518
+ */
2519
+ export declare type VodExternalSource = {
2520
+ new (uri: string, monetizationId: string, name: string, description: string, originalOptions: Record<string, any>): VodTivioSource;
2521
+ type: 'vod_external';
2522
+ description: string;
2523
+ name: string;
2524
+ uri: string;
2525
+ };
2526
+
2527
+ /**
2528
+ * @public
2529
+ */
2530
+ export declare type VodTivioSource = {
2531
+ new (uri: string, videoId: string, name: string, description: string, adMonetizationId?: string): VodTivioSource;
2532
+ type: 'vod_tivio';
2533
+ description: string;
2534
+ name: string;
2535
+ uri: string;
2536
+ };
2537
+
2538
+ declare interface VodTivioSourcePojo {
2539
+ type: 'VodTivioSource';
2540
+ description: string;
2541
+ path: string;
2542
+ name: string;
2543
+ uri: string;
2544
+ poster?: string;
2545
+ adMonetizationId?: string;
2546
+ availability: VideoAvailability | null;
2547
+ }
2548
+
2549
+ /**
2550
+ * TODO: Should be in core-js, we can't import types from it, though.
2551
+ */
2552
+ declare type Voucher = {
2553
+ activate: () => void;
2554
+ isUsed: boolean;
2555
+ isExpired: boolean;
2556
+ status: 'NEW' | 'USED';
2557
+ voucherInfo: SubscriptionInfo | TransactionInfo;
2558
+ };
2559
+
2560
+ /**
2561
+ * @public
2562
+ */
2563
+ export declare interface WebPlayerProps {
2564
+ id: string;
2565
+ source?: VodTivioSourcePojo | ChannelSourcePojo | VideoPath | null;
2566
+ onEnded?: () => any;
2567
+ /**
2568
+ * If this function is specified, then "Back" button is shown in top right corner.
2569
+ */
2570
+ onBack?: () => void;
2571
+ className?: string;
2572
+ /**
2573
+ * default false
2574
+ *
2575
+ * If you choose `autoplay` make sure that autoplay is allowed in the specific situation.
2576
+ * In some cases it may not be allowed, e.g. before the user interacted with the site, and the video
2577
+ * will stay paused.
2578
+ *
2579
+ * Source: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
2580
+ */
2581
+ autoplay?: boolean;
2582
+ /**
2583
+ * default false
2584
+ */
2585
+ canReplay?: boolean;
2586
+ /**
2587
+ * default false
2588
+ */
2589
+ showMarkers?: boolean;
2590
+ /**
2591
+ * number[] is array of keyboard event.which numeric codes
2592
+ * (see https://keycode.info/)
2593
+ */
2594
+ customShortcuts?: Partial<{
2595
+ toggleFullscreen: number[];
2596
+ togglePause: number[];
2597
+ toggleMute: number[];
2598
+ jumpForward: number[];
2599
+ jumpBack: number[];
2600
+ volumeUp: number[];
2601
+ volumeDown: number[];
2602
+ }>;
2603
+ /**
2604
+ * default true
2605
+ */
2606
+ enableKeyboardShortcuts?: boolean;
2607
+ onProgress?: (event: React_2.ChangeEvent<HTMLVideoElement>) => void;
2608
+ /**
2609
+ * @deprecated this callback is never called. Will be removed in @tivio/sdk-react version 4
2610
+ */
2611
+ onPlayerControllerCreated?: (playerController: any) => void;
2612
+ }
2613
+
2614
+ /**
2615
+ * @public
2616
+ */
2617
+ export declare type WebRowProps = {
2618
+ items?: ItemsInRow[];
2619
+ variant?: RowItemComponent;
2620
+ rowName?: string | any;
2621
+ fetchMore?: () => void;
2622
+ onTileClick?: (item: ItemsInRow) => void;
2623
+ };
2624
+
2625
+ /**
2626
+ * @public
2627
+ */
2628
+ export declare type WebSeriesDetailScreenProps = {
2629
+ tagId: string;
2630
+ };
2631
+
2632
+ /**
2633
+ * @public
2634
+ */
2635
+ export declare interface WhereFilter {
2636
+ field: string;
2637
+ operator: WhereFilterOp;
2638
+ value: any;
2639
+ }
2640
+
2641
+ declare type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
2642
+
2643
+ /**
2644
+ * @public
2645
+ */
2646
+ export declare type Widget = {
2647
+ id: string;
2648
+ channels: Channel[];
2649
+ isEnabled: boolean | null;
2650
+ name: string | null;
2651
+ recentVideos: Video[] | null;
2652
+ widgetId: string | null;
2653
+ lastVideo: Video | null;
2654
+ };
2655
+
2656
+ /**
2657
+ * @public
2658
+ */
2659
+ export declare function withPlayerContext(id: string): <P>(WrappedComponent: React_2.ComponentType<P>) => (props: P) => JSX.Element;
2660
+
2661
+ export { }