@vkontakte/videoplayer-statistics 1.0.100-dev.04f0bb5f.0 → 1.0.100-dev.319d6ebf.0

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 (46) hide show
  1. package/es2018.cjs +3 -3
  2. package/es2018.esm.js +3 -3
  3. package/es2024.cjs +3 -3
  4. package/es2024.esm.js +3 -3
  5. package/esnext.cjs +3 -3
  6. package/esnext.esm.js +3 -3
  7. package/evergreen.esm.js +3 -3
  8. package/package.json +3 -3
  9. package/types/ShareVSID.d.ts +3 -3
  10. package/types/index.d.ts +6 -5
  11. package/types/mediascopePixel/MediascopePixel.d.ts +36 -36
  12. package/types/mediascopePixel/Stopwatch.d.ts +10 -10
  13. package/types/mediascopePixel/types.d.ts +5 -5
  14. package/types/oneStat/Api.d.ts +35 -34
  15. package/types/oneStat/ApiTransport.d.ts +19 -19
  16. package/types/oneStat/Logger.d.ts +35 -35
  17. package/types/oneStat/OneStat.d.ts +309 -307
  18. package/types/oneStat/config.d.ts +32 -32
  19. package/types/oneStat/env.d.ts +3 -3
  20. package/types/oneStat/index.d.ts +9 -6
  21. package/types/oneStat/types.d.ts +43 -43
  22. package/types/oneStat/uiEvents.d.ts +19 -19
  23. package/types/oneStat/utils/mappers.d.ts +2 -2
  24. package/types/oneStat/utils/shorten.d.ts +1 -1
  25. package/types/oneStat/utils/timeSynchronisation.d.ts +8 -8
  26. package/types/oneStat/utils/watchCoverage.d.ts +4 -4
  27. package/types/oneStat/values.d.ts +63 -64
  28. package/types/shared/useModeController.d.ts +6 -5
  29. package/types/thinOneStat/Api.d.ts +32 -32
  30. package/types/thinOneStat/ApiTransport.d.ts +19 -19
  31. package/types/thinOneStat/Logger.d.ts +35 -35
  32. package/types/thinOneStat/ThinOneStat.d.ts +271 -271
  33. package/types/thinOneStat/config.d.ts +21 -20
  34. package/types/thinOneStat/env.d.ts +3 -3
  35. package/types/thinOneStat/events.d.ts +21 -21
  36. package/types/thinOneStat/index.d.ts +6 -4
  37. package/types/thinOneStat/types.d.ts +24 -24
  38. package/types/thinOneStat/utils/calculateTotalViewTime.d.ts +2 -2
  39. package/types/thinOneStat/utils/downloadBytes.d.ts +4 -4
  40. package/types/thinOneStat/utils/mappers.d.ts +3 -2
  41. package/types/thinOneStat/utils/timeSynchronisation.d.ts +8 -8
  42. package/types/thinOneStat/utils/watchCoverage.d.ts +4 -4
  43. package/types/thinOneStat/utils/watchedN.d.ts +5 -5
  44. package/types/thinOneStat/values.d.ts +67 -67
  45. package/es2015.cjs +0 -6
  46. package/es2015.esm.js +0 -6
