@vkontakte/videoplayer-interactive 1.0.27-dev.60ca8010.0 → 1.0.27-dev.7d383bee.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 (57) hide show
  1. package/es2015.cjs.js +6 -6
  2. package/es2015.esm.js +5 -5
  3. package/es2018.cjs.js +6 -6
  4. package/es2018.esm.js +6 -6
  5. package/esnext.cjs.js +5 -5
  6. package/esnext.esm.js +5 -5
  7. package/evergreen.esm.js +6 -6
  8. package/package.json +6 -6
  9. package/types/index.d.ts +3 -2
  10. package/types/modules/Graph/Graph.d.ts +2 -3
  11. package/types/modules/Interactives/Interactives.d.ts +13 -13
  12. package/types/modules/Interactives/Layout.d.ts +7 -7
  13. package/types/modules/Interactives/containers/ChoiceContainer.d.ts +3 -3
  14. package/types/modules/Interactives/containers/Container.d.ts +4 -4
  15. package/types/modules/Interactives/controls/Control.d.ts +4 -3
  16. package/types/modules/Interactives/controls/types.d.ts +5 -4
  17. package/types/modules/Interactives/index.d.ts +2 -2
  18. package/types/modules/Interactives/types.d.ts +3 -3
  19. package/types/modules/Interactives/utils/GameController.d.ts +2 -2
  20. package/types/modules/Interactives/utils/GroupsStack.d.ts +5 -5
  21. package/types/modules/Interactives/utils/HistoryController.d.ts +2 -3
  22. package/types/modules/Interactives/utils/InteractiveEvents.d.ts +2 -2
  23. package/types/modules/Interactives/utils/SelectBranches.d.ts +2 -2
  24. package/types/modules/Interactives/utils/SelectBranches.types.d.ts +12 -12
  25. package/types/modules/Interactives/utils/events.d.ts +2 -2
  26. package/types/modules/Interactives/utils/fallbackStrategies.d.ts +6 -6
  27. package/types/modules/Interactives/utils/gameUtils.d.ts +14 -14
  28. package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +1 -1
  29. package/types/modules/Interactives/utils/renderingUtils.d.ts +7 -9
  30. package/types/modules/Loaders/vkVideoLoader/types.d.ts +2 -2
  31. package/types/modules/Loaders/vkVideoLoader/utils.d.ts +2 -0
  32. package/types/modules/ManifestController/ManifestController.d.ts +12 -11
  33. package/types/modules/ManifestController/utils.d.ts +6 -6
  34. package/types/modules/SeamlessController/SeamlessController.d.ts +2 -2
  35. package/types/modules/SeamlessController/utils.d.ts +2 -2
  36. package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +2 -2
  37. package/types/movika.core/manifest/index.d.ts +28 -0
  38. package/types/movika.core/manifest/manifest_3_2/chapter.d.ts +63 -0
  39. package/types/movika.core/manifest/manifest_3_2/control.d.ts +67 -0
  40. package/types/movika.core/manifest/manifest_3_2/manifest.d.ts +50 -0
  41. package/types/movika.core/manifest/manifest_3_2/template.d.ts +34 -0
  42. package/types/movika.core/manifest/manifest_3_3/chapter.d.ts +72 -0
  43. package/types/movika.core/manifest/manifest_3_3/control.d.ts +66 -0
  44. package/types/movika.core/manifest/manifest_3_3/graph.d.ts +73 -0
  45. package/types/movika.core/manifest/manifest_3_3/manifest.d.ts +52 -0
  46. package/types/movika.core/manifest/manifest_3_3/template.d.ts +34 -0
  47. package/types/movika.core/manifest/migrations/index.d.ts +1 -0
  48. package/types/movika.core/manifest/migrations/migrateManifestToLatestVersion.d.ts +1 -0
  49. package/types/movika.core/manifest/migrations/migrate_from_3_0_to_3_1.d.ts +21 -0
  50. package/types/movika.core/manifest/migrations/migrate_from_3_1_to_3_2.d.ts +2 -0
  51. package/types/movika.core/manifest/migrations/migrate_from_3_2_to_3_3.d.ts +8 -0
  52. package/types/{manifest/utils.d.ts → movika.core/manifest/types.d.ts} +6 -23
  53. package/types/movika.core/manifest/utils.d.ts +5 -0
  54. package/types/utils/LastFrame.d.ts +1 -1
  55. package/types/utils/chapterHelpers.d.ts +1 -1
  56. package/types/utils/extractVkMovieId.d.ts +1 -1
  57. package/types/manifest/index.d.ts +0 -3
@@ -3,7 +3,7 @@ import type { IOptionalTuningConfig, IPlayer } from '@vkontakte/videoplayer-core
3
3
  import type { IOneStat } from '@vkontakte/videoplayer-statistics';
