@vkontakte/videoplayer-interactive 1.0.61 → 1.0.62-dev.04ce2cd1.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 (87) hide show
  1. package/es2015.cjs +8 -7
  2. package/es2015.esm.js +8 -7
  3. package/es2018.cjs +8 -7
  4. package/es2018.esm.js +8 -7
  5. package/es2024.cjs +8 -7
  6. package/es2024.esm.js +8 -7
  7. package/esnext.cjs +8 -7
  8. package/esnext.esm.js +8 -7
  9. package/evergreen.esm.js +8 -7
  10. package/package.json +4 -4
  11. package/types/index.d.ts +9 -8
  12. package/types/manifest/index.d.ts +3 -3
  13. package/types/manifest/utils.d.ts +33 -32
  14. package/types/modules/Graph/Graph.d.ts +47 -46
  15. package/types/modules/Graph/index.d.ts +1 -1
  16. package/types/modules/Interactives/Interactives.d.ts +138 -135
  17. package/types/modules/Interactives/Layout.d.ts +11 -11
  18. package/types/modules/Interactives/containers/ChoiceContainer.d.ts +31 -31
  19. package/types/modules/Interactives/containers/Container.d.ts +19 -19
  20. package/types/modules/Interactives/containers/index.d.ts +4 -4
  21. package/types/modules/Interactives/containers/types.d.ts +6 -6
  22. package/types/modules/Interactives/containers/utils.d.ts +3 -3
  23. package/types/modules/Interactives/controls/AreaControl.d.ts +17 -16
  24. package/types/modules/Interactives/controls/ButtonControl.d.ts +21 -20
  25. package/types/modules/Interactives/controls/Control.d.ts +42 -41
  26. package/types/modules/Interactives/controls/TextControl.d.ts +14 -13
  27. package/types/modules/Interactives/controls/index.d.ts +6 -6
  28. package/types/modules/Interactives/controls/types.d.ts +22 -19
  29. package/types/modules/Interactives/controls/utils.d.ts +10 -10
  30. package/types/modules/Interactives/index.d.ts +14 -95
  31. package/types/modules/Interactives/styles/index.d.ts +1 -1
  32. package/types/modules/Interactives/types.d.ts +64 -64
  33. package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +10 -10
  34. package/types/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +30 -30
  35. package/types/modules/Interactives/utils/ControlFillAnimation/index.d.ts +1 -1
  36. package/types/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +9 -9
  37. package/types/modules/Interactives/utils/ControlTap/ControlTap.d.ts +12 -12
  38. package/types/modules/Interactives/utils/ControlTap/index.d.ts +1 -1
  39. package/types/modules/Interactives/utils/ControlTap/utils.d.ts +3 -3
  40. package/types/modules/Interactives/utils/GameController.d.ts +66 -66
  41. package/types/modules/Interactives/utils/GroupsStack.d.ts +18 -20
  42. package/types/modules/Interactives/utils/HistoryController.d.ts +39 -40
  43. package/types/modules/Interactives/utils/InteractiveEvents.d.ts +30 -29
  44. package/types/modules/Interactives/utils/ResizeManager.d.ts +10 -10
  45. package/types/modules/Interactives/utils/SelectBranches.d.ts +15 -15
  46. package/types/modules/Interactives/utils/SelectBranches.types.d.ts +53 -53
  47. package/types/modules/Interactives/utils/angleUtils.d.ts +13 -13
  48. package/types/modules/Interactives/utils/createControlText.d.ts +2 -2
  49. package/types/modules/Interactives/utils/emitOnError.d.ts +10 -10
  50. package/types/modules/Interactives/utils/events.d.ts +67 -67
  51. package/types/modules/Interactives/utils/events.types.d.ts +35 -32
  52. package/types/modules/Interactives/utils/fallbackStrategies.d.ts +15 -14
  53. package/types/modules/Interactives/utils/functionUtils.d.ts +9 -2
  54. package/types/modules/Interactives/utils/gameUtils.d.ts +22 -21
  55. package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +5 -5
  56. package/types/modules/Interactives/utils/renderingUtils.d.ts +48 -53
  57. package/types/modules/Loaders/index.d.ts +1 -1
  58. package/types/modules/Loaders/movikaProjectIdLoader/index.d.ts +1 -1
  59. package/types/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +8 -8
  60. package/types/modules/Loaders/vkVideoLoader/index.d.ts +1 -1
  61. package/types/modules/Loaders/vkVideoLoader/types.d.ts +231 -231
  62. package/types/modules/Loaders/vkVideoLoader/utils.d.ts +1 -1
  63. package/types/modules/ManifestController/Loadable.d.ts +5 -5
  64. package/types/modules/ManifestController/ManifestController.d.ts +29 -29
  65. package/types/modules/ManifestController/index.d.ts +1 -1
  66. package/types/modules/ManifestController/utils.d.ts +6 -6
  67. package/types/modules/SeamlessController/InstanceManager.d.ts +10 -10
  68. package/types/modules/SeamlessController/SeamlessController.d.ts +30 -27
  69. package/types/modules/SeamlessController/utils.d.ts +6 -6
  70. package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +8 -8
  71. package/types/modules/SeekToInteractiveController/index.d.ts +1 -1
  72. package/types/types/CustomError.d.ts +9 -9
  73. package/types/types/index.d.ts +2 -2
  74. package/types/utils/CssVarsManager.d.ts +21 -21
  75. package/types/utils/Error.d.ts +6 -6
  76. package/types/utils/EventEmitter.d.ts +10 -10
  77. package/types/utils/LastFrame.d.ts +29 -29
  78. package/types/utils/LastFrameCanvasAPI.d.ts +17 -17
  79. package/types/utils/MultiMap.d.ts +8 -8
  80. package/types/utils/Raf.d.ts +11 -11
  81. package/types/utils/chapterHelpers.d.ts +1 -1
  82. package/types/utils/compareVersions.d.ts +12 -12
  83. package/types/utils/extractVkMovieId.d.ts +1 -1
  84. package/types/utils/getVideoContentSize.d.ts +3 -3
  85. package/types/utils/hexToRgb.d.ts +2 -2
  86. package/types/utils/throttle.d.ts +1 -1
  87. package/types/utils/typeCheck.d.ts +7 -7
