Newer
Older
import { InputElementValue } from '../../../../common/models/uI-element';
export type NavigationTarget = 'first' | 'last' | 'previous' | 'next' | 'end';
export type RunningState = 'running' | 'stopped';
export type Progress = 'none' | 'some' | 'complete';
export type StateReportPolicy = 'none' | 'eager' | 'on-demand';
export type UnitStateElementCodeStatus = 'NOT_REACHED' | 'DISPLAYED' | 'VALUE_CHANGED';
export enum UnitStateElementCodeStatusValue { NOT_REACHED = 0, DISPLAYED = 1, VALUE_CHANGED = 2}
export interface StatusChangeElement {
id: string;
status: UnitStateElementCodeStatus;
}
export interface PlayerConfig {
unitNumber?: number;
unitTitle?: number;
unitId?: number;
pagingMode?: 'separate' | 'concat-scroll' | 'concat-scroll-snap';
logPolicy?: 'lean' | 'rich' | 'debug' | 'disabled';
startPage?: string;
enabledNavigationTargets?: NavigationTarget[]
}
export interface UnitStateElementCode {
id: string;
status: UnitStateElementCodeStatus;
value: InputElementValue;
export interface UnitState {
dataParts?: Record<string, string>;
presentationProgress?: Progress;
responseProgress?: Progress;
unitStateDataType?: string;
}
export interface PlayerState {
46
47
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
90
91
92
validPages?: Record<string, string>[];
currentPage?: string;
}
export interface LogData{
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 extends VopMetaData{
}
export interface VopMetaData {
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
apiVersion: string;
notSupportedApiFeatures?: string;
supportedUnitDefinitionTypes?: string;
supportedUnitStateDataTypes?: string;
}
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;