@tivio/sdk-react 9.1.3-alpha2 → 9.1.3-alpha4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/distTypes/components/ContextProvider.d.ts +8 -0
  2. package/dist/distTypes/components/PlayerProvider.d.ts +28 -0
  3. package/dist/distTypes/components/TivioProvider.d.ts +24 -0
  4. package/dist/distTypes/components/TivioWidget.d.ts +10 -0
  5. package/dist/distTypes/components/TivioWidgetError.d.ts +13 -0
  6. package/dist/distTypes/components/TivioWidgetLoader.d.ts +9 -0
  7. package/dist/distTypes/components/TvTivioProvider.d.ts +10 -0
  8. package/dist/distTypes/components/hooks/index.d.ts +19 -0
  9. package/dist/distTypes/components/hooks/playerHooks.d.ts +43 -0
  10. package/dist/distTypes/components/hooks/useApplyInviteCode.d.ts +18 -0
  11. package/dist/distTypes/components/hooks/useCancelSubscription.d.ts +5 -0
  12. package/dist/distTypes/components/hooks/useChannelSource.d.ts +13 -0
  13. package/dist/distTypes/components/hooks/useError.d.ts +10 -0
  14. package/dist/distTypes/components/hooks/useIsLoaded.d.ts +6 -0
  15. package/dist/distTypes/components/hooks/useIsMonetizationPurchased.d.ts +6 -0
  16. package/dist/distTypes/components/hooks/useItemsInRow.d.ts +11 -0
  17. package/dist/distTypes/components/hooks/useOrganizationSubscriptions.d.ts +11 -0
  18. package/dist/distTypes/components/hooks/usePurchaseRecovery.d.ts +15 -0
  19. package/dist/distTypes/components/hooks/usePurchaseSubscription.d.ts +5 -0
  20. package/dist/distTypes/components/hooks/useRowsInScreen.d.ts +8 -0
  21. package/dist/distTypes/components/hooks/useSearch.d.ts +8 -0
  22. package/dist/distTypes/components/hooks/useTaggedVideos.d.ts +11 -0
  23. package/dist/distTypes/components/hooks/useTivio.d.ts +8 -0
  24. package/dist/distTypes/components/hooks/useTransactionPayment.d.ts +5 -0
  25. package/dist/distTypes/components/hooks/useTvChannel.d.ts +10 -0
  26. package/dist/distTypes/components/hooks/useUser.d.ts +9 -0
  27. package/dist/distTypes/components/hooks/useVideo.d.ts +9 -0
  28. package/dist/distTypes/components/hooks/useVoucher.d.ts +48 -0
  29. package/dist/distTypes/config.d.ts +22 -0
  30. package/dist/distTypes/index.d.ts +21 -0
  31. package/dist/distTypes/info.d.ts +5 -0
  32. package/dist/distTypes/services/bundleLoader.d.ts +19 -0
  33. package/dist/distTypes/services/bundlePromise.d.ts +8 -0
  34. package/dist/distTypes/services/dependencyResolver.d.ts +17 -0
  35. package/dist/distTypes/services/gdpr.d.ts +4 -0
  36. package/dist/distTypes/services/localFetch/coreReactDomDist.d.ts +1 -0
  37. package/dist/distTypes/services/localFetch/none.d.ts +1 -0
  38. package/dist/distTypes/services/logger.d.ts +26 -0
  39. package/dist/distTypes/services/login.d.ts +9 -0
  40. package/dist/distTypes/services/packageLoader.d.ts +6 -0
  41. package/dist/distTypes/services/pubSub.d.ts +17 -0
  42. package/dist/distTypes/services/sentry.d.ts +4 -0
  43. package/dist/distTypes/types/bundle.types.d.ts +88 -0
  44. package/dist/distTypes/types/common.d.ts +14 -0
  45. package/dist/distTypes/types/config.types.d.ts +0 -0
  46. package/dist/distTypes/types/types.d.ts +19 -0
  47. package/dist/index.js +1 -1
  48. package/package.json +3 -3
  49. package/dist/index.d.ts +0 -6829
  50. package/dist/sdk-react.d.ts +0 -7177