@@ -1,47 +1,48 @@
1
- import { EventActionTypes, type AnyManifest, type AnyControl } from '../manifest';
1
+ import type { EventActionTypes } from "./";
2
+ import { type AnyManifest, type AnyControl } from "./";
2
3
  /**
3
- * checks manifest object validity
4
- * @param manifest - manifest to check
5
- * @returns true is valid, false is invalid
6
- */
4
+ * checks manifest object validity
5
+ * @param manifest - manifest to check
6
+ * @returns true is valid, false is invalid
7
+ */
7
8
  export declare const isValidManifest: (manifest: AnyManifest) => boolean;
8
- export declare const isTextControl: (controlItem: AnyControl) => boolean;
9
- export declare const isButtonControl: (controlItem: AnyControl) => boolean;
10
- export declare const isAreaControl: (controlItem: AnyControl) => boolean;
9
+ export declare function isTextControl(controlItem: AnyControl): boolean;
10
+ export declare function isButtonControl(controlItem: AnyControl): boolean;
11
+ export declare function isAreaControl(controlItem: AnyControl): boolean;
11
12
  export type EventActionKeys = keyof typeof EventActionTypes;
12
13
  /**
13
- * @deprecated use ContainerTypes enum instead
14
- */
14
+ * @deprecated use ContainerTypes enum instead
15
+ */
15
16
  export declare const containerTypes: {
16
- readonly Choice: "Choice";
17
- readonly TextInput: "TextInput";
17
+ readonly Choice: "Choice";
18
+ readonly TextInput: "TextInput";
18
19
  };
19
20
  /**
20
- * @deprecated use ControlTypes enum instead
21
- */
21
+ * @deprecated use ControlTypes enum instead
22
+ */
22
23
  export declare const controlTypes: {
23
- readonly Button: "Button";
24
- readonly Area: "Area";
25
- readonly Text: "Text";
24
+ readonly Button: "Button";
25
+ readonly Area: "Area";
26
+ readonly Text: "Text";
26
27
  };
27
28
  /**
28
- * @deprecated use EventTypes enum instead
29
- */
29
+ * @deprecated use EventTypes enum instead
30
+ */
30
31
  export declare const eventTypes: {
31
- readonly onClick: "onClick";
32
- readonly onSuspense: "onSuspense";
32
+ readonly onClick: "onClick";
33
+ readonly onSuspense: "onSuspense";
33
34
  };