@@ -1,36 +1,36 @@
1
- import { ILogCustomData } from './types';
2
- import { ApiEnv, Operation } from './values';
3
- import { Milliseconds } from '@vkontakte/videoplayer-shared';
4
- import type { RecursivePartial } from '@vkontakte/videoplayer-shared';
1
+ import type { ILogCustomData } from "./types";
2
+ import type { Operation } from "./values";
3
+ import { ApiEnv } from "./values";
4
+ import type { RecursivePartial, Milliseconds } from "@vkontakte/videoplayer-shared";
5
5
  export interface IConfig {
6
- apiEnv: ApiEnv;
7
- apiKey: string;
8
- apiBaseUrl: string | null;
9
- requestRetryCount: number;
10
- useVsid64: boolean;
11
- firstFlushTime: Milliseconds;
12
- flushDebounceTime: Milliseconds;
13
- flushMaxWait: Milliseconds;
14
- storageExpiration: Milliseconds;
15
- watchCoverageInterval: Milliseconds;
16
- disabledOperations: Operation[];
17
- disabledCustomFields: (keyof ILogCustomData)[];
18
- shorten: boolean;
19
- maxLoops: number;
20
- embedUrlParams: string[];
21
- useBeacon: boolean;
22
- clearStorageAtUnload: boolean;
23
- synchronizeTime: boolean;
24
- debugLog: boolean;
25
- useVKComIsMobileLogic: boolean;
26
- backoff: {
27
- start: Milliseconds;
28
- factor: number;
29
- max: Milliseconds;
30
- random: number;
31
- };
32
- useKeepalive: boolean;
33
- watchCoverageTimeoutFix: boolean;
6
+ apiEnv: ApiEnv;
7
+ apiKey: string;
8
+ apiBaseUrl: string | null;
9
+ requestRetryCount: number;
10
+ useVsid64: boolean;
11
+ firstFlushTime: Milliseconds;
12
+ flushDebounceTime: Milliseconds;
13
+ flushMaxWait: Milliseconds;
14
+ storageExpiration: Milliseconds;
15
+ watchCoverageInterval: Milliseconds;
16
+ disabledOperations: Operation[];
17
+ disabledCustomFields: (keyof ILogCustomData)[];
18
+ shorten: boolean;
19
+ maxLoops: number;
20
+ embedUrlParams: string[];
21
+ useBeacon: boolean;
22
+ clearStorageAtUnload: boolean;
23
+ synchronizeTime: boolean;
24
+ debugLog: boolean;
25
+ useVKComIsMobileLogic: boolean;
26
+ backoff: {
27
+ start: Milliseconds;
28
+ factor: number;
29
+ max: Milliseconds;
30
+ random: number;
31
+ };
32
+ useKeepalive: boolean;
33
+ watchCoverageTimeoutFix: boolean;
34
34
  }
35
35
  export type IOptionalConfig = RecursivePartial<IConfig>;
36
36
  export declare const fillDefault: (partial: IOptionalConfig) => IConfig;
@@ -1,6 +1,6 @@
1
- import { ApiEnv } from './values';
1
+ import { ApiEnv } from "./values";
2
2
  /**
3
- * Application ID: 512000749287.
4
- */
3
+ * Application ID: 512000749287.
4
+ */
5
5
  export declare const API_KEY: string;
6
6
  export declare const API_BASE_URLS: Record<ApiEnv, string>;
@@ -1,6 +1,9 @@
1
- import { IOneStat, OneStat, IStatContext, IConstructorParams } from './OneStat';
2
- import { ApiEnv, ContentType, Quality, ConnectionType, SeekAction, InterfaceClick, InteractiveInterfaceClick } from './values';
3
- import { IUIEvents, IAdsEvents, IInteractiveEvents } from './uiEvents';
4
- export { OneStat, IOneStat, IStatContext, IConstructorParams, ApiEnv, ContentType, Quality, ConnectionType, SeekAction, IUIEvents, IAdsEvents, IInteractiveEvents, InterfaceClick, InteractiveInterfaceClick, };
5
- export { VERSION } from '../env';
6
- export { IOptionalConfig } from './config';
1
+ import { OneStat } from "./OneStat";
2
+ import type { IOneStat, IStatContext, IConstructorParams } from "./OneStat";
3
+ import { ApiEnv, ContentType, Quality, ConnectionType, SeekAction, InteractiveInterfaceClick } from "./values";
4
+ import type { InterfaceClick } from "./values";
5
+ import type { IUIEvents, IAdsEvents, IInteractiveEvents } from "./uiEvents";
6
+ export { OneStat, ApiEnv, ContentType, Quality, ConnectionType, SeekAction, InteractiveInterfaceClick };
7
+ export type { IOneStat, IStatContext, IConstructorParams, IUIEvents, IAdsEvents, IInteractiveEvents, InterfaceClick };
8
+ export { VERSION } from "../env";
9
+ export type { IOptionalConfig } from "./config";
@@ -1,47 +1,47 @@
1
- import { Kbps, Milliseconds, Seconds } from '@vkontakte/videoplayer-shared';
2
- import { ConnectionType, ContentType, Flag, Mode, Network, Operation, Quality, StatType } from './values';
1
+ import type { Kbps, Milliseconds, Seconds } from "@vkontakte/videoplayer-shared";
2
+ import type { ConnectionType, ContentType, Flag, Mode, Network, Operation, Quality, StatType } from "./values";
3
3
  export interface ILogItem {
4
- operation: Operation;
5
- type: 1;
6
- time?: Seconds | Milliseconds;
7
- timestamp: Milliseconds;
8
- network?: Network;
9
- custom: ILogCustomData;
4
+ operation: Operation;
5
+ type: 1;
6
+ time?: Seconds | Milliseconds;
7
+ timestamp: Milliseconds;
8
+ network?: Network;
9
+ custom: ILogCustomData;
10
10
  }
