@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,12 +1,12 @@
1
- type LoaderTypes = 'chapterLoaders' | 'manifestLoaders';
1
+ type LoaderTypes = "chapterLoaders" | "manifestLoaders";
2
2
  export type Loaders = Record<LoaderTypes, AnyFn[]>;
3
3
  interface ILoadable {
4
- exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
4
+ exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
5
5
  }
6
6
  export declare class Loadable implements ILoadable {
7
- loaders: Loaders;
8
- constructor(loaders: Partial<Loaders>);
9
- exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
7
+ loaders: Loaders;
8
+ constructor(loaders: Partial<Loaders>);
9
+ exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
10
10
  }
11
11
  export declare function addErrorMessage(errObj: Record<string, Array<string>> | null, loaderName: string, message: string): Record<string, Array<string>>;
12
12
  export declare function defaultLoader({ actions, errors, chapterId, ...args }: Record<string, any>): Record<string, any>;
@@ -1,34 +1,34 @@
1
- import type { IValueSubject, Nullable } from '@vkontakte/videoplayer-shared';
2
- import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '../../manifest';
3
- import { Loadable } from './Loadable';
1
+ import type { IValueSubject, Nullable } from "@vkontakte/videoplayer-shared";
2
+ import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from "../../manifest";
3
+ import { Loadable, type Loaders } from "./Loadable";
4
4
  type BranchesData = {
5
- chapter: Chapter;
6
- graph: GraphEditChapter | GraphViewChapter | undefined;
7
- media: ManifestVideo;
5
+ chapter: Chapter;
6
+ graph: GraphEditChapter | GraphViewChapter | undefined;
7
+ media: ManifestVideo;
8
8
  };
9
9
  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>;
15
- onError: Function;
16
- constructor(loaders: any, onError: Function);
17
- release(): this;
18
- setManifest(source: AnyManifest | string): Promise<ManifestController>;
19
- setInitial(): Promise<ManifestController>;
20
- setNext(chapterId?: string | undefined): Promise<ManifestController>;
21
- errorHandler(errors: unknown): void;
22
- getInitial(): BranchesData | null;
23
- getByChapterId(chapterId?: string | undefined): Nullable<BranchesData>;
24
- getBranches(chapterId?: string | undefined): BranchesData[];
25
- getByBranches(branches?: ChapterBranch[]): BranchesData[];
26
- getCurrent(): {
27
- chapter: Nullable<Chapter>;
28
- media: Nullable<ManifestVideo>;
29
- graph: Nullable<import("@interactiveplatform/movika-manifest").GraphDesign>;
30
- };
31
- isInitialChapter(): boolean;
32
- isEndChapter(): boolean;
10
+ manifest: Nullable<Manifest>;
11
+ chapter: Nullable<Chapter>;
12
+ media: Nullable<ManifestVideo>;
13
+ graph: Nullable<Manifest["graph"]>;
14
+ prevChapter$: IValueSubject<Chapter | null>;
15
+ onError: (err: unknown) => void;
16
+ constructor(loaders: Partial<Loaders>, onError: (err: unknown) => void);
17
+ release(): this;
18
+ setManifest(source: AnyManifest | string): Promise<ManifestController>;
19
+ setInitial(): Promise<ManifestController>;
20
+ setNext(chapterId?: string | undefined): Promise<ManifestController>;
21
+ errorHandler(errors: unknown): void;
22
+ getInitial(): Nullable<BranchesData>;
23
+ getByChapterId(chapterId?: string | undefined): Nullable<BranchesData>;
24
+ getBranches(chapterId?: string | undefined): BranchesData[];
25
+ getByBranches(branches?: ChapterBranch[]): BranchesData[];
26
+ getCurrent(): {
27
+ chapter: Nullable<Chapter>;
28
+ media: Nullable<ManifestVideo>;
29
+ graph: Nullable<Manifest["graph"]>;
30
+ };
31
+ isInitialChapter(): boolean;
32
+ isEndChapter(): boolean;
33
33
  }
34
34
  export {};