34
35
  /**
35
- * @deprecated use EventActionTypes enum instead
36
- */
36
+ * @deprecated use EventActionTypes enum instead
37
+ */
37
38
  export declare const eventActionTypes: {
38
- readonly openURI: "openURI";
39
- readonly setNextBranch: "setNextBranch";
40
- readonly setWeightlessRandomBranch: "setWeightlessRandomBranch";
41
- readonly setRandomBranch: "setRandomBranch";
42
- readonly setMaxWeightBranch: "setMaxWeightBranch";
43
- readonly setMinWeightBranch: "setMinWeightBranch";
44
- readonly setDefaultBranch: "setDefaultBranch";
45
- readonly continuePlayback: "continuePlayback";
46
- readonly expect: "expect";
39
+ readonly openURI: "openURI";
40
+ readonly setNextBranch: "setNextBranch";
41
+ readonly setWeightlessRandomBranch: "setWeightlessRandomBranch";
42
+ readonly setRandomBranch: "setRandomBranch";
43
+ readonly setMaxWeightBranch: "setMaxWeightBranch";
44
+ readonly setMinWeightBranch: "setMinWeightBranch";
45
+ readonly setDefaultBranch: "setDefaultBranch";
46
+ readonly continuePlayback: "continuePlayback";
47
+ readonly expect: "expect";
47
48
  };
@@ -1,53 +1,54 @@
1
- import { type InterfaceLanguage, Nullable } from '@vkontakte/videoplayer-shared';
2
- import type { VideoInfo } from '../../modules/Interactives';
3
- import type { GraphEditor } from '@interactiveplatform/movika-graph-editor';
4
- import type { Chapter, Manifest } from '../../manifest';
1
+ import type { Nullable } from "@vkontakte/videoplayer-shared";
2
+ import { type InterfaceLanguage } from "@vkontakte/videoplayer-shared";
3
+ import type { VideoInfo } from "../Interactives";
4
+ import type { GraphEditor } from "@interactiveplatform/movika-graph-editor";
5
+ import type { Chapter, Manifest } from "../../manifest";
5
6
  interface GraphOptions {
6
- lang: InterfaceLanguage | string;
7
- root: HTMLElement;
8
- onError: (msg: string) => void;
9
- onOpenPreviewClick: (chapterId: string) => void;
10
- visitedChapters?: string[];
7
+ lang: InterfaceLanguage | string;
8
+ root: HTMLElement;
9
+ onError: (msg: string) => void;
10
+ onOpenPreviewClick: (chapterId: string) => void;
11
+ visitedChapters?: string[];
11
12
  }
12
13
  type Coordinates = Nullable<{
13
- x: number;
14
- y: number;
15
- value: number;
14
+ x: number;
15
+ y: number;
16
+ value: number;
16
17
  }>;
17
18
  export declare class Graph {
18
- isHidden: boolean;
19
- currentManifestId: Nullable<string>;
20
- currentChapterId: Nullable<string>;
21
- visitedChapterIds: Set<string>;
22
- onOpenPreviewClick?: GraphOptions['onOpenPreviewClick'];
23
- onError: GraphOptions['onError'];
24
- lang: GraphOptions['lang'];
25
- zoom: number;
26
- lastZoomInfo: Coordinates;
27
- isReady: boolean;
28
- ngEditor: Nullable<GraphEditor>;
29
- ngEditorSize: Nullable<{
30
- width: number;
31
- height: number;
32
- }>;
33
- graphWrapperElement: HTMLDivElement;
34
- resizeObserver: ResizeObserver;
35
- private manifest;
36
- constructor(options: GraphOptions);
37
- init({ root, onOpenPreviewClick, onError, lang, visitedChapters }: GraphOptions): void;
38
- private handleZoomChange;
39
- onResize: (entries: ResizeObserverEntry[]) => void;
40
- getNextPoint(ngEditorSize?: Nullable<{
41
- width: number;
42
- height: number;
43
- }>): Nullable<[number, number]>;
44
- handleChapterChange: (chapter: Chapter) => void;
45
- handleManifestChange: (manifest: Manifest, visitedChapters?: string[]) => void;
46
- setVisitedChapters(chapterIds: string[]): void;
47
- updateVideosInfo(videosInfo: VideoInfo[]): void;
48
- show(): Promise<void>;
49
- private initNgEditor;
50
- hide(): void;
51
- destroy(): void;
19
+ isHidden: boolean;
20
+ currentManifestId: Nullable<string>;
21
+ currentChapterId: Nullable<string>;
22
+ visitedChapterIds: Set<string>;
23
+ onOpenPreviewClick?: GraphOptions["onOpenPreviewClick"];
24
+ onError: GraphOptions["onError"];
25
+ lang: GraphOptions["lang"];
26
+ zoom: number;
27
+ lastZoomInfo: Coordinates;
28
+ isReady: boolean;
29
+ ngEditor: Nullable<GraphEditor>;
30
+ ngEditorSize: Nullable<{
31
+ width: number;
32
+ height: number;
33
+ }>;
34
+ graphWrapperElement: HTMLDivElement;
35
+ resizeObserver: ResizeObserver;
36
+ private manifest;
37
+ constructor(options: GraphOptions);
38
+ init({ root, onOpenPreviewClick, onError, lang, visitedChapters }: GraphOptions): void;
39
+ private handleZoomChange;
40
+ onResize: (entries: ResizeObserverEntry[]) => void;
41
+ getNextPoint(ngEditorSize?: Nullable<{
42
+ width: number;
43
+ height: number;
44
+ }>): Nullable<[number, number]>;
45
+ handleChapterChange: (chapter: Chapter) => void;
46
+ handleManifestChange: (manifest: Manifest, visitedChapters?: string[]) => void;
47
+ setVisitedChapters(chapterIds: string[]): void;
48
+ updateVideosInfo(videosInfo: VideoInfo[]): void;
49
+ show(): Promise<void>;
50
+ private initNgEditor;
51
+ hide(): void;
52
+ destroy(): void;
52
53
  }