11
11
  export interface ILogCustomData {
12
- /**
13
- * Сессия смотрения, уникальна для пользователя, контента, экземпляра плеера и одного просмотра
14
- * См https://confluence.vk.team/display/VID/Video%20Session%20ID
15
- */
16
- vsid: string;
17
- uid?: string;
18
- isid?: string;
19
- vid: number;
20
- ct?: ContentType;
21
- place?: string;
22
- quality?: Quality;
23
- cdn_host?: string;
24
- stat_type?: StatType;
25
- param?: any;
26
- vk_app_id?: string;
27
- track_code?: string;
28
- connection_type?: ConnectionType;
29
- connection_reused?: Flag;
30
- cached_data?: Flag;
31
- live?: Flag;
32
- muted?: Flag;
33
- mode?: Mode;
34
- subtitles?: string;
35
- failover?: Flag;
36
- download_speed?: Kbps;
37
- manual_quality?: Flag;
38
- ref_domain?: string;
39
- direct_url?: string;
40
- rate?: string;
41
- view_360?: 1;
42
- vk_playlist_id?: string;
43
- aid?: string;
44
- in_history?: 1;
45
- latency?: number;
46
- buffer_latency?: number;
12
+ /**
13
+ * Сессия смотрения, уникальна для пользователя, контента, экземпляра плеера и одного просмотра
14
+ * См https://confluence.vk.team/display/VID/Video%20Session%20ID
15
+ */
16
+ vsid: string;
17
+ uid?: string;
18
+ isid?: string;
19
+ vid: number;
20
+ ct?: ContentType;
21
+ place?: string;
22
+ quality?: Quality;
23
+ cdn_host?: string;
24
+ stat_type?: StatType;
25
+ param?: any;
26
+ vk_app_id?: string;
27
+ track_code?: string;
28
+ connection_type?: ConnectionType;
29
+ connection_reused?: Flag;
30
+ cached_data?: Flag;
31
+ live?: Flag;
32
+ muted?: Flag;
33
+ mode?: Mode;
34
+ subtitles?: string;
35
+ failover?: Flag;
36
+ download_speed?: Kbps;
37
+ manual_quality?: Flag;
38
+ ref_domain?: string;
39
+ direct_url?: string;
40
+ rate?: string;
41
+ view_360?: 1;
42
+ vk_playlist_id?: string;
43
+ aid?: string;
44
+ in_history?: 1;
45
+ latency?: number;
46
+ buffer_latency?: number;
47
47
  }
@@ -1,25 +1,25 @@
1
- import { IObservable } from '@vkontakte/videoplayer-shared';
2
- import { InteractiveInterfaceClick } from './values';
3
- import type { SeekAction } from './values';
1
+ import type { IObservable } from "@vkontakte/videoplayer-shared";
2
+ import type { InteractiveInterfaceClick } from "./values";
3
+ import type { SeekAction } from "./values";
4
4
  export interface IUIEvents {
5
- actionRewind$?: IObservable<void>;
6
- actionSeek$?: IObservable<SeekAction>;
7
- inPiP$?: IObservable<boolean>;
8
- inFullscreen$?: IObservable<boolean>;
9
- actionSetSubtitle$?: IObservable<string>;
10
- nextMovie$?: IObservable<number>;
5
+ actionRewind$?: IObservable<void>;
6
+ actionSeek$?: IObservable<SeekAction>;
7
+ inPiP$?: IObservable<boolean>;
8
+ inFullscreen$?: IObservable<boolean>;
9
+ actionSetSubtitle$?: IObservable<string>;
10
+ nextMovie$?: IObservable<number>;
11
11
  }
12
12
  export interface IAdsEvents {
13
- slotRequested$?: IObservable<void>;
14
- started$?: IObservable<string>;
15
- paused$?: IObservable<void>;
16
- resumed$?: IObservable<void>;
17
- ended$?: IObservable<string>;
18
- skipped$?: IObservable<void>;
19
- clicked$?: IObservable<string>;
20
- error$?: IObservable<string>;
13
+ slotRequested$?: IObservable<void>;
14
+ started$?: IObservable<string>;
15
+ paused$?: IObservable<void>;
16
+ resumed$?: IObservable<void>;
17
+ ended$?: IObservable<string>;
18
+ skipped$?: IObservable<void>;
19
+ clicked$?: IObservable<string>;
20
+ error$?: IObservable<string>;
21
21
  }
