@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,8 @@
1
+ import React from 'react';
2
+ import type { RemoteBundleState } from '../types/bundle.types';
3
+ interface Props {
4
+ bundleState: RemoteBundleState;
5
+ children?: React.ReactNode;
6
+ }
7
+ declare const ContextProvider: React.FC<Props>;
8
+ export { ContextProvider, };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React, { FunctionComponentElement } from 'react';
6
+ import type { PlayerWrapper } from '@tivio/types';
7
+ /**
8
+ * @public
9
+ */
10
+ export type PlayerProviderProps = {
11
+ children: React.ReactNode;
12
+ playerWrapperId?: string;
13
+ };
14
+ /**
15
+ * value
16
+ * - undefined - you are trying to access this context but are not inside <PlayerContext /> that is a bug
17
+ * - null - we are waiting for remote code
18
+ * - Player - player is ready
19
+ */
20
+ export declare const PlayerContext: React.Context<PlayerWrapper | null | undefined>;
21
+ /**
22
+ * @public
23
+ */
24
+ export declare const PlayerProvider: ({ children, playerWrapperId, }: PlayerProviderProps) => FunctionComponentElement<PlayerProviderProps>;
25
+ /**
26
+ * @public
27
+ */
28
+ export declare function withPlayerContext(id: string): <P extends JSX.IntrinsicAttributes>(WrappedComponent: React.ComponentType<P>) => (props: P) => React.JSX.Element;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ import type { RemoteBundleState, SdkReactConfig } from '../types/bundle.types';
7
+ /**
8
+ * @public
9
+ */
10
+ export type TivioProviderProps = {
11
+ /**
12
+ * This prop must be set only once and not change value afterwards
13
+ */
14
+ conf: SdkReactConfig | undefined | null;
15
+ children: React.ReactNode;
16
+ };
17
+ /**
18
+ * @public
19
+ */
20
+ export declare const TivioContext: React.Context<RemoteBundleState | null>;
21
+ /**
22
+ * @public
23
+ */
24
+ export declare const TivioProvider: React.FC<TivioProviderProps>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ import type { TivioWidgetProps, TivioWidgetRef } from '@tivio/types';
7
+ /**
8
+ * @public
9
+ */
10
+ export declare const TivioWidget: React.ForwardRefExoticComponent<Omit<TivioWidgetProps, "ref"> & React.RefAttributes<TivioWidgetRef>>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ type TivioWidgetErrorProps = {
7
+ error: string | null;
8
+ };
9
+ /**
10
+ * @public
11
+ */
12
+ export declare const TivioWidgetError: React.FC<TivioWidgetErrorProps>;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ /**
7
+ * @public
8
+ */
9
+ export declare const TivioWidgetLoader: React.FC;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ import { TivioProviderProps } from './TivioProvider';
7
+ /**
8
+ * @public
9
+ */
10
+ export declare const TvTivioProvider: React.FC<TivioProviderProps>;
@@ -0,0 +1,19 @@
1
+ export * from './useUser';
2
+ export * from './useTaggedVideos';
3
+ export * from './useSearch';
4
+ export * from './useItemsInRow';
5
+ export * from './useCancelSubscription';
6
+ export * from './useTransactionPayment';
7
+ export * from './usePurchaseRecovery';
8
+ export * from './usePurchaseSubscription';
9
+ export * from './useVideo';
10
+ export * from './playerHooks';
11
+ export * from './useOrganizationSubscriptions';
12
+ export * from './useIsMonetizationPurchased';
13
+ export * from './useRowsInScreen';
14
+ export * from './useVoucher';
15
+ export * from './useTivio';
16
+ export * from './useApplyInviteCode';
17
+ export * from './useIsLoaded';
18
+ export * from './useChannelSource';
19
+ export * from './useTvChannel';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import type { Marker } from '@tivio/types';
6
+ /**
7
+ * @public
8
+ */
9
+ export declare const useMarkers: () => Marker[] | null;
10
+ interface IntroMarker {
11
+ marker: Marker;
12
+ skip: () => void;
13
+ }
14
+ /**
15
+ * @public
16
+ */
17
+ export declare const useIntro: () => IntroMarker | null;
18
+ /**
19
+ * @public
20
+ */
21
+ export declare const useAd: () => import("@tivio/types").AdExternal | null;
22
+ /**
23
+ * @public
24
+ */
25
+ export declare const useCurrentMarker: () => Marker | null;
26
+ /**
27
+ * @public
28
+ */
29
+ export declare const useSeekState: () => boolean | null;
30
+ /**
31
+ * @public
32
+ */
33
+ export declare const useAdSegment: () => {
34
+ id: string;
35
+ remainingMs: number;
36
+ secondsToEnd: number;
37
+ secondsToSkippable: number | null;
38
+ canSeek: boolean;
39
+ canSkip: boolean;
40
+ isSkippable: boolean;
41
+ skip: () => any;
42
+ } | null;
43
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Is used to login user through different device in which user is already logged in.
3
+ * (e.g. login in tv app through web app)
4
+ *
5
+ * @return applyInviteCodeResult - true if code was applied successfully, false otherwise.
6
+ * loading - loading state
7
+ * error - error in case request failure
8
+ * applyInviteCode - function to apply invite code
9
+ * inviteCodeReset - function to reset to initial state
10
+ * @public
11
+ */
12
+ export declare function useApplyInviteCode(): {
13
+ applyInviteCodeResult?: boolean | undefined;
14
+ loading: boolean;
15
+ error?: import("@tivio/types").GenericOnCallError | undefined;
16
+ applyInviteCode: (code: string) => void;
17
+ inviteCodeReset: () => void;
18
+ };
@@ -0,0 +1,5 @@
1
+ import { UseCancelSubscription } from '@tivio/types';
2
+ /**
3
+ * @public
4
+ */
5
+ export declare const useCancelSubscription: UseCancelSubscription;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Use channel source
3
+ * @param tvChannelId
4
+ * @deprecated No longer used. Pass channel path to 'WebPlayer.source' prop instead. Path can be obtained with useTvChannel hook.
5
+ * @public
6
+ */
7
+ export declare const useChannelSource: (tvChannelId: string) => {
8
+ source: string;
9
+ error: Error | null;
10
+ } | {
11
+ error: null;
12
+ source: null;
13
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Hook for displaying errors in UI components
3
+ * @public
4
+ */
5
+ declare const useError: () => {
6
+ error: Error | null;
7
+ raiseError: (error: Error) => void;
8
+ resetError: () => void;
9
+ };
10
+ export { useError, };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export declare const useIsLoaded: () => {
5
+ isTivioLoaded: boolean;
6
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export declare const useIsMonetizationPurchased: () => {
5
+ isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
6
+ };
@@ -0,0 +1,11 @@
1
+ import { UseItemsInRow } from '@tivio/types';
2
+ /**
3
+ * Use row items
4
+ * @param rowId - row ID
5
+ * @param options - subscription options
6
+ * @public
7
+ */
8
+ export declare const useItemsInRow: ({ rowId, organizationId, options, }: UseItemsInRow) => {
9
+ pagination: import("@tivio/types").PaginationInterface<import("@tivio/types").ItemInRow> | null;
10
+ error: Error | null;
11
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @public
3
+ *
4
+ * @param onlyPurchasableSubscriptions When it is true, it returns only enabled subscriptions.
5
+ * @param videoId If it is not defined returns all subscriptions except one time payment.
6
+ * When it is set, returns only subscriptions which is described in tagIds for video.
7
+ * @returns Array of subscriptions according to set parameters
8
+ */
9
+ export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions?: boolean, videoId?: string) => {
10
+ subscriptions: import("@tivio/types").PurchasableMonetization[];
11
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Is used to mark purchase in recovery state as PAID.
3
+ *
4
+ * @return purchaseRecoveryResult - message describing result of the recovery
5
+ * loading - loading state
6
+ * error - error in case request failure
7
+ * purchaseRecovery - functions to execute purchase recovery
8
+ * @public
9
+ */
10
+ export declare function usePurchaseRecovery(): {
11
+ purchaseRecoveryResult?: string | undefined;
12
+ loading: boolean;
13
+ error?: import("@tivio/types").GenericOnCallError | undefined;
14
+ purchaseRecovery: (monetizationId: string) => void;
15
+ };
@@ -0,0 +1,5 @@
1
+ import { NewVoucher, QerkoTransaction } from '@tivio/types';
2
+ /**
3
+ * @public
4
+ */
5
+ export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
@@ -0,0 +1,8 @@
1
+ import { PaginationInterface, PaginationOptions, Row } from '@tivio/types';
2
+ /**
3
+ * @public
4
+ */
5
+ export declare const useRowsInScreen: (screenId: string, options?: PaginationOptions) => {
6
+ pagination: PaginationInterface<Row> | null;
7
+ error: Error | null;
8
+ };
@@ -0,0 +1,8 @@
1
+ import { UseSearch } from '@tivio/types';
2
+ /**
3
+ * Full text search that returns entities based on search query.
4
+ * @param indexName - index that search would be performed on ('videos', 'tags', etc.)
5
+ * @param options - pagination options
6
+ * @public
7
+ */
8
+ export declare const useSearch: UseSearch;
@@ -0,0 +1,11 @@
1
+ import { PaginationInterface, SubscribeToTaggedVideosOptions, Video } from '@tivio/types';
2
+ /**
3
+ * Returns videos with given tag ids
4
+ * @param tagIds - tag ids
5
+ * @param options - subscription options
6
+ * @public
7
+ */
8
+ export declare const useTaggedVideos: (tagIds: string[], options?: SubscribeToTaggedVideosOptions) => {
9
+ pagination: PaginationInterface<Video> | null;
10
+ error: Error | null;
11
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export declare const useTivioData: () => import("../..").RemoteBundleState;
5
+ /**
6
+ * @public
7
+ */
8
+ export declare const useTivioReadyData: () => import("../..").RemoteBundleState | null;
@@ -0,0 +1,5 @@
1
+ import { NewVoucher, QerkoTransaction } from '@tivio/types';
2
+ /**
3
+ * @public
4
+ */
5
+ export declare const useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Use Tv channel
3
+ * @param tvChannelId
4
+ * @public
5
+ */
6
+ export declare const useTvChannel: (tvChannelId: string) => {
7
+ tvChannel: import("@tivio/types").TvChannel | null;
8
+ error: Error | null;
9
+ loading: boolean;
10
+ } | undefined;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export declare const useUser: () => {
5
+ user: import("@tivio/types").User | null;
6
+ error: string | null;
7
+ isInitialized: boolean;
8
+ isSignedIn: boolean;
9
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Use video
3
+ * @param videoIdOrUrlName - video id or video nice url (e.g. some-interesting-video)
4
+ * @public
5
+ */
6
+ export declare const useVideo: (videoIdOrUrlName?: string) => {
7
+ data: import("@tivio/types/dist/types/externalTypes/video").Video | null;
8
+ error: string | null;
9
+ };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export type BadRequestError = Error & {
5
+ details?: {
6
+ reason?: 'DOES_NOT_EXIST' | 'EXPIRED' | 'ALREADY_USED' | 'ALREADY_USED_BY_CURRENT_USER';
7
+ };
8
+ };
9
+ /**
10
+ * TODO: Should be in core-js, we can't import types from it, though.
11
+ */
12
+ type Voucher = {
13
+ activate: () => void;
14
+ isUsed: boolean;
15
+ isExpired: boolean;
16
+ status: 'NEW' | 'USED';
17
+ voucherInfo: SubscriptionInfo | TransactionInfo;
18
+ };
19
+ type SubscriptionInfo = {
20
+ type: 'subscription';
21
+ name: string;
22
+ benefits: string[];
23
+ frequency: string;
24
+ };
25
+ type TransactionInfo = {
26
+ type: 'transaction';
27
+ name: string;
28
+ videoId: string;
29
+ cover: string;
30
+ description: string;
31
+ };
32
+ /**
33
+ * @public
34
+ */
35
+ export declare const useVoucher: (voucherId: string) => {
36
+ activate: (() => Promise<void>) | null;
37
+ voucher: Voucher | null;
38
+ /**
39
+ * You can check error.details if you need to know error type when you want your own error messages
40
+ * (can be one of "DOES_NOT_EXIST", "EXPIRED", "ALREADY_USED_BY_CURRENT_USER" and "ALREADY_USED").
41
+ */
42
+ error: Error | BadRequestError | null;
43
+ /**
44
+ * True if voucher has been successfully activated in current session.
45
+ */
46
+ activationSuccess: boolean;
47
+ };
48
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ /// <reference types="react" />
6
+ import { LangCode } from '@tivio/types';
7
+ import type { SdkReactConfig as ExternalConfig, InternalConfig } from './types/bundle.types';
8
+ import type { Currency } from '@tivio/types';
9
+ export declare const defaultConf: {
10
+ secret: string;
11
+ resolverUrl: string;
12
+ currency: Currency;
13
+ language: LangCode;
14
+ disableUnmounting: boolean;
15
+ fetchPackage: import("./services/packageLoader").FetchPackage;
16
+ pubSub: import("./types/bundle.types").PubSub;
17
+ LoaderComponent: import("react").FC<{}>;
18
+ ErrorComponent: import("react").FC<{
19
+ error: string | null;
20
+ }>;
21
+ };
22
+ export declare const createInternalConf: (conf: ExternalConfig | undefined | null) => InternalConfig;
@@ -0,0 +1,21 @@
1
+ import 'whatwg-fetch';
2
+ import 'es7-object-polyfill';
3
+ export { PlayerProvider, withPlayerContext } from './components/PlayerProvider';
4
+ export type { PlayerProviderProps } from './components/PlayerProvider';
5
+ export { bundlePromise } from './services/bundlePromise';
6
+ export * from './components/hooks';
7
+ export * from './components/TivioProvider';
8
+ export * from './components/TivioWidget';
9
+ export * from './components/TivioWidgetError';
10
+ export * from './components/TvTivioProvider';
11
+ export * from './components/TivioWidgetLoader';
12
+ export * from './services/bundleLoader';
13
+ export * from './services/pubSub';
14
+ export * from './types/types';
15
+ export { Disposer } from './types/common';
16
+ export { Empty } from './types/common';
17
+ export { Nullable } from './types/common';
18
+ export * from './types/bundle.types';
19
+ export { setUser } from './services/login';
20
+ export { showGdprConsentPreferences } from './services/gdpr';
21
+ export * from '@tivio/types';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @public
3
+ */
4
+ declare const logInfo: () => void;
5
+ export { logInfo };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import type { InternalConfig, RemoteBundleState, TivioBundle } from '../types/bundle.types';
6
+ /**
7
+ * @throws if fetch fails
8
+ * @public
9
+ */
10
+ export declare const fetchBundle: (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<string>;
11
+ /**
12
+ * Fetch & load CommonJS remote module.
13
+ * @public
14
+ */
15
+ export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
16
+ /**
17
+ * @public
18
+ */
19
+ export declare const createUseRemoteBundle: () => (conf: InternalConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
@@ -0,0 +1,8 @@
1
+ import { TivioBundle } from '../types/bundle.types';
2
+ import type { RemoteBundleState } from '../types/bundle.types';
3
+ export declare let tivioBundle: TivioBundle | null;
4
+ /**
5
+ * rejects when bundle is not available
6
+ * @public
7
+ */
8
+ export declare const bundlePromise: Promise<RemoteBundleState>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import * as materialUiCore from '@material-ui/core';
6
+ import * as materialUiIcons from '@material-ui/icons';
7
+ import * as formik from 'formik';
8
+ import * as mobx from 'mobx';
9
+ import * as mobxReact from 'mobx-react';
10
+ import * as react from 'react';
11
+ import * as reactDom from 'react-dom';
12
+ import * as reactRouterDom from 'react-router-dom';
13
+ import * as reactVirtualized from 'react-virtualized';
14
+ import * as styledComponents from 'styled-components';
15
+ import * as yup from 'yup';
16
+ export type SharedDependency = typeof react | typeof reactDom | typeof mobx | typeof styledComponents | typeof materialUiCore | typeof materialUiIcons | typeof formik | typeof reactRouterDom | typeof reactVirtualized | typeof yup | typeof mobxReact | null;
17
+ export declare const resolveShared: (name: string) => SharedDependency;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export declare const showGdprConsentPreferences: () => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const loadBundleFromDist: () => import("@tivio/types").TivioReactBundle;
@@ -0,0 +1 @@
1
+ export declare const loadBundleFromDist: () => void;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ export type LoggerArgs = any[];
6
+ export interface Logger {
7
+ /** important messages */
8
+ warn(...data: LoggerArgs): void;
9
+ /** errors */
10
+ error(...data: LoggerArgs): void;
11
+ /** critical errors */
12
+ exception(...data: LoggerArgs): void;
13
+ /** metrics */
14
+ info(...data: LoggerArgs): void;
15
+ /** non-production messages */
16
+ debug(...data: LoggerArgs): void;
17
+ }
18
+ export type LoggerConf = {
19
+ isConsoleEnabled: boolean;
20
+ isSentryEnabled?: boolean;
21
+ };
22
+ export type Severity = 'warn' | 'error' | 'info' | 'debug';
23
+ /**
24
+ * Factory
25
+ **/
26
+ export declare const createLogger: (conf: LoggerConf) => Logger;
@@ -0,0 +1,9 @@
1
+ import type { UserPayload } from '@tivio/types';
2
+ /**
3
+ * Set user to sign in/out.
4
+ *
5
+ * Sign in - setUser('userID', { token: 'xxx' })
6
+ * Sign out - setUser(null)
7
+ * @public
8
+ */
9
+ export declare const setUser: (userId: string | null, payload?: UserPayload) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ export type FetchPackage = (url: string) => Promise<string>;
6
+ export declare const fetchPackage: FetchPackage;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ /**
6
+ * Export Tivio Events API
7
+ */
8
+ import { PubSub } from '../types/bundle.types';
9
+ /**
10
+ * @public
11
+ */
12
+ export declare const createPubSub: () => PubSub;
13
+ /**
14
+ * Share singleton instance
15
+ * @public
16
+ */
17
+ export declare const getPubSub: () => PubSub;
@@ -0,0 +1,4 @@
1
+ import * as _Sentry from '@sentry/browser';
2
+ export declare let Sentry: null | typeof _Sentry;
3
+ export declare const disableSentry: () => void;
4
+ export declare const initSentry: () => void;