53
54
  export {};
@@ -1 +1 @@
1
- export { Graph } from './Graph';
1
+ export { Graph } from "./Graph";
@@ -1,140 +1,143 @@
1
- import { Observable, ValueSubject, Nullable } from '@vkontakte/videoplayer-shared';
2
- import type { Chapter, Manifest, AnyManifest } from '../../manifest';
3
- import { type GlobalEvents } from './utils/events';
4
- import { type InteractiveRange } from './utils/getInteractiveRanges';
5
- import type { IInteractiveOptions, IOptionalInteractiveOptions, VideoInfo } from './types';
6
- import type { IPlayer } from '@vkontakte/videoplayer-core';
7
- import type { InstanceStatistics } from '../../modules/SeamlessController/InstanceManager';
1
+ import type { Nullable } from "@vkontakte/videoplayer-shared";
2
+ import { Observable, ValueSubject } from "@vkontakte/videoplayer-shared";
3
+ import { InteractiveInterfaceClick } from "@vkontakte/videoplayer-statistics";
4
+ import type { Chapter, Manifest, AnyManifest, ManifestVideo, GraphEditChapter, GraphViewChapter } from "../../manifest";
5
+ import { type GlobalEvents } from "./utils/events";
6
+ import { type InteractiveRange } from "./utils/getInteractiveRanges";
7
+ import { type HistoryControllerState } from "./utils/HistoryController";
8
+ import type { IInteractiveOptions, IOptionalInteractiveOptions, VideoInfo } from "./types";
9
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
10
+ import type { InstanceStatistics } from "../SeamlessController/InstanceManager";
8
11
  declare enum INTERACTIVE_APP_STATES {
9
- created = 0,
10
- initiated = 1,
11
- ready = 2,
12
- destroyed = 3
12
+ created = 0,
13
+ initiated = 1,
14
+ ready = 2,
15
+ destroyed = 3
13
16
  }