4
4
  import type { Loaders } from '../../modules/ManifestController/Loadable';
5
5
  import type { HistoryApi, HistorySettings } from '../../modules/Interactives/utils/HistoryController';
6
- import type { Chapter, ManifestVideo } from '../../manifest';
6
+ import type { LatestChapter, LatestManifestVideo } from '../../movika.core/manifest';
7
7
  export type VideoInfo = {
8
8
  id: string;
9
9
  cover: string;
@@ -45,8 +45,8 @@ export interface IInteractiveOptions {
45
45
  disableControlsOnPause?: boolean;
46
46
  }
47
47
  export type ChapterChangedData = {
48
- chapter: Chapter;
49
- manifestVideo: ManifestVideo;
48
+ chapter: LatestChapter;
49
+ manifestVideo: LatestManifestVideo;
50
50
  };
51
51
  export type PlayerChangedData<T = any> = {
52
52
  player: IPlayer;
@@ -1,7 +1,7 @@
1
1
  import { type ISubscription, type IValueSubject } from '@vkontakte/videoplayer-shared';
2
2
  import { type IPlayer } from '@vkontakte/videoplayer-core';
3
3
  import type { InteractiveEventsType } from './InteractiveEvents';
4
- import type { ChapterBranch } from '../../../manifest';
4
+ import type { LatestChapterBranch } from '../../../movika.core/manifest';
5
5
  import type { EventEmitter } from '../../../utils/EventEmitter';
6
6
  import type { ChoiceContainer } from "../../../modules/Interactives/containers";
7
7
  import { SelectBranches } from './SelectBranches';
@@ -9,7 +9,7 @@ import { type GlobalEvents } from './events';
9
9
  import { GameStates } from './gameUtils';
10
10
  export declare class GameController {
11
11
  container: ChoiceContainer;
12
- branches: ChapterBranch[];
12
+ branches: LatestChapterBranch[];
13
13
  selectBranches: ReturnType<typeof SelectBranches>;
14
14
  subscription: ISubscription;
15
15
  player: IPlayer;
@@ -1,7 +1,7 @@
1
- import type { EventActionKeys } from '../../../manifest';
1
+ import { type EventActionTypes } from '../../../movika.core/manifest';
2
2
  export type TPriority = 'chapter' | 'container' | 'control';
3
3
  export type TPayload = {
4
- actionType: EventActionKeys;
4
+ actionType: EventActionTypes;
5
5
  action: AnyFn;
6
6
  };
7
7
  export type TMapInitiator = {
@@ -13,17 +13,17 @@ type TMapPriority = {
13
13
  type TMap = {
14
14
  [timestamp: number]: TMapPriority;
15
15
  };
16
- export type TMapFlattened = {
16
+ export type TMapMapFlattened = {
17
17
  timestamp: number;
18
18
  priority: TPriority;
19
19
  initiator: string;
20
20
  } & TPayload;
21
- type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<TMapFlattened, 'timestamp'>;
21
+ type GetAndRemoveArgType = Partial<Omit<TMapMapFlattened, keyof TPayload>> & Pick<TMapMapFlattened, 'timestamp'>;
22
22
  export type TGroupsStack = ReturnType<typeof GroupsStack>;
23
23
  export declare function GroupsStack(): {
24
24
  map: TMap;
25
25
  remove: ({ timestamp, priority, initiator }: GetAndRemoveArgType) => boolean;
26
- add: ({ timestamp, priority, initiator, ...rest }: TMapFlattened) => void;
26
+ add: ({ timestamp, priority, initiator, ...rest }: TMapMapFlattened) => void;
27
27
  removeAll: () => void;
28
28
  get: ({ timestamp, priority, initiator }: GetAndRemoveArgType) => TMapInitiator | TPayload[] | TMapPriority | null;
29
29
  getLte: (timestamp: number) => TMap;
@@ -1,9 +1,8 @@
1
1
  import { Nullable, Subject } from '@vkontakte/videoplayer-shared';
2
2
  import type { IValueSubject } from '@vkontakte/videoplayer-shared';
3
3
  import { EventEmitter } from '../../../utils/EventEmitter';
4
- import type { VideoId } from '../../../manifest';
5
- import type { VideoInfo } from "../../../modules/Interactives";
6
- import type { Interactives } from '../../../modules/Interactives';
4
+ import type { VideoId } from '../../../movika.core/manifest';
5
+ import type { Interactives, VideoInfo } from '../../../modules/Interactives';
7
6
  import { CustomError } from '../../../utils/Error';
8
7
  export interface HistoryApi {
9
8
  get: (rawId: string) => Promise<number[]>;
@@ -1,4 +1,4 @@
1
- import { type Container } from '../../../manifest';
1
+ import { type LatestContainer } from '../../../movika.core/manifest';
2
2
  import { type TPayload, type TGroupsStack } from './GroupsStack';
3
3
  import type { IPlayer } from '@vkontakte/videoplayer-core';
4
4
  export type InteractiveEventsType = ReturnType<typeof InteractiveEvents>;
@@ -21,7 +21,7 @@ export declare function InteractiveEvents(player: IPlayer): {
21
21
  timestamp: any;
22
22
  id: any;
23
23
  }) => void;
24
- setData: (containers?: Container[]) => void;
24
+ setData: (containers?: LatestContainer[]) => void;
25
25
  resetCalled: (timestamp: number) => void;
26
26
  isReady: (timestamp: number) => boolean;
27
27
  release: () => void;
@@ -1,4 +1,4 @@
1
- import type { Chapter } from '../../../manifest';
1
+ import type { LatestChapter } from '../../../movika.core/manifest';
2
2
  import type { SelectBranchesArg, OnControlEventArg, ContinuePlaybackArg, ExpectEventHandlerArg, OnChapterEventArg, OnContainerEventArg, OnExpectEventArg, SetManifestContainerEventsArg, ActionMap, AnyAction } from './SelectBranches.types';
3
3
  export declare const defaultArgs: {
4
4
  readonly shouldOpenNow: true;
@@ -11,7 +11,7 @@ export declare const SelectBranches: ({ globalEventEmitter, player, interactiveE
11
11
  onChapterEvent: ({ chapterId, action, branches }: OnChapterEventArg) => (() => ContinuePlaybackArg<"chapter">) | undefined;
12
12
  onExpectEvent: <T extends keyof ActionMap>({ subjectId, subjectName }: OnExpectEventArg<T>) => void;
13
13
  expectEventHandler: <T extends keyof ActionMap>({ subjectId, subjectName }: ExpectEventHandlerArg<T>) => void;
14
- setManifestChapterEvents: (chapter: Chapter) => void;
14
+ setManifestChapterEvents: (chapter: LatestChapter) => void;
15
15
  setManifestContainerEvents: ({ container, branches, isEOV }: SetManifestContainerEventsArg) => void;
16
16
  stopExpect: () => void;
17
17
  state: {
@@ -1,4 +1,4 @@
1
- import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from '../../../manifest';
1
+ import type { LatestContainer, ControlEvent, LatestControl, LatestChapterBranch, ContainerEvent, ChapterEvent } from '../../../movika.core/manifest';
2
2
  import type { EventEmitter } from '../../../utils/EventEmitter';
3
3
  import type { IPlayer } from '@vkontakte/videoplayer-core';
4
4
  import type { InteractiveEventsType } from './InteractiveEvents';
@@ -11,29 +11,29 @@ export type SelectBranchesArg = {
11
11
  };
12
12
  export type OnControlEventArg = {
13
13
  action: ControlEvent['action'];
14
- controlType: Control['type'];
15
- controlId: Control['id'];
16
- containerId: ChapterContainer['id'];
14
+ controlType: LatestControl['type'];
15
+ controlId: LatestControl['id'];
16
+ containerId: LatestContainer['id'];
17
17
  onEvent: AnyFn;
18
- branches?: ChapterBranch[];
18
+ branches?: LatestChapterBranch[];
19
19
  isEOV?: () => boolean;
20
20
  isDisabled?: () => boolean;
21
21
  };
22
22
  export type OnContainerEventArg = {
23
23
  action: ContainerEvent['action'];
24
- container: ChapterContainer;
24
+ container: LatestContainer;
25
25
  autoSelected?: boolean;
26
- branches?: ChapterBranch[];
26
+ branches?: LatestChapterBranch[];
27
27
  isEOV?: boolean;
28
28
  };
29
29
  export type OnChapterEventArg = {
30
30
  action: ChapterEvent['action'];
31
31
  chapterId: string;
32
- branches?: ChapterBranch[];
32
+ branches?: LatestChapterBranch[];
33
33
  };
34
34
  export type SetManifestContainerEventsArg = {
35
- container: ChapterContainer;
36
- branches: ChapterBranch[];
35
+ container: LatestContainer;
36
+ branches: LatestChapterBranch[];
37
37
  isEOV?: boolean;
38
38
  };
39
39
  export type AnyAction = ControlEvent['action'] | ContainerEvent['action'] | ChapterEvent['action'];
@@ -42,7 +42,7 @@ export type ActionMap = {
42
42
  container: ContainerEvent['action'];
43
43
  chapter: ChapterEvent['action'];
44
44
  };
45
- export type SubjectType<T extends keyof ActionMap> = T extends 'control' ? Control['type'] : undefined;
45
+ export type SubjectType<T extends keyof ActionMap> = T extends 'control' ? LatestControl['type'] : undefined;
46
46
  export type EventActionCommon<T extends keyof ActionMap> = {
47
47
  subjectId: string;
48
48
  subjectName: T;
@@ -53,7 +53,7 @@ export type EventActionCommonWithAction<T extends keyof ActionMap> = EventAction
53
53
  };
54
54
  export type OpenURIArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
55
55
  payload: {
56
- URI?: Nullable<string>;
56
+ URI?: string;
57
57
  };
58
58
  };
59
59
  export type ChangeManifestArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
@@ -1,7 +1,7 @@
1
1
  import type { Subject } from '@vkontakte/videoplayer-shared';
2
2
  import type { ChapterChangedData, EachTickData, PlayerChangedData } from '../../../modules/Interactives/types';
3
3
  import type { CustomError } from '../../../utils/Error';
4
- import type { Manifest } from '../../../manifest';
4
+ import type { LatestManifest } from '../../../movika.core/manifest';
5
5
  export interface GlobalEvents {
6
6
  noInteraction$: Subject<void>;
7
7
  graphVisibilityChanged$: Subject<boolean>;
@@ -10,7 +10,7 @@ export interface GlobalEvents {
10
10
  playerChanged$: Subject<PlayerChangedData>;
11
11
  error$: Subject<CustomError>;
12
12
  eachTick$: Subject<EachTickData>;
13
- manifestChanged$: Subject<Manifest>;
13
+ manifestChanged$: Subject<LatestManifest>;
14
14
  }
15
15
  export declare const EVENT_NAMES: {
16
16
  /**
@@ -1,4 +1,4 @@
1
- import { type ChapterBranch } from '../../../manifest';
1
+ import { type LatestChapterBranch } from '../../../movika.core/manifest';
2
2
  /**
3
3
  * Returns a random number in the range [0, limit) or [limit, 0) if the 'limit'
4
4
  * value is negative
@@ -7,17 +7,17 @@ export declare const getRandomNumber: (limit: number) => number;
7
7
  /**
8
8
  * Finds the value with minimal weight number
9
9
  */
10
- export declare const minFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
10
+ export declare const minFallbackStrategy: (branches: LatestChapterBranch[]) => Nullable<import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch>;
11
11
  /**
12
12
  * Finds the value with maximal weight number
13
13
  */
14
- export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
14
+ export declare const maxFallbackStrategy: (branches: LatestChapterBranch[]) => Nullable<import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch>;
15
15
  /**
16
16
  * Finds first branch with `isDefault === true` value
17
17
  */
18
- export declare const defaultFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch | undefined;
18
+ export declare const defaultFallbackStrategy: (branches: LatestChapterBranch[]) => import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch | undefined;
19
19
  /**
20
20
  * Returns the random branch
21
21
  */
22
- export declare const weightlessRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
23
- export declare const weightyRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
22
+ export declare const weightlessRandomFallbackStrategy: (branches: LatestChapterBranch[]) => import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch;
23
+ export declare const weightyRandomFallbackStrategy: (branches: LatestChapterBranch[]) => import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterBranch;
@@ -1,4 +1,4 @@
1
- import { type Control, type Chapter, type ChapterContainer } from '../../../manifest';
1
+ import { type LatestControl, type LatestChapter, type LatestContainer } from '../../../movika.core/manifest';
2
2
  import type { GameController } from './GameController';
3
3
  export declare enum GameStates {
4
4
  nothing = 0,
@@ -9,20 +9,20 @@ export declare enum GameStates {
9
9
  removed = 5,
10
10
  destroyed = 6
11
11
  }
12
- export declare const isControlsExist: (controls: Control[]) => boolean;
13
- export declare const isLastChapter: (chapter: Chapter) => boolean;
14
- export declare const hasEndTemplate: (chapter: Chapter) => boolean;
15
- export declare const isBeforeStartTime: (currentTime: number, container: ChapterContainer) => boolean;
16
- export declare const isInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
17
- export declare const isAfterInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
18
- type AnyEvent = (ChapterContainer | Chapter | Control)['events'];
12
+ export declare const isControlsExist: (controls: LatestControl[]) => boolean;
13
+ export declare const isLastChapter: (chapter: LatestChapter) => boolean;
14
+ export declare const hasEndTemplate: (chapter: LatestChapter) => boolean;
15
+ export declare const isBeforeStartTime: (currentTime: number, container: LatestContainer) => boolean;
16
+ export declare const isInteractiveTime: (currentTime: number, container: LatestContainer) => boolean;
17
+ export declare const isAfterInteractiveTime: (currentTime: number, container: LatestContainer) => boolean;
18
+ type AnyEvent = LatestContainer['events'] | LatestChapter['events'] | LatestControl['events'];
19
19
  export declare const isExpectEvent: (events?: AnyEvent) => boolean;
20
- export declare const getExpectEvent: (events?: AnyEvent) => import("../../../manifest").ControlEvent | import("../../../manifest").ChapterEvent | import("../../../manifest").ContainerEvent | undefined;
21
- export declare const isOneCtrlOneContainer: (controls: Control[]) => boolean;
22
- export declare const isOneTextCtrlContainer: (controls: Control[]) => boolean;
23
- export declare function excludeTextControl(containers?: ChapterContainer[]): ChapterContainer[];
24
- export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
20
+ export declare const getExpectEvent: (events?: AnyEvent) => import("../../../movika.core/manifest").ControlEvent | import("../../../movika.core/manifest").ChapterEvent | import("../../../movika.core/manifest").ContainerEvent | undefined;
21
+ export declare const isOneCtrlOneContainer: (controls: LatestControl[]) => boolean;
22
+ export declare const isOneTextCtrlContainer: (controls: LatestControl[]) => boolean;
23
+ export declare function excludeTextControl(containers?: LatestContainer[]): import("../../../movika.core/manifest/manifest_3_3/chapter").ChapterContainer[];
24
+ export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: LatestContainer["endTime"]) => boolean;
25
25
  export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
26
26
  export declare function partial<T extends Record<string, unknown>, P extends Partial<T>>(fn: (args: T) => unknown, presetArgs: P): (laterArgs: Omit<T, keyof P>) => ReturnType<typeof fn>;
27
- export declare const shouldIgnoreContainerEvent: (container: ChapterContainer, gameControllers: GameController[]) => boolean;
27
+ export declare const shouldIgnoreContainerEvent: (container: LatestContainer, gameControllers: GameController[]) => boolean;
28
28
  export {};
@@ -1,4 +1,4 @@
1
- import { type Container } from '../../../manifest';
1
+ import { type Container } from '../../../movika.core/manifest';
2
2
  export type InteractiveRange = {
3
3
  subjects: string[];
4
4
  range: [number, number];
@@ -1,4 +1,4 @@
1
- import { type Control } from '../../../manifest';
1
+ import { type LatestControl } from '../../../movika.core/manifest';
2
2
  import { type Dimensions } from '../../../modules/Interactives/controls';
3
3
  export declare const classnamesPrefix = "interactive";
4
4
  export declare const rootElClassName = "interactive-controls-container";
@@ -33,29 +33,27 @@ export declare enum TEXT_ALIGN {
33
33
  end = "right",
34
34
  center = "center"
35
35
  }
36
- export type SetTextPositionStylesProps = {
36
+ type SetTextPositionStylesProps = {
37
37
  target: HTMLElement;
38
- props: Control['props']['text'] & {
39
- alignment: Control['layoutParams']['alignment'];
40
- };
38
+ props: LatestControl['props'];
41
39
  };
42
40
  export declare const setTextPositionStyles: ({ target, props }: SetTextPositionStylesProps) => void;
43
41
  type SetTextStylesProps = {
44
42
  target: HTMLElement;
45
- props: Control['props'];
43
+ props: LatestControl['props'];
46
44
  fallback: ControlStylesFallbacks;
47
45
  dependsOn: Dimensions;
48
46
  };
49
47
  export declare const setTextStyles: ({ target, props, fallback, dependsOn }: SetTextStylesProps) => void;
50
48
  type SetBackgroundStylesProps = {
51
49
  target: HTMLElement;
52
- props: Control['props'];
50
+ props: LatestControl['props'];
53
51
  fallback: ControlStylesFallbacks;
54
52
  };
55
53
  export declare const setBackgroundStyles: ({ target, props, fallback }: SetBackgroundStylesProps) => void;
56
54
  type SetBorderStylesProps = {
57
55
  target: HTMLElement;
58
- props: Control['props'];
56
+ props: LatestControl['props'];
59
57
  fallback: ControlStylesFallbacks;
60
58
  dependsOn: Dimensions;
61
59
  };
@@ -63,7 +61,7 @@ export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: S
63
61
  type SetAngleProps = {
64
62
  target: HTMLElement;
65
63
  fallback: ControlStylesFallbacks;
66
- layoutParams: Control['layoutParams'];
64
+ layoutParams: LatestControl['layoutParams'];
67
65
  };
68
66
  export declare const setAngle: ({ target, layoutParams, fallback }: SetAngleProps) => void;
69
67
  export {};
@@ -1,5 +1,5 @@
1
- import type { ManifestVideo, ManifestVideoVariant } from '../../../manifest';
2
- export type { Extension, Standard } from '../../../manifest';
1
+ import type { ManifestVideo, ManifestVideoVariant } from '../../../movika.core/manifest';
2
+ export type { Extensions, Standard } from '../../../movika.core/manifest';
3
3
  export interface GetVKVideoParams {
4
4
  access_token: string;
5
5
  owner_id?: number;
@@ -1,3 +1,5 @@
1
+ import type { ManifestVideoVariant } from '../../../movika.core/manifest';
1
2
  import type { FullRequestParams, VideoVideoImage } from './types';
2
3
  export declare function createRequestURL({ baseURL, requestParams }: FullRequestParams): string;
3
4
  export declare function findMaxResolutionFrame(frames?: VideoVideoImage[]): VideoVideoImage | undefined;
5
+ export declare function isVKVariantItem(variantItem: ManifestVideoVariant): boolean;
@@ -1,21 +1,22 @@
1
1
  import type { IValueSubject } from '@vkontakte/videoplayer-shared';
2
- import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '../../manifest';
2
+ import type { ChapterBranch, ManifestVideo, LatestChapter, LatestManifest, LatestManifestVideo } from '../../movika.core/manifest';
3
+ import type { GraphEditChapter, GraphViewChapter } from '../../movika.core/manifest/manifest_3_3/graph';
3
4
  import { Loadable } from './Loadable';
4
5
  type BranchesData = {
5
- chapter: Chapter;
6
+ chapter: LatestChapter;
6
7
  graph: GraphEditChapter | GraphViewChapter | undefined;
7
8
  media: ManifestVideo;
8
9
  };
9
10
  export declare class ManifestController extends Loadable {
10
- manifest: Nullable<Manifest>;
11
- chapter: Nullable<Chapter>;
12
- media: Nullable<ManifestVideo>;
13
- graph: Nullable<Manifest['graph']>;
14
- prevChapter$: IValueSubject<Chapter | null>;
11
+ manifest: Nullable<LatestManifest>;
12
+ chapter: Nullable<LatestChapter>;
13
+ media: Nullable<LatestManifestVideo>;
14
+ graph: Nullable<LatestManifest['graph']>;
15
+ prevChapter$: IValueSubject<LatestChapter | null>;
15
16
  onError: Function;
16
17
  constructor(loaders: any, onError: Function);
17
18
  release(): this;
18
- setManifest(source: AnyManifest | string): Promise<ManifestController>;
19
+ setManifest(source: LatestManifest): Promise<ManifestController>;
19
20
  setInitial(): Promise<ManifestController>;
20
21
  setNext(chapterId?: string | undefined): Promise<ManifestController>;
21
22
  errorHandler(errors: unknown): void;
@@ -24,9 +25,9 @@ export declare class ManifestController extends Loadable {
24
25
  getBranches(chapterId?: string | undefined): BranchesData[];
25
26
  getByBranches(branches?: ChapterBranch[]): BranchesData[];
26
27
  getCurrent(): {
27
- chapter: Nullable<Chapter>;
28
- media: Nullable<ManifestVideo>;
29
- graph: Nullable<import("@interactiveplatform/movika-manifest").GraphDesign>;
28
+ chapter: Nullable<import("../../movika.core/manifest/types").Chapter>;
29
+ media: Nullable<import("../../movika.core/manifest/manifest_3_3/manifest").ManifestVideo>;
30
+ graph: Nullable<import("../../movika.core/manifest/manifest_3_3/graph").GraphDesign>;
30
31
  };
31
32
  isInitialChapter(): boolean;
32
33
  isEndChapter(): boolean;
@@ -1,12 +1,12 @@
1
- import type { Manifest, AnyManifest, Media, Chapter } from '../../manifest';
1
+ import type { Manifest, LatestManifest, Media, Chapter } from '../../movika.core/manifest';
2
2
  type ManifestInfo = {
3
- manifest: AnyManifest;
3
+ manifest: Manifest;
4
4
  manifestURL: string;
5
5
  };
6
- export declare const convertToObject: (manifest: AnyManifest | string) => Promise<Partial<ManifestInfo>>;
7
- export declare function fetchManifest(manifest: AnyManifest | string): Promise<Manifest>;
6
+ export declare const convertToObject: (manifest: Manifest | string) => Promise<Partial<ManifestInfo>>;
7
+ export declare function fetchManifest(manifest: Manifest): Promise<LatestManifest>;
8
8
  export declare function getInitialChapter(manifest: any): Chapter | undefined;
9
9
  export declare function getChapter(chapters: Chapter[], chapterId?: string): Chapter | undefined;
10
- export declare function getGraphItem(graphObj: Manifest['graph'], chapterId: string): import("../../manifest").GraphEditChapter | import("../../manifest").GraphViewChapter | undefined;
11
- export declare function getMedia(media: Media, videoId?: string): import("../../manifest").ManifestVideo | undefined;
10
+ export declare function getGraphItem(graphObj: LatestManifest['graph'], chapterId: string): import("../../movika.core/manifest/manifest_3_3/graph").GraphEditChapter | import("../../movika.core/manifest/manifest_3_3/graph").GraphViewChapter | undefined;
11
+ export declare function getMedia(media: Media, videoId?: string): import("../../movika.core/manifest/manifest_3_2/manifest").ManifestVideo | undefined;
12
12
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { IConfig, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
2
2
  import { ValueSubject } from '@vkontakte/videoplayer-shared';
3
- import type { ManifestVideo, Extension } from '../../manifest';
3
+ import type { ManifestVideo, Extensions } from '../../movika.core/manifest';
4
4
  import type { Interactives } from '../../modules/Interactives';
5
5
  import type { Instance } from './InstanceManager';
6
6
  interface CreatePlayerParams extends Omit<IConfig, 'sources' | 'container'> {
@@ -9,7 +9,7 @@ interface CreatePlayerParams extends Omit<IConfig, 'sources' | 'container'> {
9
9
  prefetch?: boolean;
10
10
  setAsActive?: boolean;
11
11
  autoplay?: boolean;
12
- preferredExt?: Array<Extension>;
12
+ preferredExt?: Array<Extensions>;
13
13
  quality?: VideoQuality;
14
14
  playbackRate?: PlaybackRate;
15
15
  title?: string;
@@ -1,7 +1,7 @@
1
1
  import type { IPlayer, ISources } from '@vkontakte/videoplayer-core';
2
- import type { ManifestVideo, Extension } from '../../manifest';
2
+ import type { ManifestVideo, Extensions } from '../../movika.core/manifest';
3
3
  import { VideoQuality } from '@vkontakte/videoplayer-core';
4
- export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extension>): {
4
+ export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extensions>): {
5
5
  sources: ISources;
6
6
  thumbUrl?: string | null;
7
7
  title: string;
@@ -1,10 +1,10 @@
1
1
  import type { IPlayer } from '@vkontakte/videoplayer-core';
2
- import type { ChapterContainer } from '../../manifest';
2
+ import type { ChapterContainers } from '../../movika.core/manifest/types';
3
3
  export declare class SeekToInteractiveController {
4
4
  private _containers;
5
5
  private _player;
6
6
  setPlayer: (player: IPlayer) => void;
7
- setContainers: (containers: ChapterContainer[]) => void;
7
+ setContainers: (containers: ChapterContainers) => void;
8
8
  deleteContainer: (id: string) => void;
9
9
  getNextInteractiveTime: (offsetMs?: number) => number | null;
10
10
  }
@@ -0,0 +1,28 @@
1
+ import type { Chapter as Chapter_3_2, ChapterContainer as ChapterContainer_3_2, ChapterBranch as ChapterBranch_3_2 } from './manifest_3_2/chapter';
2
+ import type { Manifest_3_2, ManifestVideo as ManifestVideo_3_2, ManifestVideoVariant as ManifestVideoVariant_3_2, Media as Media_3_2, Metadata as Metadata_3_2 } from './manifest_3_2/manifest';
3
+ import type { Chapter as Chapter_3_3, ChapterContainer as ChapterContainer_3_3, ChapterBranch as ChapterBranch_3_3 } from './manifest_3_3/chapter';
4
+ import type { Manifest_3_3, ManifestVideo as ManifestVideo_3_3, ManifestVideoVariant as ManifestVideoVariant_3_3, Media as Media_3_3, Metadata as Metadata_3_3, ManifestVideoVariantType, Extensions, Standard } from './manifest_3_3/manifest';
5
+ import type { Control, ControlLayoutParams } from './manifest_3_3/control';
6
+ export type Container = ChapterContainer_3_2 | ChapterContainer_3_3;
7
+ export type Media = Media_3_2 | Media_3_3;
8
+ export type Chapter = Chapter_3_2 | Chapter_3_3;
9
+ export type Manifest = Manifest_3_2 | Manifest_3_3;
10
+ export type Metadata = Metadata_3_2 | Metadata_3_3;
11
+ export type ManifestVideo = ManifestVideo_3_2 | ManifestVideo_3_3;
12
+ export type ManifestVideoVariant = ManifestVideoVariant_3_2 | ManifestVideoVariant_3_3;
13
+ export type ChapterBranch = ChapterBranch_3_2 | ChapterBranch_3_3;
14
+ export type { ManifestVideoVariantType, Extensions, Standard };
15
+ export type LatestMedia = Media_3_3;
16
+ export type LatestManifestVideo = ManifestVideo_3_3;
17
+ export type LatestChapter = Chapter_3_3;
18
+ export type LatestManifest = Manifest_3_3;
19
+ export type LatestContainer = ChapterContainer_3_3;
20
+ export type LatestControl = Control;
21
+ export type LatestControlLayoutParams = ControlLayoutParams;
22
+ export type LatestChapterBranch = ChapterBranch_3_3;
23
+ export type { ControlEvent } from './manifest_3_3/control';
24
+ export type { ContainerEvent } from './manifest_3_3/chapter';
25
+ export type { ChapterEvent } from './manifest_3_3/chapter';
26
+ export * from './migrations';
27
+ export * from './types';
28
+ export * from './utils';
@@ -0,0 +1,63 @@
1
+ import type { Control } from './control';
2
+ export type ChapterEventType = 'onSuspense';
3
+ export type ContainerEventType = 'onSuspense';
4
+ export type ChapterSuspenseActionType = 'setNextBranch' | 'setWeightlessRandomBranch' | 'setRandomBranch' | 'setMaxWeightBranch' | 'setMinWeightBranch' | 'setDefaultBranch' | 'continuePlayback' | 'openURI';
5
+ export type ContainerSuspenseActionType = 'setNextBranch' | 'continuePlayback';
6
+ export interface ChapterEvent {
7
+ type: ChapterEventType;
8
+ action: {
9
+ type: ChapterSuspenseActionType;
10
+ args: {
11
+ branchId?: string;
12
+ shouldOpenNow: boolean;
13
+ isDetachContainer?: boolean;
14
+ };
15
+ };
16
+ }
17
+ export interface ChapterBranch {
18
+ id: string;
19
+ chapterId: string;
20
+ weight?: number;
21
+ manifestUrl?: string;
22
+ isDefault?: boolean;
23
+ }
24
+ export interface ContainerEvent {
25
+ type: ContainerEventType;
26
+ action: {
27
+ type: ContainerSuspenseActionType;
28
+ args: {
29
+ branchId?: string;
30
+ shouldOpenNow: boolean;
31
+ isDetachContainer?: boolean;
32
+ uri?: string;
33
+ };
34
+ };
35
+ }
36
+ export interface ChapterContainer {
37
+ id: string;
38
+ /**
39
+ * Interactivity start time in milliseconds
40
+ */
41
+ startTime: number;
42
+ /**
43
+ * Interactivity end time in milliseconds
44
+ */
45
+ endTime?: number | null;
46
+ controls: Control[];
47
+ layout: {
48
+ type: 'Relative';
49
+ };
50
+ type: 'Choice' | 'TextInput';
51
+ events?: ContainerEvent[];
52
+ }
53
+ export interface Chapter {
54
+ id: string;
55
+ videoId?: string;
56
+ containers: ChapterContainer[];
57
+ branches: ChapterBranch[];
58
+ events?: ChapterEvent[];
59
+ label: string;
60
+ x: number;
61
+ y: number;
62
+ order: 'start' | 'end' | 'simple';
63
+ }
@@ -0,0 +1,67 @@
1
+ export type ControlType = 'Text' | 'Button' | 'Area';
2
+ export type ControlEventType = 'onClick';
3
+ export type ControlActionType = 'setNextBranch' | 'continuePlayback' | 'openURI';
4
+ export interface ControlEvent {
5
+ type: ControlEventType;
6
+ action: {
7
+ type: ControlActionType;
8
+ args: {
9
+ branchId?: string;
10
+ shouldOpenNow: boolean;
11
+ isDetachContainer?: boolean;
12
+ uri?: string;
13
+ };
14
+ };
15
+ }
16
+ export interface ControlLayoutParams {
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ angle: number;
22
+ innerSizesDependOn?: 'video' | 'self';
23
+ }
24
+ export interface ControlProps {
25
+ text?: {
26
+ value: string;
27
+ gravityHorizontal: 'start' | 'end' | 'center';
28
+ gravityVertical: 'top' | 'bottom' | 'center';
29
+ color: string;
30
+ alpha: number;
31
+ size: number;
32
+ paddings?: {
33
+ top: number;
34
+ right: number;
35
+ bottom: number;
36
+ left: number;
37
+ };
38
+ /**
39
+ * @deprecated accepted but no one uses
40
+ */
41
+ alignment?: 'left' | 'right' | 'center';
42
+ };
43
+ background: {
44
+ type: 'color';
45
+ color: string;
46
+ alpha: number;
47
+ src?: string;
48
+ };
49
+ shape: {
50
+ type: 'rectangle';
51
+ roundCorners: number;
52
+ border: {
53
+ width: number;
54
+ color: string;
55
+ alpha: number;
56
+ };
57
+ };
58
+ }
59
+ export interface Control {
60
+ id: string;
61
+ type: 'Button' | 'Area';
62
+ label: string;
63
+ subtype: ControlType;
64
+ layoutParams: ControlLayoutParams;
65
+ props: ControlProps;
66
+ events?: ControlEvent[];
67
+ }