@@ -1 +1 @@
1
- export { ManifestController } from './ManifestController';
1
+ export { ManifestController } from "./ManifestController";
@@ -1,12 +1,12 @@
1
- import type { Manifest, AnyManifest, Media, Chapter } from '../../manifest';
1
+ import type { Manifest, AnyManifest, Media, Chapter, GraphEditChapter, GraphViewChapter } from "../../manifest";
2
2
  type ManifestInfo = {
3
- manifest: AnyManifest;
4
- manifestURL: string;
3
+ manifest: AnyManifest;
4
+ manifestURL: string;
5
5
  };
6
6
  export declare const convertToObject: (manifest: AnyManifest | string) => Promise<Partial<ManifestInfo>>;
7
7
  export declare function fetchManifest(manifest: AnyManifest | string): Promise<Manifest>;
8
- export declare function getInitialChapter(manifest: any): Chapter | undefined;
8
+ export declare function getInitialChapter(manifest: Manifest): 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: Manifest["graph"], chapterId: string): GraphEditChapter | GraphViewChapter | undefined;
11
+ export declare function getMedia(media: Media, videoId?: string): Media["videos"][0] | undefined;
12
12
  export {};
@@ -1,15 +1,15 @@
1
- import type { ISubscription } from '@vkontakte/videoplayer-shared';
2
- import type { IPlayer } from '@vkontakte/videoplayer-core';
3
- import type { IOneStat } from '@vkontakte/videoplayer-statistics';
1
+ import type { ISubscription } from "@vkontakte/videoplayer-shared";
2
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
3
+ import type { IOneStat } from "@vkontakte/videoplayer-statistics";
4
4
  export interface InstanceStatistics {
5
- oneStat: IOneStat;
6
- statSubscription: ISubscription;
5
+ oneStat: IOneStat;
6
+ statSubscription: ISubscription;
7
7
  }
8
8
  export interface Instance {
9
- [key: string]: any;
10
- container: HTMLElement;
11
- player: IPlayer;
12
- subscription: ISubscription;
13
- statistics?: InstanceStatistics;
9
+ [key: string]: any;
10
+ container: HTMLElement;
11
+ player: IPlayer;
12
+ subscription: ISubscription;
13
+ statistics?: InstanceStatistics;
14
14
  }
15
15
  export default function InstanceManager(): Record<string, any>;