14
17
  export declare class Interactives {
15
- private playerSubscriptions;
16
- private subscriptions;
17
- private globalEventEmitter;
18
- private animation;
19
- private seekToInteractiveController;
20
- private endedRanges;
21
- private gameControllers;
22
- private rootElement;
23
- private factories;
24
- private isFirstChapterFetched;
25
- private _options;
26
- private manifestController;
27
- private resizeManager;
28
- private readonly cssVarsManager;
29
- private historyController;
30
- private player;
31
- private interactiveEvents;
32
- private selectBranches;
33
- private seamlessController;
34
- private seamlessControllerSubs;
35
- private graph;
36
- private lastFrame;
37
- private noInteractionTimeout;
38
- private blinkAnimationRef;
39
- appState: INTERACTIVE_APP_STATES;
40
- state: {
41
- prevChapter$: ValueSubject<Nullable<Chapter>>;
42
- isInitialChapter$: ValueSubject<boolean>;
43
- isFirstChapter$: ValueSubject<boolean>;
44
- isEndChapter$: ValueSubject<boolean>;
45
- isInteractiveExpectation$: ValueSubject<boolean>;
46
- isReplay$: ValueSubject<boolean>;
47
- calledByInteractive$: ValueSubject<boolean>;
48
- lastChapterChangeWasInitiatedByInteractive$: ValueSubject<boolean>;
49
- disabledControls$: ValueSubject<boolean>;
50
- interactiveRanges$: ValueSubject<InteractiveRange[]>;
51
- isInteractiveTime$: ValueSubject<boolean>;
52
- statistics$: ValueSubject<Nullable<InstanceStatistics>>;
53
- isSeekable$: ValueSubject<boolean>;
54
- };
55
- events: GlobalEvents;
56
- constructor(options: IOptionalInteractiveOptions);
57
- private emitErrorEvent;
58
- private clearHistoryIfEnded;
59
- private initSubscriptions;
60
- private initSeamless;
61
- private handleSeamlessPlayerChanged;
62
- private onPlaybackStarted;
63
- private handlePositionChange;
64
- private registerVideoEvents;
65
- private destroyGameControllers;
66
- private setGameControllers;
67
- private getGameControllers;
68
- private checkIfSeekable;
69
- private updateLastEventInfo;
70
- private pushChapterToHistory;
71
- private completeInteractiveRange;
72
- private handleFakeRemoval;
73
- private clearNoInteractionTimeout;
74
- private reset;
75
- private toggleBlinkAnimation;
76
- private updateControlsShadowStyles;
77
- get options(): IInteractiveOptions;
78
- init(): void;
79
- setManifest(manifest: AnyManifest | string): Promise<Manifest | undefined>;
80
- setPlayer(player: IPlayer): void;
81
- setChapter({ chapterId, pushToHistory, playPrev, }?: {
82
- chapterId?: string;
83
- pushToHistory?: boolean;
84
- playPrev?: boolean;
85
- }): Promise<void>;
86
- getStatEvents(): {
87
- click$: Observable<unknown>;
88
- nextMovie$: Observable<unknown>;
89
- };
90
- toggleGraphView(show?: boolean): Promise<void>;
91
- setVisitedChapters(chapterIds: string[]): void;
92
- updateGraphVideosInfo(videosInfo: VideoInfo[]): void;
93
- deadEndCheck(): boolean;
94
- /**
95
- * Проверяет, удалены ли все контроллы.
96
- *
97
- * Контрол считается удалённым, если его флаг `isRemoved` установлен в `true`.
98
- * Однако, есть исключение для `openURI` — если с ним было взаимодействие, он
99
- * получит `isRemoved = true`, но может оставаться в DOM до завершения эпизода
100
- * (`endTime`).
101
- *
102
- * Из-за этого метод может вернуть `true` (что все контроллы "удалены"), хотя
103
- * `openURI` всё ещё присутствует в DOM.
104
- *
105
- * includeWillRemovedState - нужно ли считать состояние 'willRemoved' как
106
- * 'removed'
107
- */
108
- allControlsAreRemoved(includeWillRemovedState?: boolean): boolean;
109
- isEndedExpectation(): boolean;
110
- playPrevChapter(): void;
111
- setDisabledControls(value: boolean): void;
112
- isSupport(manifest?: Nullable<Manifest>): boolean;
113
- getInitialVideoInfo(): {
114
- videoId: string | null;
115
- chapterId: string;
116
- };
117
- getHistoryState(): import("./utils/HistoryController").HistoryControllerState;
118
- /**
119
- * @deprecated Используйте this.state.isSeekable$
120
- */
121
- getIsSeekable(): ValueSubject<boolean>;
122
- getInteractiveRanges(): import("./utils/getInteractiveRanges").InteractiveRanges;
123
- getNextInteractiveStartTime(offsetMs?: number): number | null;
124
- getChapterBranches(chapterId?: string): {
125
- chapter: Chapter;
126
- graph: import("../../manifest").GraphEditChapter | import("../../manifest").GraphViewChapter | undefined;
127
- media: import("../../manifest").ManifestVideo;
128
- }[];
129
- getCurrentChapter(): {
130
- chapter: Nullable<Chapter>;
131
- media: Nullable<import("../../manifest").ManifestVideo>;
132
- graph: Nullable<import("@interactiveplatform/movika-manifest").GraphDesign>;
133
- };
134
- getCurrentManifest(): Nullable<Manifest>;
135
- on(eventName: string, fn: AnyFn): this;
136
- off(eventName: string, fn: AnyFn): this;
137
- once(eventName: string, fn: AnyFn): this;
138
- destroy(): void;
18
+ private playerSubscriptions;
19
+ private subscriptions;
20
+ private globalEventEmitter;
21
+ private animation;
22
+ private seekToInteractiveController;
23
+ private endedRanges;
24
+ private gameControllers;
25
+ private rootElement;
26
+ private factories;
27
+ private isFirstChapterFetched;
28
+ private _options;
29
+ private manifestController;
30
+ private resizeManager;
31
+ private readonly cssVarsManager;
32
+ private historyController;
33
+ private player;
34
+ private interactiveEvents;
35
+ private selectBranches;
36
+ private seamlessController;
37
+ private seamlessControllerSubs;
38
+ private graph;
39
+ private lastFrame;
40
+ private noInteractionTimeout;
41
+ private blinkAnimationRef;
42
+ appState: INTERACTIVE_APP_STATES;
43
+ state: {
44
+ prevChapter$: ValueSubject<Nullable<Chapter>>;
45
+ isInitialChapter$: ValueSubject<boolean>;
46
+ isFirstChapter$: ValueSubject<boolean>;
47
+ isEndChapter$: ValueSubject<boolean>;
48
+ isInteractiveExpectation$: ValueSubject<boolean>;
49
+ isReplay$: ValueSubject<boolean>;
50
+ calledByInteractive$: ValueSubject<boolean>;
51
+ lastChapterChangeWasInitiatedByInteractive$: ValueSubject<boolean>;
52
+ disabledControls$: ValueSubject<boolean>;
53
+ interactiveRanges$: ValueSubject<InteractiveRange[]>;
54
+ isInteractiveTime$: ValueSubject<boolean>;
55
+ statistics$: ValueSubject<Nullable<InstanceStatistics>>;
56
+ isSeekable$: ValueSubject<boolean>;
57
+ };
58
+ events: GlobalEvents;
59
+ constructor(options: IOptionalInteractiveOptions);
60
+ private emitErrorEvent;
61
+ private clearHistoryIfEnded;
62
+ private initSubscriptions;
63
+ private initSeamless;
64
+ private handleSeamlessPlayerChanged;
65
+ private onPlaybackStarted;
66
+ private handlePositionChange;
67
+ private registerVideoEvents;
68
+ private destroyGameControllers;
69
+ private setGameControllers;
70
+ private getGameControllers;
71
+ private checkIfSeekable;
72
+ private updateLastEventInfo;
73
+ private pushChapterToHistory;
74
+ private completeInteractiveRange;
75
+ private handleFakeRemoval;
76
+ private clearNoInteractionTimeout;
77
+ private reset;
78
+ private toggleBlinkAnimation;
79
+ private updateControlsShadowStyles;
80
+ get options(): IInteractiveOptions;
81
+ init(): void;
82
+ setManifest(manifest: AnyManifest | string): Promise<Manifest | undefined>;
83
+ setPlayer(player: IPlayer): void;
84
+ setChapter({ chapterId, pushToHistory, playPrev }?: {
85
+ chapterId?: string;
86
+ pushToHistory?: boolean;
87
+ playPrev?: boolean;
88
+ }): Promise<void>;
89
+ getStatEvents(): {
90
+ click$: Observable<InteractiveInterfaceClick>;
91
+ nextMovie$: Observable<number>;
92
+ };
93
+ toggleGraphView(show?: boolean): Promise<void>;
94
+ setVisitedChapters(chapterIds: string[]): void;
95
+ updateGraphVideosInfo(videosInfo: VideoInfo[]): void;
96
+ deadEndCheck(): boolean;
97
+ /**
98
+ * Проверяет, удалены ли все контроллы.
99
+ *
100
+ * Контрол считается удалённым, если его флаг `isRemoved` установлен в `true`.
101
+ * Однако, есть исключение для `openURI` — если с ним было взаимодействие, он
102
+ * получит `isRemoved = true`, но может оставаться в DOM до завершения эпизода
103
+ * (`endTime`).
104
+ *
105
+ * Из-за этого метод может вернуть `true` (что все контроллы "удалены"), хотя
106
+ * `openURI` всё ещё присутствует в DOM.
107
+ *
108
+ * includeWillRemovedState - нужно ли считать состояние 'willRemoved' как
109
+ * 'removed'
110
+ */
111
+ allControlsAreRemoved(includeWillRemovedState?: boolean): boolean;
112
+ isEndedExpectation(): boolean;
113
+ playPrevChapter(): void;
114
+ setDisabledControls(value: boolean): void;
115
+ isSupport(manifest?: Nullable<Manifest>): boolean;
116
+ getInitialVideoInfo(): {
117
+ videoId: string | null;
118
+ chapterId: string;
119
+ };
120
+ getHistoryState(): HistoryControllerState;
121
+ /**
122
+ * @deprecated Используйте this.state.isSeekable$
123
+ */
124
+ getIsSeekable(): ValueSubject<boolean>;
125
+ getInteractiveRanges(): InteractiveRange[];
126
+ getNextInteractiveStartTime(offsetMs?: number): number | null;
127
+ getChapterBranches(chapterId?: string): Array<{
128
+ chapter: Chapter;
129
+ graph: GraphEditChapter | GraphViewChapter | undefined;
130
+ media: ManifestVideo;
131
+ }>;
132
+ getCurrentChapter(): {
133
+ chapter: Nullable<Chapter>;
134
+ media: Nullable<ManifestVideo>;
135
+ graph: Nullable<Manifest["graph"]>;
136
+ };
137
+ getCurrentManifest(): Nullable<Manifest>;
138
+ on(eventName: string, fn: AnyFn): this;
139
+ off(eventName: string, fn: AnyFn): this;
140
+ once(eventName: string, fn: AnyFn): this;
141
+ destroy(): void;
139
142
  }
