@readerseye2/cr_type 1.0.82 → 1.0.84
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.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/socket/index.d.ts +1 -0
- package/dist/socket/index.js +1 -0
- package/dist/socket/reading-section.types.d.ts +4 -29
- package/dist/socket/reading-section.types.js +1 -1
- package/dist/socket/recording.types.d.ts +4 -3
- package/dist/socket/socket-serverToClientEvents.type.d.ts +3 -2
- package/dist/{viewer/viewerEvent.types.d.ts → socket/viewer-events.types.d.ts} +23 -31
- package/dist/socket/viewer-events.types.js +5 -0
- package/package.json +1 -1
- package/dist/session.d.ts +0 -36
- package/dist/session.js +0 -16
- package/dist/socket/monitor.types.d.ts +0 -82
- package/dist/socket/monitor.types.js +0 -4
- package/dist/socket/reading-session.types.d.ts +0 -114
- package/dist/socket/reading-session.types.js +0 -5
- package/dist/viewer/viewerEvent.types.js +0 -5
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -19,4 +19,4 @@ __exportStar(require("./session/session.type"), exports);
|
|
|
19
19
|
__exportStar(require("./socket"), exports); // socket 전체 export
|
|
20
20
|
__exportStar(require("./book"), exports);
|
|
21
21
|
__exportStar(require("./ast"), exports); // AST 타입 (SectionData, Block 등)
|
|
22
|
-
|
|
22
|
+
// viewer 타입은 @readerseye2/cr_viewer에서 export
|
package/dist/socket/index.d.ts
CHANGED
package/dist/socket/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
// src/socket/index.ts
|
|
18
|
+
__exportStar(require("./viewer-events.types"), exports);
|
|
18
19
|
__exportStar(require("./socket-clientToServerEvents.type"), exports);
|
|
19
20
|
__exportStar(require("./socket-serverToClientEvents.type"), exports);
|
|
20
21
|
__exportStar(require("./socket-message.types"), exports);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** 뷰어 설정 상태 (CRViewerState에서 재사용) */
|
|
3
|
-
export type ViewerStateSnapshot = RecordingViewerState;
|
|
1
|
+
import type { CRViewerState, ViewerEvent } from './viewer-events.types';
|
|
4
2
|
/** 뷰어 스냅샷 (소켓 통신용 - 현재 읽기 상태) */
|
|
5
3
|
export interface ViewerSnapshot {
|
|
6
4
|
viewMode: 'scroll' | 'page';
|
|
@@ -10,26 +8,7 @@ export interface ViewerSnapshot {
|
|
|
10
8
|
totalItems: number;
|
|
11
9
|
viewportWidth?: number;
|
|
12
10
|
viewportHeight?: number;
|
|
13
|
-
viewerState?:
|
|
14
|
-
}
|
|
15
|
-
/** 소켓 전송용 뷰어 이벤트 (간소화된 형태) */
|
|
16
|
-
export interface SocketViewerEvent {
|
|
17
|
-
type: ViewerEventType | 'overlay_toggle' | 'range_select' | 'quiz_answer' | 'gi_change';
|
|
18
|
-
timestamp: number;
|
|
19
|
-
data: Record<string, unknown>;
|
|
20
|
-
}
|
|
21
|
-
/** 뷰어 초기 설정 */
|
|
22
|
-
export interface ViewerConfig {
|
|
23
|
-
fontSize?: number;
|
|
24
|
-
lineHeight?: number;
|
|
25
|
-
theme?: 'light' | 'dark' | 'sepia';
|
|
26
|
-
viewMode?: 'scroll' | 'page';
|
|
27
|
-
}
|
|
28
|
-
/** 읽기 진행 상황 */
|
|
29
|
-
export interface ReadingProgress {
|
|
30
|
-
currentPage?: number;
|
|
31
|
-
totalPages?: number;
|
|
32
|
-
percentage?: number;
|
|
11
|
+
viewerState?: Partial<CRViewerState>;
|
|
33
12
|
}
|
|
34
13
|
/** 책/섹션 메타데이터 */
|
|
35
14
|
export interface SessionMeta {
|
|
@@ -49,7 +28,6 @@ export interface SessionStartPayload {
|
|
|
49
28
|
bookIdx: number;
|
|
50
29
|
sectionId: string;
|
|
51
30
|
snapshot: ViewerSnapshot;
|
|
52
|
-
viewerConfig?: ViewerConfig;
|
|
53
31
|
meta?: SessionMeta;
|
|
54
32
|
}
|
|
55
33
|
/** 섹션 읽기 종료 페이로드 */
|
|
@@ -61,11 +39,10 @@ export interface SessionEndPayload {
|
|
|
61
39
|
/** 진행 상황 업데이트 페이로드 */
|
|
62
40
|
export interface SessionProgressPayload {
|
|
63
41
|
snapshot: ViewerSnapshot;
|
|
64
|
-
progress?: ReadingProgress;
|
|
65
42
|
}
|
|
66
43
|
/** 이벤트 배치 전송 페이로드 */
|
|
67
44
|
export interface SessionEventPayload {
|
|
68
|
-
events:
|
|
45
|
+
events: ViewerEvent[];
|
|
69
46
|
}
|
|
70
47
|
/** 세션 구독 페이로드 (Admin용) */
|
|
71
48
|
export interface SessionSubscribePayload {
|
|
@@ -85,7 +62,6 @@ export interface ReadingSessionInfo {
|
|
|
85
62
|
totalSections?: number;
|
|
86
63
|
startedAt: string;
|
|
87
64
|
snapshot: ViewerSnapshot;
|
|
88
|
-
viewerConfig?: ViewerConfig;
|
|
89
65
|
lastEventAt?: string;
|
|
90
66
|
}
|
|
91
67
|
/** 세션 시작 응답 */
|
|
@@ -102,12 +78,11 @@ export interface SessionEndedResponse {
|
|
|
102
78
|
export interface SessionProgressResponse {
|
|
103
79
|
sessionId: string;
|
|
104
80
|
snapshot: ViewerSnapshot;
|
|
105
|
-
progress?: ReadingProgress;
|
|
106
81
|
}
|
|
107
82
|
/** 세션 이벤트 응답 */
|
|
108
83
|
export interface SessionEventsResponse {
|
|
109
84
|
sessionId: string;
|
|
110
|
-
events:
|
|
85
|
+
events: ViewerEvent[];
|
|
111
86
|
}
|
|
112
87
|
/** 세션 목록 응답 */
|
|
113
88
|
export interface SessionListResponse {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ViewerSnapshot
|
|
1
|
+
import type { ViewerSnapshot } from './reading-section.types';
|
|
2
|
+
import type { ViewerEvent } from './viewer-events.types';
|
|
2
3
|
/** 녹화 요청자 타입 */
|
|
3
4
|
export type RecordingRequesterType = 'admin' | 'parent';
|
|
4
5
|
/** 뷰어 사용자 타입 (실제로 책 읽는 사람) */
|
|
@@ -15,7 +16,7 @@ export type SegmentStatus = 'active' | 'ended';
|
|
|
15
16
|
export interface ChunkFile {
|
|
16
17
|
startTimestamp: number;
|
|
17
18
|
endTimestamp: number;
|
|
18
|
-
events:
|
|
19
|
+
events: ViewerEvent[];
|
|
19
20
|
/** 청크 시작 시점의 뷰어 상태 (Seek 시 이 상태로 초기화 후 이벤트 재생) */
|
|
20
21
|
snapshot?: ViewerSnapshot;
|
|
21
22
|
}
|
|
@@ -283,7 +284,7 @@ export interface ActiveSegment {
|
|
|
283
284
|
sectionId: string;
|
|
284
285
|
sectionTitle?: string;
|
|
285
286
|
startedAt: number;
|
|
286
|
-
eventBuffer:
|
|
287
|
+
eventBuffer: ViewerEvent[];
|
|
287
288
|
chunkStartTimestamp: number;
|
|
288
289
|
/** 현재 청크 시작 시점의 스냅샷 (청크에 포함됨) */
|
|
289
290
|
chunkStartSnapshot: ViewerSnapshot | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MessageReadResponse, MessageResponse, NoticeMessageResult } from "./socket-message.types";
|
|
2
|
-
import { ReadingSessionInfo,
|
|
2
|
+
import { ReadingSessionInfo, ViewerSnapshot } from "./reading-section.types";
|
|
3
|
+
import { ViewerEvent } from "./viewer-events.types";
|
|
3
4
|
import { ConnectedUser, ConnectedUsersGrouped } from "./connected-user.types";
|
|
4
5
|
import { RecordingStartedPayload, RecordingStoppedPayload, RecordingChunkPayload, SegmentStartedPayload, SegmentEndedPayload, RecordingListResultPayload, RecordingManifestPayload, SegmentMetaPayload, ChunksResultPayload } from "./recording.types";
|
|
5
6
|
export interface ServerToClientEvents {
|
|
@@ -35,7 +36,7 @@ export interface ReadingServerToClientEvents {
|
|
|
35
36
|
}) => void;
|
|
36
37
|
'reading-section:events': (payload: {
|
|
37
38
|
sessionId: string;
|
|
38
|
-
events:
|
|
39
|
+
events: ViewerEvent[];
|
|
39
40
|
}) => void;
|
|
40
41
|
'reading-section:error': (payload: {
|
|
41
42
|
message: string;
|
|
@@ -11,6 +11,8 @@ export type CRViewerState = {
|
|
|
11
11
|
marginX: number;
|
|
12
12
|
marginY: number;
|
|
13
13
|
showOverlays: boolean;
|
|
14
|
+
/** 컴팩트 오버레이 모드 (topbar 숨김 + bottombar 축소) */
|
|
15
|
+
overlayCompactMode: boolean;
|
|
14
16
|
isSettingsOpen: boolean;
|
|
15
17
|
pointerStyle: PointerStyle;
|
|
16
18
|
pointerColor: string;
|
|
@@ -19,38 +21,23 @@ export type CRViewerState = {
|
|
|
19
21
|
};
|
|
20
22
|
breakGapPx: number;
|
|
21
23
|
muteAudio: boolean;
|
|
22
|
-
|
|
24
|
+
/** 오디오 재생 속도 (1.0 = 기본, 0.05 단위 증감, 범위: 0.3~2.0) */
|
|
23
25
|
audioSpeed: number;
|
|
24
26
|
showPointer: boolean;
|
|
25
27
|
showSplit: boolean;
|
|
26
28
|
viewportWidth: number;
|
|
27
29
|
viewportHeight: number;
|
|
28
|
-
playbackViewportWidth: number;
|
|
29
|
-
playbackViewportHeight: number;
|
|
30
30
|
};
|
|
31
31
|
/** 뷰어 이벤트 타입 */
|
|
32
|
-
export type ViewerEventType = '
|
|
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';
|
|
33
33
|
/** 오디오 상태 스냅샷 */
|
|
34
34
|
export type AudioSnapshot = {
|
|
35
35
|
status: 'idle' | 'loading' | 'playing' | 'paused' | 'ended' | 'error';
|
|
36
36
|
currentClip: number;
|
|
37
37
|
currentTimeMs: number;
|
|
38
38
|
};
|
|
39
|
-
/**
|
|
40
|
-
export type
|
|
41
|
-
/** 녹화 시작 시 저장할 초기 스냅샷 */
|
|
42
|
-
export type RecordingSnapshot = {
|
|
43
|
-
viewerState: RecordingViewerState;
|
|
44
|
-
globalIndex: number;
|
|
45
|
-
scrollY?: number;
|
|
46
|
-
anchorGI?: number;
|
|
47
|
-
anchorOffsetRatio?: number;
|
|
48
|
-
currentPage?: number;
|
|
49
|
-
sectionId: string;
|
|
50
|
-
viewportWidth: number;
|
|
51
|
-
viewportHeight: number;
|
|
52
|
-
audio?: AudioSnapshot;
|
|
53
|
-
};
|
|
39
|
+
/** 오디오 제어 액션 타입 */
|
|
40
|
+
export type AudioControlAction = 'play' | 'pause' | 'stop';
|
|
54
41
|
/** 기본 이벤트 (뷰어에서 emit) */
|
|
55
42
|
export type ViewerEventBase<T extends ViewerEventType, P = Record<string, unknown>> = {
|
|
56
43
|
type: T;
|
|
@@ -61,14 +48,6 @@ export type ViewerEventBase<T extends ViewerEventType, P = Record<string, unknow
|
|
|
61
48
|
export type StoredViewerEvent<T extends ViewerEventType, P = Record<string, unknown>> = ViewerEventBase<T, P> & {
|
|
62
49
|
relTime: number;
|
|
63
50
|
};
|
|
64
|
-
/** 오디오 제어 액션 타입 */
|
|
65
|
-
export type AudioControlAction = 'play' | 'pause' | 'stop';
|
|
66
|
-
export type RecordingStartEvent = ViewerEventBase<'recording_start', {
|
|
67
|
-
snapshot: RecordingSnapshot;
|
|
68
|
-
}>;
|
|
69
|
-
export type RecordingStopEvent = ViewerEventBase<'recording_stop', {
|
|
70
|
-
duration: number;
|
|
71
|
-
}>;
|
|
72
51
|
export type GlobalIndexChangeEvent = ViewerEventBase<'global_index_change', {
|
|
73
52
|
globalIndex: number;
|
|
74
53
|
}>;
|
|
@@ -80,6 +59,7 @@ export type ScrollEvent = ViewerEventBase<'scroll', {
|
|
|
80
59
|
}>;
|
|
81
60
|
export type PageChangeEvent = ViewerEventBase<'page_change', {
|
|
82
61
|
page: number;
|
|
62
|
+
pageIndex?: number;
|
|
83
63
|
}>;
|
|
84
64
|
export type SectionChangeEvent = ViewerEventBase<'section_change', {
|
|
85
65
|
sectionId: string;
|
|
@@ -91,9 +71,6 @@ export type SettingsChangeEvent = ViewerEventBase<'settings_change', {
|
|
|
91
71
|
key: keyof CRViewerState;
|
|
92
72
|
value: unknown;
|
|
93
73
|
}>;
|
|
94
|
-
export type ViewerStateSnapshotEvent = ViewerEventBase<'viewer_state_snapshot', {
|
|
95
|
-
viewerState: CRViewerState;
|
|
96
|
-
}>;
|
|
97
74
|
export type RenderStartEvent = ViewerEventBase<'render_start', {
|
|
98
75
|
sectionId: string;
|
|
99
76
|
}>;
|
|
@@ -109,10 +86,25 @@ export type AudioControlEvent = ViewerEventBase<'audio_control', {
|
|
|
109
86
|
action: AudioControlAction;
|
|
110
87
|
}>;
|
|
111
88
|
/** 모든 뷰어 이벤트 타입 (Union) */
|
|
112
|
-
export type ViewerEvent =
|
|
89
|
+
export type ViewerEvent = GlobalIndexChangeEvent | ScrollEvent | PageChangeEvent | SectionChangeEvent | ModeChangeEvent | SettingsChangeEvent | RenderStartEvent | LoadingStartEvent | LoadingEndEvent | ViewportResizeEvent | AudioControlEvent;
|
|
113
90
|
export type ViewerEventCallback = (event: ViewerEvent) => void;
|
|
114
91
|
/** 저장용 이벤트 (any type) */
|
|
115
92
|
export type StoredEvent = StoredViewerEvent<ViewerEventType, unknown>;
|
|
93
|
+
/** 녹화용 뷰어 상태 (Partial - 모든 필드가 필수는 아님) */
|
|
94
|
+
export type RecordingViewerState = Partial<CRViewerState>;
|
|
95
|
+
/** 녹화/재생용 뷰어 스냅샷 (정확한 구조) */
|
|
96
|
+
export type RecordingSnapshot = {
|
|
97
|
+
viewerState: RecordingViewerState;
|
|
98
|
+
globalIndex: number;
|
|
99
|
+
scrollY?: number;
|
|
100
|
+
anchorGI?: number;
|
|
101
|
+
anchorOffsetRatio?: number;
|
|
102
|
+
currentPage?: number;
|
|
103
|
+
sectionId: string;
|
|
104
|
+
viewportWidth: number;
|
|
105
|
+
viewportHeight: number;
|
|
106
|
+
audio?: AudioSnapshot;
|
|
107
|
+
};
|
|
116
108
|
/** 녹화 청크 */
|
|
117
109
|
export type RecordingChunk = {
|
|
118
110
|
index: number;
|
package/package.json
CHANGED
package/dist/session.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare enum OauthUserType {
|
|
2
|
-
CHILD = "child",
|
|
3
|
-
PARENT = "parent",
|
|
4
|
-
ADMIN = "admin"
|
|
5
|
-
}
|
|
6
|
-
export declare enum OauthProvider {
|
|
7
|
-
GOOGLE = "google",
|
|
8
|
-
NAVER = "naver",
|
|
9
|
-
KAKAO = "kakao"
|
|
10
|
-
}
|
|
11
|
-
export interface CommonSessionData {
|
|
12
|
-
access_token: string;
|
|
13
|
-
access_token_expire: number;
|
|
14
|
-
refresh_token: string;
|
|
15
|
-
refresh_token_expire: number;
|
|
16
|
-
createdAt: number;
|
|
17
|
-
device_ID: string;
|
|
18
|
-
session_type: OauthUserType;
|
|
19
|
-
}
|
|
20
|
-
export interface ParentSessionData extends CommonSessionData {
|
|
21
|
-
user_idx: number;
|
|
22
|
-
user_logo_url?: string;
|
|
23
|
-
client_id: string;
|
|
24
|
-
email: string;
|
|
25
|
-
name: string;
|
|
26
|
-
provider: OauthProvider;
|
|
27
|
-
}
|
|
28
|
-
export interface ChildSessionData extends CommonSessionData {
|
|
29
|
-
parent_idx: number;
|
|
30
|
-
child_idx: number;
|
|
31
|
-
child_image_url?: string;
|
|
32
|
-
child_ID: string;
|
|
33
|
-
parent_name: string;
|
|
34
|
-
parent_logo_url?: string;
|
|
35
|
-
}
|
|
36
|
-
export type userSessionData = ParentSessionData | ChildSessionData;
|
package/dist/session.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OauthProvider = exports.OauthUserType = void 0;
|
|
4
|
-
// export type providerEnum = 'google' | 'naver' | 'kakao';
|
|
5
|
-
var OauthUserType;
|
|
6
|
-
(function (OauthUserType) {
|
|
7
|
-
OauthUserType["CHILD"] = "child";
|
|
8
|
-
OauthUserType["PARENT"] = "parent";
|
|
9
|
-
OauthUserType["ADMIN"] = "admin";
|
|
10
|
-
})(OauthUserType || (exports.OauthUserType = OauthUserType = {}));
|
|
11
|
-
var OauthProvider;
|
|
12
|
-
(function (OauthProvider) {
|
|
13
|
-
OauthProvider["GOOGLE"] = "google";
|
|
14
|
-
OauthProvider["NAVER"] = "naver";
|
|
15
|
-
OauthProvider["KAKAO"] = "kakao";
|
|
16
|
-
})(OauthProvider || (exports.OauthProvider = OauthProvider = {}));
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { SocketViewerEvent, ViewerSnapshot, ReadingSessionInfo } from './reading-section.types';
|
|
2
|
-
/** 모니터링 메타 정보 (S3 meta.json) */
|
|
3
|
-
export interface MonitorMeta {
|
|
4
|
-
targetSocketId: string;
|
|
5
|
-
userType: 'parent' | 'child';
|
|
6
|
-
userId: number;
|
|
7
|
-
userName: string;
|
|
8
|
-
parentIdx?: number;
|
|
9
|
-
startedAt: number;
|
|
10
|
-
endedAt: number | null;
|
|
11
|
-
adminSocketId: string;
|
|
12
|
-
chunkCount: number;
|
|
13
|
-
}
|
|
14
|
-
/** 모니터링 청크 (S3 chunks/N.json) */
|
|
15
|
-
export interface MonitorChunk {
|
|
16
|
-
chunkIndex: number;
|
|
17
|
-
chunkTimestamp: number;
|
|
18
|
-
readingSessionId: string | null;
|
|
19
|
-
sectionId: string | null;
|
|
20
|
-
bookIdx: number | null;
|
|
21
|
-
events: SocketViewerEvent[];
|
|
22
|
-
snapshot: ViewerSnapshot | null;
|
|
23
|
-
/** 청크 생성 주기 (ms) */
|
|
24
|
-
delayMs: number;
|
|
25
|
-
}
|
|
26
|
-
/** 모니터링 시작 요청 */
|
|
27
|
-
export interface MonitorStartPayload {
|
|
28
|
-
targetSocketId: string;
|
|
29
|
-
}
|
|
30
|
-
/** 모니터링 중지 요청 */
|
|
31
|
-
export interface MonitorStopPayload {
|
|
32
|
-
targetSocketId: string;
|
|
33
|
-
}
|
|
34
|
-
/** 모니터링 시작 응답 */
|
|
35
|
-
export interface MonitorStartedPayload {
|
|
36
|
-
targetSocketId: string;
|
|
37
|
-
startedAt: number;
|
|
38
|
-
userInfo: {
|
|
39
|
-
userType: 'parent' | 'child';
|
|
40
|
-
userId: number;
|
|
41
|
-
userName: string;
|
|
42
|
-
parentIdx?: number;
|
|
43
|
-
};
|
|
44
|
-
currentSession: ReadingSessionInfo | null;
|
|
45
|
-
}
|
|
46
|
-
/** 모니터링 청크 전송 */
|
|
47
|
-
export interface MonitorChunkPayload {
|
|
48
|
-
targetSocketId: string;
|
|
49
|
-
chunk: MonitorChunk;
|
|
50
|
-
}
|
|
51
|
-
/** 모니터링 대상 세션 변경 알림 */
|
|
52
|
-
export interface MonitorSessionChangedPayload {
|
|
53
|
-
targetSocketId: string;
|
|
54
|
-
session: ReadingSessionInfo | null;
|
|
55
|
-
}
|
|
56
|
-
/** 모니터링 중지 알림 (대상 연결 해제 등) */
|
|
57
|
-
export interface MonitorStoppedPayload {
|
|
58
|
-
targetSocketId: string;
|
|
59
|
-
reason?: string;
|
|
60
|
-
}
|
|
61
|
-
/** 모니터링 에러 */
|
|
62
|
-
export interface MonitorErrorPayload {
|
|
63
|
-
message: string;
|
|
64
|
-
}
|
|
65
|
-
/** 활성 모니터링 (서버 메모리) */
|
|
66
|
-
export interface ActiveMonitor {
|
|
67
|
-
targetSocketId: string;
|
|
68
|
-
adminSocketId: string;
|
|
69
|
-
userType: 'parent' | 'child';
|
|
70
|
-
userId: number;
|
|
71
|
-
userName: string;
|
|
72
|
-
parentIdx?: number;
|
|
73
|
-
startedAt: number;
|
|
74
|
-
s3Prefix: string;
|
|
75
|
-
chunkIndex: number;
|
|
76
|
-
eventBuffer: SocketViewerEvent[];
|
|
77
|
-
lastSnapshot: ViewerSnapshot | null;
|
|
78
|
-
currentReadingSessionId: string | null;
|
|
79
|
-
currentSectionId: string | null;
|
|
80
|
-
currentBookIdx: number | null;
|
|
81
|
-
intervalHandle: ReturnType<typeof setInterval> | null;
|
|
82
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/** 뷰어 스냅샷 (현재 상태) */
|
|
2
|
-
export interface ViewerSnapshot {
|
|
3
|
-
viewMode: 'scroll' | 'page';
|
|
4
|
-
globalRunIndex: number;
|
|
5
|
-
pageIndex?: number;
|
|
6
|
-
scrollPosition?: number;
|
|
7
|
-
totalItems: number;
|
|
8
|
-
}
|
|
9
|
-
/** 뷰어 이벤트 */
|
|
10
|
-
export interface ViewerEvent {
|
|
11
|
-
type: 'page_change' | 'scroll' | 'overlay_toggle' | 'range_select' | 'quiz_answer' | 'gi_change';
|
|
12
|
-
timestamp: number;
|
|
13
|
-
data: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
/** 뷰어 초기 설정 */
|
|
16
|
-
export interface ViewerConfig {
|
|
17
|
-
fontSize?: number;
|
|
18
|
-
lineHeight?: number;
|
|
19
|
-
theme?: 'light' | 'dark' | 'sepia';
|
|
20
|
-
viewMode?: 'scroll' | 'page';
|
|
21
|
-
}
|
|
22
|
-
/** 읽기 진행 상황 */
|
|
23
|
-
export interface ReadingProgress {
|
|
24
|
-
currentPage?: number;
|
|
25
|
-
totalPages?: number;
|
|
26
|
-
percentage?: number;
|
|
27
|
-
}
|
|
28
|
-
/** 책/섹션 메타데이터 */
|
|
29
|
-
export interface SessionMeta {
|
|
30
|
-
bookTitle?: string;
|
|
31
|
-
sectionTitle?: string;
|
|
32
|
-
sectionOrder?: number;
|
|
33
|
-
totalSections?: number;
|
|
34
|
-
}
|
|
35
|
-
/** 세션 통계 */
|
|
36
|
-
export interface SessionStats {
|
|
37
|
-
pagesRead?: number;
|
|
38
|
-
scrollDistance?: number;
|
|
39
|
-
interactionCount?: number;
|
|
40
|
-
}
|
|
41
|
-
/** 세션 시작 페이로드 */
|
|
42
|
-
export interface SessionStartPayload {
|
|
43
|
-
bookIdx: number;
|
|
44
|
-
sectionId: string;
|
|
45
|
-
snapshot: ViewerSnapshot;
|
|
46
|
-
viewerConfig?: ViewerConfig;
|
|
47
|
-
meta?: SessionMeta;
|
|
48
|
-
}
|
|
49
|
-
/** 세션 종료 페이로드 */
|
|
50
|
-
export interface SessionEndPayload {
|
|
51
|
-
durationMs?: number;
|
|
52
|
-
finalSnapshot?: ViewerSnapshot;
|
|
53
|
-
stats?: SessionStats;
|
|
54
|
-
}
|
|
55
|
-
/** 진행 상황 업데이트 페이로드 */
|
|
56
|
-
export interface SessionProgressPayload {
|
|
57
|
-
snapshot: ViewerSnapshot;
|
|
58
|
-
progress?: ReadingProgress;
|
|
59
|
-
}
|
|
60
|
-
/** 이벤트 배치 전송 페이로드 */
|
|
61
|
-
export interface SessionEventPayload {
|
|
62
|
-
events: ViewerEvent[];
|
|
63
|
-
}
|
|
64
|
-
/** 세션 구독 페이로드 */
|
|
65
|
-
export interface SessionSubscribePayload {
|
|
66
|
-
sessionId: string;
|
|
67
|
-
}
|
|
68
|
-
/** 읽기 세션 정보 (서버 응답) */
|
|
69
|
-
export interface ReadingSessionInfo {
|
|
70
|
-
sessionId: string;
|
|
71
|
-
userId: number;
|
|
72
|
-
userType: 'parent' | 'child';
|
|
73
|
-
userName?: string;
|
|
74
|
-
bookIdx: number;
|
|
75
|
-
bookTitle?: string;
|
|
76
|
-
sectionId: string;
|
|
77
|
-
sectionTitle?: string;
|
|
78
|
-
sectionOrder?: number;
|
|
79
|
-
totalSections?: number;
|
|
80
|
-
startedAt: string;
|
|
81
|
-
snapshot: ViewerSnapshot;
|
|
82
|
-
viewerConfig?: ViewerConfig;
|
|
83
|
-
lastEventAt?: string;
|
|
84
|
-
}
|
|
85
|
-
/** 세션 시작 응답 */
|
|
86
|
-
export interface SessionStartedResponse {
|
|
87
|
-
session: ReadingSessionInfo;
|
|
88
|
-
}
|
|
89
|
-
/** 세션 종료 응답 */
|
|
90
|
-
export interface SessionEndedResponse {
|
|
91
|
-
sessionId: string;
|
|
92
|
-
durationMs?: number;
|
|
93
|
-
stats?: SessionStats;
|
|
94
|
-
}
|
|
95
|
-
/** 세션 진행 상황 응답 */
|
|
96
|
-
export interface SessionProgressResponse {
|
|
97
|
-
sessionId: string;
|
|
98
|
-
snapshot: ViewerSnapshot;
|
|
99
|
-
progress?: ReadingProgress;
|
|
100
|
-
}
|
|
101
|
-
/** 세션 이벤트 응답 */
|
|
102
|
-
export interface SessionEventsResponse {
|
|
103
|
-
sessionId: string;
|
|
104
|
-
events: ViewerEvent[];
|
|
105
|
-
}
|
|
106
|
-
/** 세션 목록 응답 */
|
|
107
|
-
export interface SessionListResponse {
|
|
108
|
-
sessions: ReadingSessionInfo[];
|
|
109
|
-
}
|
|
110
|
-
/** 세션 구독 성공 응답 */
|
|
111
|
-
export interface SessionSubscribedResponse {
|
|
112
|
-
sessionId: string;
|
|
113
|
-
snapshot: ViewerSnapshot;
|
|
114
|
-
}
|