22
22
  export interface IInteractiveEvents {
23
- click$?: IObservable<InteractiveInterfaceClick>;
24
- nextMovie$?: IObservable<number>;
23
+ click$?: IObservable<InteractiveInterfaceClick>;
24
+ nextMovie$?: IObservable<number>;
25
25
  }
@@ -1,5 +1,5 @@
1
- import { HttpConnectionType as CoreConnectionType, Surface, VideoFormat, VideoQuality } from '@vkontakte/videoplayer-core';
2
- import { ConnectionType as StatisticsConnectionType, ContentType, Mode, Network, Quality } from '../values';
1
+ import { HttpConnectionType as CoreConnectionType, Surface, VideoFormat, VideoQuality } from "@vkontakte/videoplayer-core";
2
+ import { ConnectionType as StatisticsConnectionType, ContentType, Mode, Network, Quality } from "../values";
3
3
  export declare const quality: (coreQuality: VideoQuality | undefined) => Quality | undefined;
4
4
  export declare const connectionType: (coreType: CoreConnectionType | undefined) => StatisticsConnectionType | undefined;
5
5
  export declare const contentType: (format: VideoFormat | undefined) => ContentType | undefined;
@@ -1,2 +1,2 @@
1
- import { ILogItem } from '../types';
1
+ import type { ILogItem } from "../types";
2
2
  export declare const shorten: (item: ILogItem) => object;
@@ -1,10 +1,10 @@
1
- import { Milliseconds } from '@vkontakte/videoplayer-shared';
1
+ import type { Milliseconds } from "@vkontakte/videoplayer-shared";
2
2
  export declare class TimeSynchronisation {
3
- private offset;
4
- constructor(initialOffset?: Milliseconds);
5
- getOffset(): Milliseconds;
6
- setOffset(offset: Milliseconds): void;
7
- now(): number;
8
- date(date?: Date): Date;
9
- addServerTime(serverTime: Milliseconds, rtt: Milliseconds): void;
3
+ private offset;
4
+ constructor(initialOffset?: Milliseconds);
5
+ getOffset(): Milliseconds;
6
+ setOffset(offset: Milliseconds): void;
7
+ now(): number;
8
+ date(date?: Date): Date;
9
+ addServerTime(serverTime: Milliseconds, rtt: Milliseconds): void;
10
10
  }
@@ -1,7 +1,7 @@
1
- import { IPlayer } from '@vkontakte/videoplayer-core';
2
- import { IObservable, IRange, Milliseconds, Seconds } from '@vkontakte/videoplayer-shared';
1
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
2
+ import type { IObservable, IRange, Milliseconds, Seconds } from "@vkontakte/videoplayer-shared";
3
3
  export type IParams = {
4
- forceInterval: Milliseconds;
5
- watchCoverageTimeoutFix: boolean;
4
+ forceInterval: Milliseconds;
5
+ watchCoverageTimeoutFix: boolean;
6
6
  };
7
7
  export declare const watchCoverage: (player: IPlayer, params: IParams) => IObservable<IRange<Seconds>>;
@@ -1,86 +1,85 @@
1
- import { ILogCustomData } from './types';
2
- export type Operation = 'action_play' | 'action_play_interactive' | 'first_bytes' | 'player_ready' | 'first_frame' | 'seek' | 'watch_coverage_record' | 'watch_coverage_live' | 'empty_buffer' | 'action_stop' | 'close_at_empty_buffer' | 'content_error' | 'player_interface_click' | 'next_movie' | 'track_switch' | // Пока не поддержана
3
- 'failover' | 'quality' | 'play_toggle' | 'pause' | 'adv' | 'playing';
1
+ import type { ILogCustomData } from "./types";
2
+ export type Operation = "action_play" | "action_play_interactive" | "first_bytes" | "player_ready" | "first_frame" | "seek" | "watch_coverage_record" | "watch_coverage_live" | "empty_buffer" | "action_stop" | "close_at_empty_buffer" | "content_error" | "player_interface_click" | "next_movie" | "track_switch" | "failover" | "quality" | "play_toggle" | "pause" | "adv" | "playing";
4
3
  export declare enum ApiEnv {
5
- PROD = "prod",
6
- VK_ALIAS = "vk_alias",
7
- VIDEOTEST = "videotest",
8
- TEST = "test",
9
- OKCDN = "okcdn",
10
- AUTO = "auto"
4
+ PROD = "prod",
5
+ VK_ALIAS = "vk_alias",
6
+ VIDEOTEST = "videotest",
7
+ TEST = "test",
8
+ OKCDN = "okcdn",
9
+ AUTO = "auto"
11
10
  }