140
143
  export {};
@@ -1,16 +1,16 @@
1
- import { ChapterContainer, ControlLayoutParams } from '../../manifest';
2
- import { CssVarsManager } from '../../utils/CssVarsManager';
1
+ import type { ChapterContainer, ControlLayoutParams } from "../../manifest";
2
+ import type { CssVarsManager } from "../../utils/CssVarsManager";
3
3
  declare abstract class Layout {
4
- layout: ChapterContainer['layout'];
5
- cssVarsManager: CssVarsManager;
6
- protected constructor(layout: ChapterContainer['layout'], cssVarsManager: CssVarsManager);
7
- abstract setContainerLayout(target: HTMLElement): void;
8
- abstract setControlLayout(target: HTMLElement, layoutParams: ControlLayoutParams): void;
4
+ layout: ChapterContainer["layout"];
5
+ cssVarsManager: CssVarsManager;
6
+ protected constructor(layout: ChapterContainer["layout"], cssVarsManager: CssVarsManager);
7
+ abstract setContainerLayout(target: HTMLElement): void;
8
+ abstract setControlLayout(target: HTMLElement, layoutParams: ControlLayoutParams): void;
9
9
  }
10
10
  export declare class RelativeLayout extends Layout {
11
- cssVarsManager: CssVarsManager;
12
- constructor(layout: ChapterContainer['layout'], cssVarsManager: CssVarsManager);
13
- setContainerLayout(target: HTMLElement): void;
14
- setControlLayout(target: HTMLElement, layoutParams: ControlLayoutParams): void;
11
+ cssVarsManager: CssVarsManager;
12
+ constructor(layout: ChapterContainer["layout"], cssVarsManager: CssVarsManager);
13
+ setContainerLayout(target: HTMLElement): void;
14
+ setControlLayout(target: HTMLElement, layoutParams: ControlLayoutParams): void;
15
15
  }