@@ -1,30 +1,33 @@
1
- import type { IConfig, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
2
- import { Nullable, ValueSubject } from '@vkontakte/videoplayer-shared';
3
- import type { ManifestVideo, Extension } from '../../manifest';
4
- import type { Interactives } from '../../modules/Interactives';
5
- import type { Instance } from './InstanceManager';
6
- interface CreatePlayerParams extends Omit<IConfig, 'sources' | 'container'> {
7
- media: ManifestVideo;
8
- chapterId: string;
9
- prefetch?: boolean;
10
- setAsActive?: boolean;
11
- autoplay?: boolean;
12
- preferredExt?: Array<Extension>;
13
- quality?: VideoQuality;
14
- playbackRate?: PlaybackRate;
15
- title?: string;
1
+ import type { IConfig, IPlayer, PlaybackRate, VideoQuality } from "@vkontakte/videoplayer-core";
2
+ import type { Nullable } from "@vkontakte/videoplayer-shared";
3
+ import { ValueSubject } from "@vkontakte/videoplayer-shared";
4
+ import type { ManifestVideo, Extension } from "../../manifest";
5
+ import type { Interactives } from "../Interactives";
6
+ import { type InstanceStatistics } from "./InstanceManager";
7
+ import type { Instance } from "./InstanceManager";
8
+ interface CreatePlayerParams extends Omit<IConfig, "sources" | "container"> {
9
+ media: ManifestVideo;
10
+ chapterId: string;
11
+ prefetch?: boolean;
12
+ setAsActive?: boolean;
13
+ autoplay?: boolean;
14
+ preferredExt?: Array<Extension>;
15
+ quality?: VideoQuality;
16
+ playbackRate?: PlaybackRate;
17
+ title?: string;
16
18
  }
17
- export type ActivePlayer = Nullable<Pick<Instance, 'player' | 'config' | 'statistics'>>;
19
+ export type ActivePlayer = Nullable<Pick<Instance, "player" | "config" | "statistics">>;
18
20
  export default function SeamlessController(interactiveController?: Interactives): {
19
- init: () => Promise<void>;
20
- setInteractiveController: (instance: Interactives) => void;
21
- createPlayer: ({ media, chapterId, prefetch, setAsActive, autoplay, preferredExt, title, playbackRate, }: CreatePlayerParams) => Promise<{
22
- player: any;
23
- config: any;
24
- statistics: any;
25
- }>;
26
- removeAll: () => void;
27
- getActivePlayer: () => Record<string, any>;
28
- activePlayerChanged: ValueSubject<ActivePlayer>;
21
+ map: Map<string, Record<string, Instance>>;
22
+ createPlayer: (params: CreatePlayerParams) => Promise<{
23
+ player: IPlayer;
24
+ config: IConfig;
25
+ statistics: Nullable<InstanceStatistics>;
26
+ }>;
27
+ removePlayer: (listId: string, itemId?: string) => void;
28
+ removeAll: () => void;
29
+ init: () => Promise<void>;
30
+ setInteractiveController: (instance: Interactives) => void;
31
+ getActivePlayer: () => Record<string, unknown>;
32
+ activePlayerChanged: ValueSubject<ActivePlayer>;
29
33
  };
30
- export {};
@@ -1,9 +1,9 @@
1
- import type { IPlayer, ISources } from '@vkontakte/videoplayer-core';
2
- import type { ManifestVideo, Extension } from '../../manifest';
3
- import { VideoQuality } from '@vkontakte/videoplayer-core';
1
+ import type { IPlayer, ISources } from "@vkontakte/videoplayer-core";
2
+ import type { ManifestVideo, Extension } from "../../manifest";
3
+ import type { VideoQuality } from "@vkontakte/videoplayer-core";
4
4
  export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extension>): {
5
- sources: ISources;
6
- thumbUrl?: string | null;
7
- title: string;
5
+ sources: ISources;
6
+ thumbUrl?: string | null;
7
+ title: string;
8
8
  };
9
9
  export declare const setVideoQuality: (player: IPlayer, quality: VideoQuality) => void;
@@ -1,10 +1,10 @@
1
- import type { IPlayer } from '@vkontakte/videoplayer-core';
2
- import type { ChapterContainer } from '../../manifest';
1
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
2
+ import type { ChapterContainer } from "../../manifest";
3
3
  export declare class SeekToInteractiveController {
4
- private _containers;
5
- private _player;
6
- setPlayer: (player: IPlayer) => void;
7
- setContainers: (containers: ChapterContainer[]) => void;
8
- deleteContainer: (id: string) => void;
9
- getNextInteractiveTime: (offsetMs?: number) => number | null;
4
+ private _containers;
5
+ private _player;
6
+ setPlayer: (player: IPlayer) => void;
7
+ setContainers: (containers: ChapterContainer[]) => void;
8
+ deleteContainer: (id: string) => void;
9
+ getNextInteractiveTime: (offsetMs?: number) => number | null;
10
10
  }
@@ -1 +1 @@
1
- export { SeekToInteractiveController } from './SeekToInteractiveController';
1
+ export { SeekToInteractiveController } from "./SeekToInteractiveController";
@@ -1,13 +1,13 @@
1
1
  export declare enum ErrorSeverityEnum {
2
- RECOVERABLE = 1,// Errors that do not break the library. Can be fixed by the library
3
- CRITICAL = 2
2
+ RECOVERABLE = 1,
3
+ CRITICAL = 2
4
4
  }
5
5
  export declare enum ErrorCategoryEnum {
6
- VIDEO = 0,
7
- INTERACTIVES = 1,
8
- GRAPH = 2,
9
- MANIFEST = 3,
10
- LOADERS = 4,
11
- HISTORY = 5,
12
- SEAMLESS = 6
6
+ VIDEO = 0,
7
+ INTERACTIVES = 1,
8
+ GRAPH = 2,
9
+ MANIFEST = 3,
10
+ LOADERS = 4,
11
+ HISTORY = 5,
12
+ SEAMLESS = 6
13
13
  }
@@ -1,2 +1,2 @@
1
- export * from './dom';
2
- export * from './CustomError';
1
+ export type * from "./dom";
2
+ export * from "./CustomError";
@@ -1,23 +1,23 @@
1
1
  export declare class CssVarsManager {
2
- rootElement: HTMLElement;
3
- private readonly isCssVarsSupported;
4
- private rootElementProps;
5
- constructor(rootElement: HTMLElement);
6
- private static checkCssVarsSupport;
7
- /**
8
- * Возвращает значение CSS-переменной или фолбэк из JS.
9
- */
10
- getPropValue(propKey: string): string | undefined;
11
- /**
12
- * Применяет несколько свойств
13
- */
14
- setup(props: Record<string, string>): void;
15
- /**
16
- * Удаляет все сохранённые переменные со стилевого элемента
17
- */
18
- cleanup(): void;
19
- /**
20
- * Применяет одну переменную
21
- */
22
- setProp(key: string, value: string): void;
2
+ rootElement: HTMLElement;
3
+ private readonly isCssVarsSupported;
4
+ private rootElementProps;
5
+ constructor(rootElement: HTMLElement);
6
+ private static checkCssVarsSupport;
7
+ /**
8
+ * Возвращает значение CSS-переменной или фолбэк из JS.
9
+ */
10
+ getPropValue(propKey: string): string | undefined;
11
+ /**
12
+ * Применяет несколько свойств
13
+ */
14
+ setup(props: Record<string, string>): void;
15
+ /**
16
+ * Удаляет все сохранённые переменные со стилевого элемента
17
+ */
18
+ cleanup(): void;
19
+ /**
20
+ * Применяет одну переменную
21
+ */
22
+ setProp(key: string, value: string): void;
23
23
  }
@@ -1,8 +1,8 @@
1
- import { ErrorSeverityEnum, ErrorCategoryEnum } from '../types';
1
+ import type { ErrorSeverityEnum, ErrorCategoryEnum } from "../types";
2
2
  export declare class CustomError {
3
- severity: ErrorSeverityEnum;
4
- category: ErrorCategoryEnum;
5
- data: unknown;
6
- constructor(severity: ErrorSeverityEnum, category: ErrorCategoryEnum, ...varArgs: unknown[]);
7
- toString(): string;
3
+ severity: ErrorSeverityEnum;
4
+ category: ErrorCategoryEnum;
5
+ data: unknown;
6
+ constructor(severity: ErrorSeverityEnum, category: ErrorCategoryEnum, ...varArgs: unknown[]);
7
+ toString(): string;
8
8
  }
@@ -1,12 +1,12 @@
1
1
  export declare class EventEmitter {
2
- listeners: Record<string, Function[]>;
3
- addListener(eventName: string, fn: Function): EventEmitter;
4
- on(eventName: string, fn: Function): EventEmitter;
5
- once(eventName: string, fn: Function): EventEmitter;
6
- off(eventName: string, fn: Function): EventEmitter;
7
- reset(): void;
8
- removeListener(eventName: string, fn: Function): EventEmitter;
9
- emit(eventName: string, ...args: unknown[]): boolean;
10
- listenerCount(eventName: string): number;
11
- rawListeners(eventName: string): Function[];
2
+ listeners: Record<string, Function[]>;
3
+ addListener(eventName: string, fn: Function): EventEmitter;
4
+ on(eventName: string, fn: Function): EventEmitter;
5
+ once(eventName: string, fn: Function): EventEmitter;
6
+ off(eventName: string, fn: Function): EventEmitter;
7
+ reset(): void;
8
+ removeListener(eventName: string, fn: Function): EventEmitter;
9
+ emit(eventName: string, ...args: unknown[]): boolean;
10
+ listenerCount(eventName: string): number;
11
+ rawListeners(eventName: string): Function[];
12
12
  }
@@ -1,35 +1,35 @@
1
- import type { Chapter } from '../manifest';
2
- import { LastFrameCanvasAPI } from './LastFrameCanvasAPI';
1
+ import type { Chapter } from "../manifest";
2
+ import { LastFrameCanvasAPI } from "./LastFrameCanvasAPI";
3
3
  type ConstructorParams = {
4
- parentElement: HTMLElement;
5
- endOffsetMs?: number;
6
- onError: (err?: Error) => void;
4
+ parentElement: HTMLElement;
5
+ endOffsetMs?: number;
6
+ onError: (err?: Error) => void;
7
7
  };
8
8
  export declare class LastFrame {
9
- lastFrameCanvas: LastFrameCanvasAPI;
10
- endOffsetMs: number;
11
- currentChapter?: Chapter;
12
- currentVideoDurationMs: number;
13
- rootElement: HTMLElement;
14
- private _containerTimeFrameShouldReceived;
15
- private _endTimeFrameReceived;
16
- private _shouldCallSkip;
17
- private _callbacks?;
18
- constructor({ parentElement, endOffsetMs, onError }: ConstructorParams);
19
- destroy(): void;
20
- setVideoDuration(videoDurationMs: number): void;
21
- setVideoElement(videoElement: HTMLVideoElement): void;
22
- setCurrentChapter(chapter: Chapter): void;
23
- show(): void;
24
- hide(): void;
25
- updateCanvasDimensions(shouldSave?: boolean): Promise<void>;
26
- draw(): void;
27
- isChapterEndTime(currentTimeMs: number): boolean | 0;
28
- isContainerTime(currentTimeMs: number): boolean | undefined;
29
- onEachTick: (timeMs?: number) => void;
30
- onSeek: () => void;
31
- reset(): void;
32
- private _onError;
9
+ lastFrameCanvas: LastFrameCanvasAPI;
10
+ endOffsetMs: number;
11
+ currentChapter?: Chapter;
12
+ currentVideoDurationMs: number;
13
+ rootElement: HTMLElement;
14
+ private _containerTimeFrameShouldReceived;
15
+ private _endTimeFrameReceived;
16
+ private _shouldCallSkip;
17
+ private _callbacks?;
18
+ constructor({ parentElement, endOffsetMs, onError }: ConstructorParams);
19
+ destroy(): void;
20
+ setVideoDuration(videoDurationMs: number): void;
21
+ setVideoElement(videoElement: HTMLVideoElement): void;
22
+ setCurrentChapter(chapter: Chapter): void;
23
+ show(): void;
24
+ hide(): void;
25
+ updateCanvasDimensions(shouldSave?: boolean): Promise<void>;
26
+ draw(): void;
27
+ isChapterEndTime(currentTimeMs: number): boolean;
28
+ isContainerTime(currentTimeMs: number): boolean | undefined;
29
+ onEachTick: (timeMs?: number) => void;
30
+ onSeek: () => void;
31
+ reset(): void;
32
+ private _onError;
33
33
  }
34
34
  export declare function waitForMs(waitTimeMs?: number): Promise<unknown>;
35
35
  export {};
@@ -1,19 +1,19 @@
1
1
  export declare class LastFrameCanvasAPI {
2
- rootElement: HTMLCanvasElement;
3
- canvasImgSrc?: CanvasImageSource;
4
- private _prevSizeId;
5
- constructor();
6
- clear(): void;
7
- isImageDrawn(): boolean;
8
- destroy(): void;
9
- show(): void;
10
- hide(): void;
11
- setCanvasImageSource(canvasImgSrc: CanvasImageSource): void;
12
- draw(): void;
13
- updateCanvasDimensions(dimensions: {
14
- width: number;
15
- height: number;
16
- }, shouldSave?: boolean): Promise<void>;
17
- save(): Promise<HTMLImageElement>;
18
- restore(imgEl: HTMLImageElement): void;
2
+ rootElement: HTMLCanvasElement;
3
+ canvasImgSrc?: CanvasImageSource;
4
+ private _prevSizeId;
5
+ constructor();
6
+ clear(): void;
7
+ isImageDrawn(): boolean;
8
+ destroy(): void;
9
+ show(): void;
10
+ hide(): void;
11
+ setCanvasImageSource(canvasImgSrc: CanvasImageSource): void;
12
+ draw(): void;
13
+ updateCanvasDimensions(dimensions: {
14
+ width: number;
15
+ height: number;
16
+ }, shouldSave?: boolean): Promise<void>;
17
+ save(): Promise<HTMLImageElement>;
18
+ restore(imgEl: HTMLImageElement): void;
19
19
  }
@@ -1,10 +1,10 @@
1
1
  export declare class MultiMap<T> {
2
- map: Record<string, T[]>;
3
- push(key: string, value: T): void;
4
- get(key: string): T[] | null;
5
- getAll(): T[];
6
- remove(key: string, value: T): void;
7
- clear(): void;
8
- keys(): string[];
9
- size(): number;
2
+ map: Record<string, T[]>;
3
+ push(key: string, value: T): void;
4
+ get(key: string): T[] | null;
5
+ getAll(): T[];
6
+ remove(key: string, value: T): void;
7
+ clear(): void;
8
+ keys(): string[];
9
+ size(): number;
10
10
  }
@@ -1,13 +1,13 @@
1
1
  export declare class Raf {
2
- raf: number | undefined;
3
- fn: VoidFunction | undefined;
4
- fns: Array<VoidFunction>;
5
- constructor(fn?: VoidFunction);
6
- addFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
7
- removeFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
8
- updateFn: () => void;
9
- forceRequestAnimation: () => void;
10
- requestAnimation: () => void;
11
- cancelAnimation: () => void;
12
- release(): void;
2
+ raf: number | undefined;
3
+ fn: VoidFunction | undefined;
4
+ fns: Array<VoidFunction>;
5
+ constructor(fn?: VoidFunction);
6
+ addFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
7
+ removeFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
8
+ updateFn: () => void;
9
+ forceRequestAnimation: () => void;
10
+ requestAnimation: () => void;
11
+ cancelAnimation: () => void;
12
+ release(): void;
13
13
  }
@@ -1,4 +1,4 @@
1
- import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from '../manifest';
1
+ import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from "../manifest";
2
2
  export declare const chapterIdsToVKVideoIds: (chapterIds: string[], interactiveManifest: Manifest) => number[];
3
3
  export declare const getVideoRawIdByMedia: (mediaVideo: ManifestVideo) => string | undefined;
4
4
  export declare const isVKVariantItem: (variantItem: ManifestVideoVariant) => boolean;
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Compares 2 versions
3
- *
4
- * Results 0 if v1 = v2
5
- *
6
- * Results 1 if v1 > v2
7
- *
8
- * Results -1 if v1 < v2
9
- *
10
- * @param {string} v1 version 1
11
- * @param {string} v2 version 2
12
- * @returns {number} result status
13
- */
2
+ * Compares 2 versions
3
+ *
4
+ * Results 0 if v1 = v2
5
+ *
6
+ * Results 1 if v1 > v2
7
+ *
8
+ * Results -1 if v1 < v2
9
+ *
10
+ * @param {string} v1 version 1
11
+ * @param {string} v2 version 2
12
+ * @returns {number} result status
13
+ */
14
14
  export declare const compareVersions: (v1?: string, v2?: string) => number;
@@ -1,2 +1,2 @@
1
- import type { ManifestVideo } from '../manifest';
1
+ import type { ManifestVideo } from "../manifest";
2
2
  export declare const extractVkMovieId: (media: ManifestVideo) => [] | [string, string];
@@ -1,5 +1,5 @@
1
- import type { IPlayer } from '@vkontakte/videoplayer-core';
1
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
2
2
  export declare const getVideoContentSize: (player: IPlayer) => {
3
- videoContentHeight: number;
4
- videoContentWidth: number;
3
+ videoContentWidth: number;
4
+ videoContentHeight: number;
5
5
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Converts HEX to RGBA
3
- */
2
+ * Converts HEX to RGBA
3
+ */
4
4
  export declare function hexToRGB(h: string, a?: number): string;
@@ -1 +1 @@
1
- export declare const throttle: (fn: VoidFunction, wait: number) => () => void;
1
+ export declare const throttle: (fn: VoidFunction, wait: number) => (() => void);
@@ -1,10 +1,10 @@
1
1
  export declare enum TypesEnum {
2
- Object = "Object",
3
- String = "String",
4
- Array = "Array",
5
- Number = "Number",
6
- Function = "Function",
7
- Boolean = "Boolean"
2
+ Object = "Object",
3
+ String = "String",
4
+ Array = "Array",
5
+ Number = "Number",
6
+ Function = "Function",
7
+ Boolean = "Boolean"
8
8
  }
9
9
  type TypesEnumKeys = `${TypesEnum}`;
10
10
  export declare const isType: (value: unknown, is: TypesEnumKeys) => boolean;
@@ -20,5 +20,5 @@ export declare const isNullOrUndefined: (value: unknown) => value is null | unde
20
20
  export declare const isEmptyObject: (value: unknown) => boolean;
21
21
  export declare const isEmptyArray: (value: unknown) => boolean;
22
22
  export declare const isEmptyString: (value: unknown, isTrim: boolean) => boolean;
23
- export declare const isNotEmptyString: (value: unknown, isTrim: boolean) => number | false;
23
+ export declare const isNotEmptyString: (value: unknown, isTrim: boolean) => boolean;
24
24
  export {};