12
11
  export declare enum Quality {
13
- Q144P = "mobile",
14
- Q240P = "lowest",
15
- Q360P = "low",
16
- Q480P = "medium",
17
- Q720P = "high",
18
- Q1080P = "fullhd",
19
- Q1440P = "quadhd",
20
- Q2160P = "ultrahd",
21
- UNKNOWN = "unknown"
12
+ Q144P = "mobile",
13
+ Q240P = "lowest",
14
+ Q360P = "low",
15
+ Q480P = "medium",
16
+ Q720P = "high",
17
+ Q1080P = "fullhd",
18
+ Q1440P = "quadhd",
19
+ Q2160P = "ultrahd",
20
+ UNKNOWN = "unknown"
22
21
  }
23
22
  export declare enum ContentType {
24
- MP4 = "mp4",
25
- DASH = "dash",
26
- DASH_SEP = "dash_sep",
27
- ONDEMAND_DASH = "ondemand_dash",
28
- HLS = "hls",
29
- HLS_FMP4 = "hls_fmp4",
30
- ONDEMAND_HLS = "ondemand_hls",
31
- WEBM = "webm",
32
- AV1 = "av1",
33
- ONDEMAND_DASH_LIVE = "ondemand_dash_live",
34
- ONDEMAND_HLS_LIVE = "ondemand_hls_live",
35
- WEBRTC = "webrtc",
36
- UNKNOWN = "unknown",
37
- /** @deprecated сдк не поддерживает RTMP, не нужно его использовать */
38
- RTMP = "rtmp"
23
+ MP4 = "mp4",
24
+ DASH = "dash",
25
+ DASH_SEP = "dash_sep",
26
+ ONDEMAND_DASH = "ondemand_dash",
27
+ HLS = "hls",
28
+ HLS_FMP4 = "hls_fmp4",
29
+ ONDEMAND_HLS = "ondemand_hls",
30
+ WEBM = "webm",
31
+ AV1 = "av1",
32
+ ONDEMAND_DASH_LIVE = "ondemand_dash_live",
33
+ ONDEMAND_HLS_LIVE = "ondemand_hls_live",
34
+ WEBRTC = "webrtc",
35
+ UNKNOWN = "unknown",
36
+ /** @deprecated сдк не поддерживает RTMP, не нужно его использовать */
37
+ RTMP = "rtmp"
39
38
  }
40
39
  export declare enum StatType {
41
- AUTO = "auto",
42
- MANUAL = ""
40
+ AUTO = "auto",
41
+ MANUAL = ""
43
42
  }
44
43
  export declare enum ConnectionType {
45
- HTTP1 = "http1",
46
- HTTP2 = "http2",
47
- HTTP3 = "http3"
44
+ HTTP1 = "http1",
45
+ HTTP2 = "http2",
46
+ HTTP3 = "http3"
48
47
  }
49
48
  export declare enum Flag {
50
- YES = 1,
51
- NO = 0
49
+ YES = 1,
50
+ NO = 0
52
51
  }
53
52
  export declare enum Network {
54
- EXCELLENT = "excellent",
55
- GOOD = "good",
56
- POOR = "poor"
53
+ EXCELLENT = "excellent",
54
+ GOOD = "good",
55
+ POOR = "poor"
57
56
  }
58
57
  export declare enum Mode {
59
- PIP = "pip",
60
- FULLSCREEN = "fullscreen",
61
- EXTERNAL = "external",
62
- PREFETCH = "prefetch",
63
- AIRPLAY = "airplay",
64
- CHROMECAST = "chromecast",
65
- INVISIBLE = "invisible",
66
- MINIMAL = "minimal"
58
+ PIP = "pip",
59
+ FULLSCREEN = "fullscreen",
60
+ EXTERNAL = "external",
61
+ PREFETCH = "prefetch",
62
+ AIRPLAY = "airplay",
63
+ CHROMECAST = "chromecast",
64
+ INVISIBLE = "invisible",
65
+ MINIMAL = "minimal"
67
66
  }