16
16
  export {};
@@ -1,34 +1,34 @@
1
- import { Container } from './Container';
2
- import { ChapterContainer } from '../../../manifest';
3
- import type { ChoiceContainerOptions, ContainerCreateViewParams } from './types';
4
- import { Nullable } from '@vkontakte/videoplayer-shared';
5
- import { CssVarsManager } from '../../../utils/CssVarsManager';
1
+ import { Container } from "./Container";
2
+ import type { ChapterContainer } from "../../../manifest";
3
+ import type { ChoiceContainerOptions, ContainerCreateViewParams } from "./types";
4
+ import type { Nullable } from "@vkontakte/videoplayer-shared";
5
+ import type { CssVarsManager } from "../../../utils/CssVarsManager";
6
6
  export declare const createChoiceContainer: (container: ChapterContainer, rootElement: HTMLElement, cssVarsManager: CssVarsManager, options?: ChoiceContainerOptions) => ChoiceContainer | undefined;
7
7
  export declare class ChoiceContainer extends Container {
8
- private rootElement;
9
- private containerElement;
10
- private layout;
11
- private subscriptions;
12
- isRemoved: boolean;
13
- isDisabled: boolean;
14
- willRemoved: boolean;
15
- readonly cssVarsManager: CssVarsManager;
16
- constructor(container: ChapterContainer, rootElement: HTMLElement, cssVarsManager: CssVarsManager, options?: ChoiceContainerOptions);
17
- createView({ eventCallback, videoDurationMs }: ContainerCreateViewParams): HTMLElement;
18
- updateControlsFillAnimationDimensions(): void;
19
- hide(): void;
20
- show(): void;
21
- enable(): void;
22
- disable(): void;
23
- removeView(withTransition?: boolean, useDelay?: boolean): void;
24
- private onTransitionEnd;
25
- removeAllControls(withTransition?: boolean): void;
26
- removeNonInteractedControls(withTransition?: boolean): void;
27
- isInteracted(): boolean;
28
- fakeRemove(): void;
29
- getElement(): Nullable<HTMLElement>;
30
- onProgress(currentTimeMs: number, isInteractiveTime: boolean): void;
31
- onResize(isInteractiveTime: boolean): void;
32
- updateControlsShadowStyles(isDark?: boolean): void;
33
- toggleBlinkAnimation(enable?: boolean): void;
8
+ private rootElement;
9
+ private containerElement;
10
+ private layout;
11
+ private subscriptions;
12
+ isRemoved: boolean;
13
+ isDisabled: boolean;
14
+ willRemoved: boolean;
15
+ readonly cssVarsManager: CssVarsManager;
16
+ constructor(container: ChapterContainer, rootElement: HTMLElement, cssVarsManager: CssVarsManager, options?: ChoiceContainerOptions);
17
+ createView({ eventCallback, videoDurationMs }: ContainerCreateViewParams): HTMLElement;
18
+ updateControlsFillAnimationDimensions(): void;
19
+ hide(): void;
20
+ show(): void;
21
+ enable(): void;
22
+ disable(): void;
23
+ removeView(withTransition?: boolean, useDelay?: boolean): void;
24
+ private onTransitionEnd;
25
+ removeAllControls(withTransition?: boolean): void;
26
+ removeNonInteractedControls(withTransition?: boolean): void;
27
+ isInteracted(): boolean;
28
+ fakeRemove(): void;
29
+ getElement(): Nullable<HTMLElement>;
30
+ onProgress(currentTimeMs: number, isInteractiveTime: boolean): void;
31
+ onResize(isInteractiveTime: boolean): void;
32
+ updateControlsShadowStyles(isDark?: boolean): void;
33
+ toggleBlinkAnimation(enable?: boolean): void;
34
34
  }
