@vkontakte/videoplayer-interactive 1.0.31-dev.51f7634a.0 → 1.0.31-dev.684e92f5.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.
@@ -12,6 +12,7 @@ type InteractiveEventType<T extends SubjectName> = T extends 'container' ? Inter
12
12
  type TInteractiveCommon<T extends SubjectName, U extends InteractiveEventType<T>> = {
13
13
  subjectId: string;
14
14
  subjectName: T;
15
+ removeAllOpenURI?: boolean;
15
16
  type: U;
16
17
  };
17
18
  export type TInteractivesVisibility<T extends Exclude<SubjectName, 'chapter'>> = TInteractiveCommon<T, InteractivesEventTypes.VISIBILITY> & {
@@ -35,9 +36,11 @@ export type TInteractivesActionExecutionEvent<T extends SubjectName> = TInteract
35
36
  subjectType?: SubjectType<T>;
36
37
  payload?: TInteractivesActionExecEventPayload<ActionMap[T]['type']>;
37
38
  };
38
- type TInteractivesActionChoiceEventPayload<T extends SubjectName> = T extends 'chapter' ? ChapterEvent['action']['args'] : T extends 'container' ? ContainerEvent['action']['args'] : ControlEvent['action']['args'] & {
39
+ type TControlPayloadExtra = {
39
40
  containerId: string;
41
+ invokeImmediately: boolean;
40
42
  };
43
+ type TInteractivesActionChoiceEventPayload<T extends SubjectName> = T extends 'chapter' ? ChapterEvent['action']['args'] : T extends 'container' ? ContainerEvent['action']['args'] & Pick<TControlPayloadExtra, 'invokeImmediately'> : ControlEvent['action']['args'] & TControlPayloadExtra;
41
44
  type TSubjectTypeValues<T extends SubjectName> = T extends 'chapter' ? undefined : T extends 'container' ? ChapterContainer['type'] : Control['type'];
42
45
  export type TInteractivesActionChoiceEvent<T extends SubjectName> = TInteractiveCommon<T, InteractivesEventTypes.ACTION_CHOICE | InteractivesEventTypes.ACTION_CHOICE_CANCELED> & {
43
46
  subjectType?: TSubjectTypeValues<T>;
@@ -45,3 +48,4 @@ export type TInteractivesActionChoiceEvent<T extends SubjectName> = TInteractive
45
48
  payload: TInteractivesActionChoiceEventPayload<T>;
46
49
  };
47
50
  export type TInteractivesContainerRemoved = TInteractiveCommon<'container', InteractivesEventTypes.CONTAINER_REMOVED>;
51
+ export type TInteractivesContainerFakeRemoved = TInteractiveCommon<'container', InteractivesEventTypes.CONTAINER_FAKE_REMOVED>;
@@ -1,5 +1,6 @@
1
1
  import { type Control, type Chapter, type ChapterContainer } from '../../../manifest';
2
2
  import type { GameController } from './GameController';
3
+ import type { IgnoreExpectState } from '../../../modules/Interactives/types';
3
4
  export declare enum GameStates {
4
5
  nothing = 0,
5
6
  beforeInteractive = 1,
@@ -24,5 +25,5 @@ export declare function excludeTextControl(containers?: ChapterContainer[]): Cha
24
25
  export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
25
26
  export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
26
27
  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;
28
+ export declare const evaluateContainerEventStatus: (container: ChapterContainer, gameControllers: GameController[]) => IgnoreExpectState;
28
29
  export {};
@@ -1,6 +1,10 @@
1
1
  import { type Container } from '../../../manifest';
2
+ export type Subject = {
3
+ id: string;
4
+ isRemoved: boolean;
5
+ };
2
6
  export type InteractiveRange = {
3
- subjects: string[];
7
+ subjects: Subject[];
4
8
  range: [number, number];
5
9
  };
6
10
  export type InteractiveRanges = Array<InteractiveRange>;
@@ -1,5 +1,5 @@
1
1
  type LoaderTypes = 'chapterLoaders' | 'manifestLoaders';
2
- export type Loaders = Record<LoaderTypes, Function[]>;
2
+ export type Loaders = Record<LoaderTypes, AnyFn[]>;
3
3
  interface ILoadable {
4
4
  exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
5
5
  }
@@ -1,34 +0,0 @@
1
- import type { Nullable } from '@vkontakte/videoplayer-shared';
2
- import type { HtmlEventType } from '../types';
3
- type OptionsType = undefined | boolean | AddEventListenerOptions;
4
- export declare class Binding {
5
- target: Nullable<Element>;
6
- type: Nullable<HtmlEventType>;
7
- listener: Nullable<EventListener>;
8
- options: Nullable<OptionsType>;
9
- /**
10
- * passive = true -> function never call preventDefault()
11
- */
12
- constructor(target: Element, type: HtmlEventType, listener: EventListener, options: OptionsType);
13
- /**
14
- * Detaches the event listener from the event target. This does nothing if
15
- * the event listener is already detached.
16
- */
17
- unlisten(): void;
18
- /**
19
- * Converts the provided options value into a value accepted by the browser.
20
- * Some browsers (e.g. Tizen) don't support passing options as an
21
- * object. So this detects this case and converts it.
22
- */
23
- private static _convertOptions;
24
- /**
25
- * Checks whether the browser supports passing objects as the third argument
26
- * to addEventListener. This caches the result value in a static field to
27
- * avoid a bunch of checks.
28
- *
29
- * See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
30
- */
31
- private static _supportsObject;
32
- private static _doesSupportObject;
33
- }
34
- export {};
@@ -1,13 +0,0 @@
1
- import { Binding } from './Binding';
2
- import { MultiMap } from './MultiMap';
3
- import type { HtmlEventType } from '../types';
4
- type OptionsType = boolean | AddEventListenerOptions;
5
- export declare class EventManager {
6
- bindingMap: MultiMap<Binding> | null;
7
- release(): void;
8
- listen(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
9
- listenOnce(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
10
- unlisten(target: Element, type: HtmlEventType, listener: EventListener): void;
11
- removeAll(): void;
12
- }
13
- export {};