Newer
Older
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 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 UnitState {
dataParts?: Record<string, string>;
presentationProgress?: Progress;
responseProgress?: Progress;
unitStateDataType?: string;
}
export interface PlayerState {
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
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 {
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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;