68
67
  export declare enum SeekAction {
69
- SLIDER = "slider",
70
- RICH = "rich",
71
- DOUBLE_TAP = "double_tap",
72
- TIME_CODE = "time_code",
73
- EPISODE = "episode",
74
- REWIND = "rewind",
75
- LIVE = "live",
76
- UNKNOWN = "unknown"
68
+ SLIDER = "slider",
69
+ RICH = "rich",
70
+ DOUBLE_TAP = "double_tap",
71
+ TIME_CODE = "time_code",
72
+ EPISODE = "episode",
73
+ REWIND = "rewind",
74
+ LIVE = "live",
75
+ UNKNOWN = "unknown"
77
76
  }
78
77
  export declare enum InteractiveInterfaceClick {
79
- GRAPH_SHOW = "iGraphShow",
80
- GRAPH_HIDE = "iGraphHide",
81
- NEXT_AREA = "iNextChapterArea",
82
- NEXT_BUTTON = "iNextChapterBtn",
83
- WATCH_AGAIN = "iWatchAgainBtn"
78
+ GRAPH_SHOW = "iGraphShow",
79
+ GRAPH_HIDE = "iGraphHide",
80
+ NEXT_AREA = "iNextChapterArea",
81
+ NEXT_BUTTON = "iNextChapterBtn",
82
+ WATCH_AGAIN = "iWatchAgainBtn"
84
83
  }
85
84
  export type InterfaceClick = InteractiveInterfaceClick;
86
85
  export declare const OperationAliases: Partial<Record<Operation, string>>;
@@ -1,8 +1,9 @@
1
- import { IUIEvents as IUIEventsOneStat } from '../oneStat';
2
- import { IUIEvents as IUIEventsThinOneStat } from '../thinOneStat';
3
- import { IPlayer, Surface } from '@vkontakte/videoplayer-core';
4
- import { IListener, IObservable } from '@vkontakte/videoplayer-shared';
1
+ import type { IUIEvents as IUIEventsOneStat } from "../oneStat";
2
+ import type { IUIEvents as IUIEventsThinOneStat } from "../thinOneStat";
3
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
4
+ import { Surface } from "@vkontakte/videoplayer-core";
5
+ import type { IListener, IObservable } from "@vkontakte/videoplayer-shared";
5
6
  /** конроллер для состояния mode плеера */
6
7
  export declare const useModeController: (uiEvents: IUIEventsOneStat | IUIEventsThinOneStat, subscribe: <T>(observable: IObservable<T> | undefined, logger: IListener<T>) => void, player?: IPlayer) => {
7
- surface$: IObservable<Surface | undefined>;
8
+ surface$: IObservable<Surface | undefined>;
8
9
  };
@@ -1,38 +1,38 @@
1
- import type { ISubject, IError, IValueObservable } from '@vkontakte/videoplayer-shared';
2
- import { ValueSubject } from '@vkontakte/videoplayer-shared';
3
- import type { IApiTransport } from './ApiTransport';
4
- import type { ILogItem } from './types';
5
- import type { IConfig } from './config';
1
+ import type { ISubject, IError, IValueObservable } from "@vkontakte/videoplayer-shared";
2
+ import { ValueSubject } from "@vkontakte/videoplayer-shared";
3
+ import type { IApiTransport } from "./ApiTransport";
4
+ import type { ILogItem } from "./types";
5
+ import type { IConfig } from "./config";
6
6
  export interface IApi {
7
- authorized$: IValueObservable<boolean>;
8
- authorize(authToken?: string): Promise<string | undefined>;
9
- logBeacon(items: ILogItem[]): void;
10
- logRequest(items: ILogItem[]): Promise<void>;
11
- destroy(): void;
7
+ authorized$: IValueObservable<boolean>;
8
+ authorize(authToken?: string): Promise<string | undefined>;
9
+ logBeacon(items: ILogItem[]): void;
10
+ logRequest(items: ILogItem[]): Promise<void>;
11
+ destroy(): void;
12
12
  }