@@ -1,21 +1,21 @@
1
- import { Subject } from '@vkontakte/videoplayer-shared';
2
- import { CustomError } from '../../../utils/Error';
3
- import type { ChapterContainer } from '../../../manifest';
4
- import { type Control, type ControlCreator, type Options } from '../../../modules/Interactives/controls';
5
- import { type ChoiceContainerOptions } from './types';
6
- import { CssVarsManager } from '../../../utils/CssVarsManager';
1
+ import { Subject } from "@vkontakte/videoplayer-shared";
2
+ import type { CustomError } from "../../../utils/Error";
3
+ import type { ChapterContainer } from "../../../manifest";
4
+ import { type Control, type ControlCreator, type Options } from "../controls";
5
+ import { type ChoiceContainerOptions } from "./types";
6
+ import type { CssVarsManager } from "../../../utils/CssVarsManager";
7
7
  export declare class Container {
8
- container: ChapterContainer;
9
- options?: Options;
10
- private factories;
11
- controls: Control[];
12
- error$: Subject<CustomError>;
13
- readonly cssVarsManager: CssVarsManager;
14
- constructor(container: ChapterContainer, cssVarsManager: CssVarsManager, options?: Options);
15
- featureIsEnabled(name: keyof ChoiceContainerOptions['features']): unknown;
16
- onError(message: string | undefined, error: unknown): void;
17
- addControlFactory(type: string, factory: ControlCreator<any>): void;
18
- removeControlFactory(type: string): void;
19
- private setControls;
20
- private chooseControls;
8
+ container: ChapterContainer;
9
+ options?: Options;
10
+ private factories;
11
+ controls: Control[];
12
+ error$: Subject<CustomError>;
13
+ readonly cssVarsManager: CssVarsManager;
14
+ constructor(container: ChapterContainer, cssVarsManager: CssVarsManager, options?: Options);
15
+ featureIsEnabled(name: keyof ChoiceContainerOptions["features"]): boolean;
16
+ onError(message: string | undefined, error: unknown): void;
17
+ addControlFactory(type: string, factory: ControlCreator<any>): void;
18
+ removeControlFactory(type: string): void;
19
+ private setControls;
20
+ private chooseControls;
21
21
  }
@@ -1,4 +1,4 @@
1
- export * from './ChoiceContainer';
2
- export * from './Container';
3
- export * from './types';
4
- export * from './utils';
1
+ export * from "./ChoiceContainer";
2
+ export * from "./Container";
3
+ export * from "./types";
4
+ export * from "./utils";
@@ -1,11 +1,11 @@
1
- import { Options, ControlEventCallback } from '../controls';
2
- import { AnimationsFeatureToggles } from '../types';
1
+ import type { Options, ControlEventCallback } from "../controls";
2
+ import type { AnimationsFeatureToggles } from "../types";
3
3
  export type ChoiceContainerOptions = {
4
- isTouch: boolean;
5
- features: Pick<AnimationsFeatureToggles, 'controlsExpectTimeBlinkAnimation' | 'controlsTapPlace' | 'controlsFillAnimation'>;
4
+ isTouch: boolean;
5
+ features: Pick<AnimationsFeatureToggles, "controlsExpectTimeBlinkAnimation" | "controlsTapPlace" | "controlsFillAnimation">;
6
6
  };
7
7
  export declare function isChoiceContainerOptions(options: Options): options is ChoiceContainerOptions;
8
8
  export type ContainerCreateViewParams = {
9
- eventCallback: ControlEventCallback;
10
- videoDurationMs: number;
9
+ eventCallback: ControlEventCallback;
10
+ videoDurationMs: number;
11
11
  };