Newer
Older
import { InputElementValue } from 'common/models/elements/element';
export type NavigationTarget = 'first' | 'last' | 'previous' | 'next' | 'end';
export type RunningState = 'running' | 'stopped';
export type Progress = 'none' | 'some' | 'complete';
export type PagingMode = 'separate' | 'concat-scroll' | 'concat-scroll-snap';
export type StateReportPolicy = 'none' | 'eager' | 'on-demand';
export type ElementCodeStatus = 'NOT_REACHED' | 'DISPLAYED' | 'VALUE_CHANGED';
export enum ElementCodeStatusValue { NOT_REACHED = 0, DISPLAYED = 1, VALUE_CHANGED = 2}
export interface StatusChangeElement {
id: string;
status: ElementCodeStatus;
export interface PlayerConfig {
unitNumber?: number;
unitTitle?: number;
unitId?: number;
logPolicy?: 'lean' | 'rich' | 'debug' | 'disabled';
startPage?: string;
enabledNavigationTargets?: NavigationTarget[];
directDownloadUrl?: string;
export interface ElementCode {
status: ElementCodeStatus;
value: InputElementValue;
export interface UnitState {
dataParts?: Record<string, string>;
presentationProgress?: Progress;
responseProgress?: Progress;
unitStateDataType?: string;
}
export interface PlayerState {
export interface LogData {
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
timeStamp: number,
key: string,
content?: string
}
export interface VopStartCommand {
type: 'vopStartCommand';
sessionId: string;
unitDefinition?: string;
unitDefinitionType?: string;
unitState?: UnitState;
playerConfig?: PlayerConfig;
}
export interface VopNavigationDeniedNotification {
type: 'vopNavigationDeniedNotification';
sessionId: string;
reason?: Array<'presentationIncomplete' | 'responsesIncomplete'>
}
export interface VopPageNavigationCommand {
type: 'vopPageNavigationCommand';
sessionId: string;
target: string;
}
export interface VopGetStateRequest {
type: 'vopGetStateRequest';
sessionId: string;
stop: boolean;
}
export interface VopStopCommand {
type: 'vopStopCommand';
sessionId: string;
}
export interface VopContinueCommand {
type: 'vopContinueCommand';
sessionId: string;
}
export interface VopReadyNotification {
metadata: VopMetaData;
}
export interface VopMetaData {
$schema: string,
id: string;
type: string;
version: string;
specVersion: string;
name: {
lang: string;
value: string;
}[];
description: {
lang: string;
value: string;
}[];
maintainer: {
name: Record<string, string>[];
email: string;
url: string;
}
code: {
repositoryType: string;
licenseType: string;
licenseUrl: string;
repositoryUrl: string;
}
notSupportedFeatures: string[];
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
}
export interface VopStateChangedNotification {
type: 'vopStateChangedNotification';
sessionId: string;
timeStamp: number;
unitState?: UnitState;
playerState?: PlayerState;
log?: LogData[];
}
export interface VopUnitNavigationRequestedNotification {
type: 'vopUnitNavigationRequestedNotification';
sessionId: string;
target: 'first' | 'last' | 'previous' | 'next' | 'end';
}
export interface VopWindowFocusChangedNotification {
type: 'vopWindowFocusChangedNotification';
timeStamp: number;
hasFocus: boolean;
}
export type VopMessage =
VopStartCommand |
VopNavigationDeniedNotification |
VopPageNavigationCommand |
VopGetStateRequest |
VopStopCommand |
VopContinueCommand |
VopReadyNotification |
VopStateChangedNotification |
VopWindowFocusChangedNotification |
VopUnitNavigationRequestedNotification;