13
13
  export interface IApiParams {
14
- config: IConfig;
15
- deviceId: string;
16
- apiTransport: IApiTransport;
17
- error$: ISubject<IError>;
18
- refreshAuthToken?: () => Promise<string | undefined>;
14
+ config: IConfig;
15
+ deviceId: string;
16
+ apiTransport: IApiTransport;
17
+ error$: ISubject<IError>;
18
+ refreshAuthToken?: () => Promise<string | undefined>;
19
19
  }
20
20
  export declare class Api implements IApi {
21
- authorized$: ValueSubject<boolean>;
22
- private params;
23
- private authToken?;
24
- private sessionKey?;
25
- private authorizePromise?;
26
- private refreshAuthTokenPromise?;
27
- private consequentAuthErrors;
28
- private backoffTimeoutId;
29
- constructor(params: IApiParams);
30
- authorize(authToken?: string): Promise<string | undefined>;
31
- logBeacon(items: ILogItem[]): void;
32
- logRequest(items: ILogItem[]): Promise<void>;
33
- destroy(): void;
34
- private refreshAuthToken;
35
- private createLogParams;
36
- private authorizeWithBackoff;
37
- private doAuthorize;
21
+ authorized$: ValueSubject<boolean>;
22
+ private params;
23
+ private authToken?;
24
+ private sessionKey?;
25
+ private authorizePromise?;
26
+ private refreshAuthTokenPromise?;
27
+ private consequentAuthErrors;
28
+ private backoffTimeoutId;
29
+ constructor(params: IApiParams);
30
+ authorize(authToken?: string): Promise<string | undefined>;
31
+ logBeacon(items: ILogItem[]): void;
32
+ logRequest(items: ILogItem[]): Promise<void>;
33
+ destroy(): void;
34
+ private refreshAuthToken;
35
+ private createLogParams;
36
+ private authorizeWithBackoff;
37
+ private doAuthorize;
38
38
  }
@@ -1,25 +1,25 @@
1
- import type { ISubject, IError } from '@vkontakte/videoplayer-shared';
2
- import type { IConfig } from './config';
3
- import type { TimeSynchronisation } from './utils/timeSynchronisation';
1
+ import type { ISubject, IError } from "@vkontakte/videoplayer-shared";
2
+ import type { IConfig } from "./config";
3
+ import type { TimeSynchronisation } from "./utils/timeSynchronisation";
4
4
  export interface IApiTransport {
5
- sendBeacon(method: string, params: Record<string, unknown>, sessionKey?: string): boolean;
6
- sendRequest<T = unknown>(method: string, params: Record<string, unknown>, sessionKey?: string, headers?: Record<string, unknown>): Promise<T>;
5
+ sendBeacon(method: string, params: Record<string, unknown>, sessionKey?: string): boolean;
6
+ sendRequest<T = unknown>(method: string, params: Record<string, unknown>, sessionKey?: string, headers?: Record<string, unknown>): Promise<T>;
7
7
  }
8
8
  export interface IApiTransportParams {
9
- config: IConfig;
10
- timeSynchronisation?: TimeSynchronisation;
11
- error$: ISubject<IError>;
9
+ config: IConfig;
10
+ timeSynchronisation?: TimeSynchronisation;
11
+ error$: ISubject<IError>;
12
12
  }
13
13
  export declare class ApiTransport implements IApiTransport {
14
- private params;
15
- private apiKey;
16
- private apiBaseUrl;
17
- private apiEnv;
18
- private isApiBaseUrlFetched;
19
- private timeSynchronisation?;
20
- constructor(params: IApiTransportParams);
21
- sendBeacon(method: string, params: Record<string, unknown>, sessionKey?: string): boolean;
22
- sendRequest<T = unknown>(method: string, params: Record<string, unknown>, sessionKey?: string, headers?: Record<string, unknown>): Promise<T>;
23
- private resolveApiBaseUrl;
24
- private prepareQueryParams;
14
+ private params;
15
+ private apiKey;
16
+ private apiBaseUrl;
17
+ private apiEnv;
18
+ private isApiBaseUrlFetched;
19
+ private timeSynchronisation?;
20
+ constructor(params: IApiTransportParams);
21
+ sendBeacon(method: string, params: Record<string, unknown>, sessionKey?: string): boolean;
22
+ sendRequest<T = unknown>(method: string, params: Record<string, unknown>, sessionKey?: string, headers?: Record<string, unknown>): Promise<T>;
23
+ private resolveApiBaseUrl;
24
+ private prepareQueryParams;
25
25
  }