@readerseye2/cr_type 1.0.166 → 1.0.168
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ViewerRectPx } from './reading-section.types';
|
|
1
2
|
export type ViewerMode = 'scroll' | 'page';
|
|
2
3
|
export type ViewerTheme = 'light' | 'dark' | 'sepia' | 'green';
|
|
3
4
|
export type PointerStyle = 'highlight' | 'underline';
|
|
@@ -29,7 +30,7 @@ export type CRViewerState = {
|
|
|
29
30
|
viewportHeight: number;
|
|
30
31
|
};
|
|
31
32
|
/** 뷰어 이벤트 타입 */
|
|
32
|
-
export type ViewerEventType = 'global_index_change' | 'scroll' | 'page_change' | 'section_change' | 'mode_change' | 'settings_change' | 'render_start' | 'loading_start' | 'loading_end' | 'viewport_resize' | 'audio_control' | 'range_select' | 'range_change' | 'range_clear' | 'translate_request' | 'translate_loading_start' | 'translate_loading_end' | 'translate_modal_close' | 'calibration_start' | 'calibration_end' | 'reading_gate_open' | 'reading_gate_close' | 'show_gaze_change' | 'ask_calibration' | 'calibration_progress';
|
|
33
|
+
export type ViewerEventType = 'global_index_change' | 'scroll' | 'page_change' | 'section_change' | 'mode_change' | 'settings_change' | 'render_start' | 'loading_start' | 'loading_end' | 'viewport_resize' | 'screen_resize' | 'audio_control' | 'range_select' | 'range_change' | 'range_clear' | 'translate_request' | 'translate_loading_start' | 'translate_loading_end' | 'translate_modal_close' | 'calibration_start' | 'calibration_end' | 'reading_gate_open' | 'reading_gate_close' | 'show_gaze_change' | 'ask_calibration' | 'calibration_progress';
|
|
33
34
|
/** 오디오 상태 스냅샷 */
|
|
34
35
|
export type AudioSnapshot = {
|
|
35
36
|
status: 'idle' | 'loading' | 'playing' | 'paused' | 'ended' | 'error';
|
|
@@ -96,6 +97,12 @@ export type LoadingEndEvent = ViewerEventBase<'loading_end', {
|
|
|
96
97
|
export type ViewportResizeEvent = ViewerEventBase<'viewport_resize', {
|
|
97
98
|
width: number;
|
|
98
99
|
height: number;
|
|
100
|
+
viewerRectPx?: ViewerRectPx;
|
|
101
|
+
}>;
|
|
102
|
+
export type ScreenResizeEvent = ViewerEventBase<'screen_resize', {
|
|
103
|
+
screenWidth: number;
|
|
104
|
+
screenHeight: number;
|
|
105
|
+
viewerRectPx?: ViewerRectPx;
|
|
99
106
|
}>;
|
|
100
107
|
export type AudioControlEvent = ViewerEventBase<'audio_control', {
|
|
101
108
|
action: AudioControlAction;
|
|
@@ -158,7 +165,7 @@ export type CalibrationProgressEvent = ViewerEventBase<'calibration_progress', {
|
|
|
158
165
|
total: number;
|
|
159
166
|
}>;
|
|
160
167
|
/** 모든 뷰어 이벤트 타입 (Union) */
|
|
161
|
-
export type ViewerEvent = GlobalIndexChangeEvent | ScrollEvent | PageChangeEvent | SectionChangeEvent | ModeChangeEvent | SettingsChangeEvent | RenderStartEvent | LoadingStartEvent | LoadingEndEvent | ViewportResizeEvent | AudioControlEvent | RangeSelectEvent | RangeChangeEvent | RangeClearEvent | TranslateRequestEvent | TranslateLoadingStartEvent | TranslateLoadingEndEvent | TranslateModalCloseEvent | CalibrationStartEvent | CalibrationEndEvent | ReadingGateOpenEvent | ReadingGateCloseEvent | ShowGazeChangeEvent | AskCalibrationEvent | CalibrationProgressEvent;
|
|
168
|
+
export type ViewerEvent = GlobalIndexChangeEvent | ScrollEvent | PageChangeEvent | SectionChangeEvent | ModeChangeEvent | SettingsChangeEvent | RenderStartEvent | LoadingStartEvent | LoadingEndEvent | ViewportResizeEvent | AudioControlEvent | RangeSelectEvent | RangeChangeEvent | RangeClearEvent | TranslateRequestEvent | TranslateLoadingStartEvent | TranslateLoadingEndEvent | TranslateModalCloseEvent | CalibrationStartEvent | CalibrationEndEvent | ReadingGateOpenEvent | ReadingGateCloseEvent | ShowGazeChangeEvent | AskCalibrationEvent | CalibrationProgressEvent | ScreenResizeEvent;
|
|
162
169
|
export type ViewerEventCallback = (event: ViewerEvent) => void;
|
|
163
170
|
/** 저장용 이벤트 (any type) */
|
|
164
171
|
export type StoredEvent = StoredViewerEvent<ViewerEventType, unknown>;
|