@@ -0,0 +1,88 @@
1
+ import { LangCode } from '@tivio/types';
2
+ import { ComponentType } from 'react';
3
+ import { Logger } from '../services/logger';
4
+ import { FetchPackage } from '../services/packageLoader';
5
+ import { Disposer, Empty, Nullable } from './common';
6
+ import type { TivioConfig, TivioReactBundle } from '@tivio/types';
7
+ /**
8
+ * Config of sdk-react. Contains all properties that can be passed via TivioProvider.
9
+ * Consists of TivioConfig's properties + "sdk only" properties, that are used only in sdk, not in bundle.
10
+ *
11
+ * @public
12
+ */
13
+ export type SdkReactConfig = Omit<TivioConfig, 'language'> & {
14
+ disableUnmounting?: boolean;
15
+ enable?: boolean;
16
+ enableSentry?: boolean;
17
+ ErrorComponent?: ComponentType<{
18
+ error: string | null;
19
+ }>;
20
+ LoaderComponent?: ComponentType;
21
+ logger?: Logger | null;
22
+ /**
23
+ * language is required for bundle init (TivioConfig), but it can be set to default EN on SDK side, so here it's optional.
24
+ */
25
+ language?: LangCode;
26
+ };
27
+ /**
28
+ * Just another alias. Reexported for backward compatibility.
29
+ * @public
30
+ */
31
+ export type Config = SdkReactConfig;
32
+ /**
33
+ * @public
34
+ */
35
+ export type InternalConfig = SdkReactConfig & {
36
+ fetchPackage: FetchPackage;
37
+ pubSub: PubSub;
38
+ /**
39
+ * @private URL of resolver. Resolver is a script used to fetch remote code bundle
40
+ */
41
+ resolverUrl: string;
42
+ sdkVersion: string;
43
+ /**
44
+ * @private URL of remote code bundle to be fetched directly (without using resolver)
45
+ */
46
+ bundleUrlOverride?: string;
47
+ /**
48
+ * @private
49
+ * Run HTML, CSS and JS feature support check
50
+ */
51
+ runFeatureSupportCheck?: boolean;
52
+ /**
53
+ * @private
54
+ */
55
+ forceCloudFnResolver?: boolean;
56
+ };
57
+ /**
58
+ * @public
59
+ */
60
+ export type Events = {
61
+ 'on-ready': RemoteBundleState;
62
+ 'on-error': Error;
63
+ };
64
+ /**
65
+ * @public
66
+ */
67
+ export interface PubSub {
68
+ publish: <K extends keyof Events>(triggerName: K, payload: Events[K]) => Empty;
69
+ subscribe: <K extends keyof Events>(triggerName: K, onMessage: (data: Events[K]) => Empty) => Disposer;
70
+ }
71
+ /**
72
+ * @public
73
+ */
74
+ export type TivioBundle = TivioReactBundle;
75
+ /**
76
+ * @public
77
+ */
78
+ export type TivioBundleFile = {
79
+ Tivio: TivioBundle;
80
+ };
81
+ /**
82
+ * @public
83
+ */
84
+ export type RemoteBundleState = {
85
+ config: InternalConfig;
86
+ error: string | null;
87
+ state: 'loading' | 'error' | 'ready';
88
+ } & Nullable<TivioBundle>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export type Nullable<T> = {
5
+ [P in keyof T]: T[P] | null;
6
+ };
7
+ /**
8
+ * @public
9
+ */
10
+ export type Empty = void | Promise<void> | undefined | Promise<undefined>;
11
+ /**
12
+ * @public
13
+ */
14
+ export type Disposer = () => void;
File without changes
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export type Chapter = any;
5
+ /**
6
+ * @public
7
+ */
8
+ export type BetOffer = {
9
+ betService: string;
10
+ league: string;
11
+ odds: {
12
+ winner: string;
13
+ rate: number;
14
+ }[];
15
+ sport: string;
16
+ opponent1: string;
17
+ opponent2: string;
18
+ time: Date;
19
+ };