@tivio/sdk-js 2.0.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,4 +25,5 @@ export declare const fetchBundleViaResolver: (conf: InternalConf) => Promise<str
25
25
  * Fetch & load CommonJS remote module.
26
26
  */
27
27
  export declare const createRemotePackageLoader: () => (conf: InternalConf) => Promise<TivioBundle>;
28
+ export declare let tivioBundle: RemoteBundleState | null;
28
29
  export declare const createTivio: () => (conf: Conf) => Promise<RemoteBundleState>;
@@ -0,0 +1,6 @@
1
+ declare type Result = Promise<{
2
+ startTimestamp?: number;
3
+ endTimestamp?: number;
4
+ } | null>;
5
+ export declare const getProgramTimestamps: (channelName: string, epgFrom: Date, epgTo: Date) => Result;
6
+ export {};
@@ -1,5 +1,5 @@
1
- import { AdMetadata, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventType, Source, TivioPlayerWrapper } from '../api.types';
2
1
  import { InternalPlayerWrapper } from './playerWrapperInternal';
2
+ import type { ListenerAdMetadata, ListenerMarkers, PlayerInterfaceForPlayerWrapper, Source, TivioPlayerWrapper } from '../api.types';
3
3
  import type { CreatePlayerWrapperType } from './playerWrapperInternal';
4
4
  /**
5
5
  * Player wrapper which instances are exposed to SDK user.
@@ -7,7 +7,8 @@ import type { CreatePlayerWrapperType } from './playerWrapperInternal';
7
7
  export declare class PlayerWrapper implements TivioPlayerWrapper {
8
8
  private internalPlayerWrapper;
9
9
  constructor(internalPlayerWrapper: InternalPlayerWrapper);
10
- addEventListener(eventType: PlayerWrapperEventType.adMetadata, listener: (metadata: AdMetadata) => void): void;
10
+ addEventListener(eventType: 'adMetadata', listener: ListenerAdMetadata): void;
11
+ addEventListener(eventType: 'markers', listener: ListenerMarkers): void;
11
12
  reportError(error: Error): void;
12
13
  reportPlaybackEnded(): void;
13
14
  reportTimeProgress(ms: number): void;
@@ -17,13 +18,11 @@ export declare class PlayerWrapper implements TivioPlayerWrapper {
17
18
  /**
18
19
  * Called when tivio is initialized (remote bundle is ready).
19
20
  *
20
- * @param {CreatePlayerWrapperType} createPlayerWrapper - functions which creates player wrapper in core-js
21
+ * @param {CreatePlayerWrapperType} createPlayerWrapperFromCoreJs - functions which creates player wrapper in core-js
21
22
  */
22
- export declare const onCreatePlayerWrapperReady: (createPlayerWrapper: CreatePlayerWrapperType) => void;
23
+ export declare const onCreatePlayerWrapperReady: (createPlayerWrapperFromCoreJs: CreatePlayerWrapperType) => void;
23
24
  /**
24
- * Public method accessible in SDK.
25
- *
26
- * @param {PlayerInterfaceForPlayerWrapper} playerImplementation - player implementation from SDK user
25
+ * @param {PlayerInterfaceForPlayerWrapper} playerImplementation - player implementation
27
26
  * @returns player wrapper instance
28
27
  */
29
28
  export declare const createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => PlayerWrapper;
@@ -1,4 +1,4 @@
1
- import { AdMetadata, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventType, Source, TivioPlayerWrapper } from '../api.types';
1
+ import type { Listener, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventTypeType, Source, TivioPlayerWrapper } from '../api.types';
2
2
  export declare type CreatePlayerWrapperType = (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
3
3
  /**
4
4
  * Responsible for handling of all player wrapper methods (it's called through PlayerWrapper).
@@ -9,11 +9,11 @@ export declare class InternalPlayerWrapper implements TivioPlayerWrapper {
9
9
  private id;
10
10
  corePlayerWrapperInstance: TivioPlayerWrapper | null;
11
11
  listenersWaitingToRegister: {
12
- eventType: PlayerWrapperEventType.adMetadata;
13
- listener: (metadata: AdMetadata) => void;
12
+ eventType: PlayerWrapperEventTypeType;
13
+ listener: Listener;
14
14
  }[];
15
15
  constructor(playerImplementation: PlayerInterfaceForPlayerWrapper, id: string);
16
- addEventListener(eventType: PlayerWrapperEventType.adMetadata, listener: (metadata: AdMetadata) => void): void;
16
+ addEventListener(eventType: PlayerWrapperEventTypeType, listener: Listener): void;
17
17
  reportError(error: Error): void;
18
18
  reportPlaybackEnded(): void;
19
19
  reportTimeProgress(ms: number): void;
package/dist/types.d.ts CHANGED
@@ -7,6 +7,6 @@
7
7
  */
8
8
  import { InternalConf } from './conf';
9
9
  export { PlayerCapability } from './conf';
10
- export declare type Conf = Pick<InternalConf, 'capabilitiesOptions' | 'deviceCapabilities' | 'enableSentry' | 'forceCloudFnResolver' | 'language' | 'logger' | 'secret'>;
10
+ export declare type Conf = Pick<InternalConf, 'bundleUrlOverride' | 'capabilitiesOptions' | 'deviceCapabilities' | 'enableSentry' | 'forceCloudFnResolver' | 'language' | 'logger' | 'secret' | 'verbose'>;
11
11
  export declare type Empty = Promise<void> | void;
12
12
  export declare type Disposer = () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-js",
3
- "version": "2.0.0",
3
+ "version": "2.2.1",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@sentry/browser": "^6.1.0",
21
- "es7-object-polyfill": "^1.0.1",
21
+ "core-js": "^3.21.0",
22
22
  "firebase": "^8.2.3",
23
23
  "mobx": "^6.0.4",
24
24
  "whatwg-fetch": "^3.6.2"
@@ -34,6 +34,7 @@
34
34
  "dotenv": "^8.2.0",
35
35
  "dotenv-webpack": "^7.0.3",
36
36
  "eslint": "^7.19.0",
37
+ "fork-ts-checker-webpack-plugin": "^7.0.0",
37
38
  "jest": "^26.6.3",
38
39
  "jest-cli": "^26.6.3",
39
40
  "jest-fetch-mock": "^3.0.3",