@readerseye2/cr_type 1.0.90 → 1.0.91

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,5 +1,5 @@
1
1
  /** 언어 */
2
- export type BookLanguage = 'ko' | 'en';
2
+ export type BookLanguage = "ko" | "en";
3
3
  export declare const BookLanguageLabel: {
4
4
  readonly ko: "한국어";
5
5
  readonly en: "English";
@@ -17,17 +17,17 @@ export declare const BOOK_LEVEL_MIN = 5;
17
17
  /** @deprecated BOOK_AGE_MIN/MAX 사용 권장 */
18
18
  export declare const BOOK_LEVEL_MAX = 19;
19
19
  /** 길이 */
20
- export type BookLength = 'short' | 'medium' | 'long';
20
+ export type BookLength = "short" | "medium" | "long";
21
21
  export declare const BookLengthLabel: {
22
22
  readonly short: "단편";
23
23
  readonly medium: "중편";
24
24
  readonly long: "장편";
25
25
  };
26
26
  /** 종류 (단순화) */
27
- export type BookGenre = 'fiction' | 'non-fiction' | 'other';
27
+ export type BookGenre = "fiction" | "non-fiction" | "other";
28
28
  export declare const BookGenreLabel: {
29
29
  readonly fiction: "문학";
30
- readonly 'non-fiction': "비문학";
30
+ readonly "non-fiction": "비문학";
31
31
  readonly other: "기타";
32
32
  };
33
33
  /** @deprecated BookGenre type 사용 권장 */
@@ -43,21 +43,22 @@ export declare enum BookGenreEnum {
43
43
  OTHER = "other"
44
44
  }
45
45
  /** 영어레벨 (영어책 전용) */
46
- export type BookEnLevel = 'story' | 'readers' | 'early-chapter' | 'chapter' | 'novel';
46
+ export type BookEnLevel = "story" | "readers" | "early-chapter" | "middle-chapter" | "chapter" | "novel";
47
47
  export declare const BookEnLevelLabel: {
48
48
  readonly story: "스토리";
49
49
  readonly readers: "리더스";
50
- readonly 'early-chapter': "얼리챕터";
50
+ readonly "early-chapter": "얼리챕터";
51
+ readonly "middle-chapter": "미들챕터";
51
52
  readonly chapter: "챕터";
52
53
  readonly novel: "노블";
53
54
  };
54
55
  /** 출판 연령등급 (플랫폼 정책용) */
55
- export type PublishAgeRating = 'all' | '12' | '15' | '19';
56
+ export type PublishAgeRating = "all" | "12" | "15" | "19";
56
57
  export declare const PublishAgeRatingLabel: {
57
58
  readonly all: "전체이용가";
58
- readonly '12': "12세 이용가";
59
- readonly '15': "15세 이용가";
60
- readonly '19': "19세 이용가";
59
+ readonly "12": "12세 이용가";
60
+ readonly "15": "15세 이용가";
61
+ readonly "19": "19세 이용가";
61
62
  };
62
63
  /** @deprecated PublishAgeRating 사용 권장 */
63
64
  export declare enum BookAgeGrade {
@@ -75,7 +76,198 @@ export declare const DEFAULT_BOOK_META: {
75
76
  readonly length: BookLength;
76
77
  readonly genre: BookGenre;
77
78
  readonly quiz_retry_allowed: true;
79
+ readonly ar_index: 3;
80
+ readonly lexile_index: 600;
78
81
  };
82
+ /** AR / Lexile 범위 매칭 규칙: min <= value <= max */
83
+ /** AR 지수 범위별 설명 (소수점 1자리 기준) */
84
+ export declare const AR_INDEX_RANGES: readonly [{
85
+ readonly min: 0;
86
+ readonly max: 1.9;
87
+ readonly level: "유아 ~ 초1";
88
+ readonly description: "그림책, 아주 짧은 문장";
89
+ }, {
90
+ readonly min: 2;
91
+ readonly max: 2.9;
92
+ readonly level: "초2";
93
+ readonly description: "기초 리더북";
94
+ }, {
95
+ readonly min: 3;
96
+ readonly max: 3.9;
97
+ readonly level: "초3";
98
+ readonly description: "챕터북 시작";
99
+ }, {
100
+ readonly min: 4;
101
+ readonly max: 4.9;
102
+ readonly level: "초4";
103
+ readonly description: "본격적인 이야기 구조";
104
+ }, {
105
+ readonly min: 5;
106
+ readonly max: 5.9;
107
+ readonly level: "초5";
108
+ readonly description: "어휘·문장 길이 증가";
109
+ }, {
110
+ readonly min: 6;
111
+ readonly max: 6.9;
112
+ readonly level: "초6";
113
+ readonly description: "논픽션 비중 증가";
114
+ }, {
115
+ readonly min: 7;
116
+ readonly max: 8.9;
117
+ readonly level: "중학생";
118
+ readonly description: "복합 문장, 추론 필요";
119
+ }, {
120
+ readonly min: 9;
121
+ readonly max: 10.9;
122
+ readonly level: "고등학생";
123
+ readonly description: "문학 작품, 추상 개념";
124
+ }, {
125
+ readonly min: 11;
126
+ readonly max: 12;
127
+ readonly level: "고급";
128
+ readonly description: "성인 소설·고전";
129
+ }];
130
+ /** Lexile 지수 범위별 설명 */
131
+ export declare const LEXILE_INDEX_RANGES: readonly [{
132
+ readonly min: 0;
133
+ readonly max: 200;
134
+ readonly level: "유아";
135
+ readonly description: "알파벳·기초 단어";
136
+ }, {
137
+ readonly min: 200;
138
+ readonly max: 400;
139
+ readonly level: "초1";
140
+ readonly description: "아주 쉬운 문장";
141
+ }, {
142
+ readonly min: 400;
143
+ readonly max: 600;
144
+ readonly level: "초2";
145
+ readonly description: "간단한 스토리";
146
+ }, {
147
+ readonly min: 600;
148
+ readonly max: 800;
149
+ readonly level: "초3";
150
+ readonly description: "챕터북";
151
+ }, {
152
+ readonly min: 800;
153
+ readonly max: 1000;
154
+ readonly level: "초4";
155
+ readonly description: "정보량 증가";
156
+ }, {
157
+ readonly min: 1000;
158
+ readonly max: 1200;
159
+ readonly level: "초5~6";
160
+ readonly description: "교과서 수준";
161
+ }, {
162
+ readonly min: 1200;
163
+ readonly max: 1400;
164
+ readonly level: "중학생";
165
+ readonly description: "추론·비판적 읽기";
166
+ }, {
167
+ readonly min: 1400;
168
+ readonly max: 1600;
169
+ readonly level: "고등학생";
170
+ readonly description: "문학·비문학 혼합";
171
+ }, {
172
+ readonly min: 1600;
173
+ readonly max: 2000;
174
+ readonly level: "성인";
175
+ readonly description: "학술·고전 문학";
176
+ }];
177
+ /** AR 지수로 해당 범위 설명 조회 (min <= value <= max) */
178
+ export declare const getARDescription: (ar: number) => {
179
+ readonly min: 0;
180
+ readonly max: 1.9;
181
+ readonly level: "유아 ~ 초1";
182
+ readonly description: "그림책, 아주 짧은 문장";
183
+ } | {
184
+ readonly min: 2;
185
+ readonly max: 2.9;
186
+ readonly level: "초2";
187
+ readonly description: "기초 리더북";
188
+ } | {
189
+ readonly min: 3;
190
+ readonly max: 3.9;
191
+ readonly level: "초3";
192
+ readonly description: "챕터북 시작";
193
+ } | {
194
+ readonly min: 4;
195
+ readonly max: 4.9;
196
+ readonly level: "초4";
197
+ readonly description: "본격적인 이야기 구조";
198
+ } | {
199
+ readonly min: 5;
200
+ readonly max: 5.9;
201
+ readonly level: "초5";
202
+ readonly description: "어휘·문장 길이 증가";
203
+ } | {
204
+ readonly min: 6;
205
+ readonly max: 6.9;
206
+ readonly level: "초6";
207
+ readonly description: "논픽션 비중 증가";
208
+ } | {
209
+ readonly min: 7;
210
+ readonly max: 8.9;
211
+ readonly level: "중학생";
212
+ readonly description: "복합 문장, 추론 필요";
213
+ } | {
214
+ readonly min: 9;
215
+ readonly max: 10.9;
216
+ readonly level: "고등학생";
217
+ readonly description: "문학 작품, 추상 개념";
218
+ } | {
219
+ readonly min: 11;
220
+ readonly max: 12;
221
+ readonly level: "고급";
222
+ readonly description: "성인 소설·고전";
223
+ } | undefined;
224
+ /** Lexile 지수로 해당 범위 설명 조회 (min <= value <= max) */
225
+ export declare const getLexileDescription: (lexile: number) => {
226
+ readonly min: 0;
227
+ readonly max: 200;
228
+ readonly level: "유아";
229
+ readonly description: "알파벳·기초 단어";
230
+ } | {
231
+ readonly min: 200;
232
+ readonly max: 400;
233
+ readonly level: "초1";
234
+ readonly description: "아주 쉬운 문장";
235
+ } | {
236
+ readonly min: 400;
237
+ readonly max: 600;
238
+ readonly level: "초2";
239
+ readonly description: "간단한 스토리";
240
+ } | {
241
+ readonly min: 600;
242
+ readonly max: 800;
243
+ readonly level: "초3";
244
+ readonly description: "챕터북";
245
+ } | {
246
+ readonly min: 800;
247
+ readonly max: 1000;
248
+ readonly level: "초4";
249
+ readonly description: "정보량 증가";
250
+ } | {
251
+ readonly min: 1000;
252
+ readonly max: 1200;
253
+ readonly level: "초5~6";
254
+ readonly description: "교과서 수준";
255
+ } | {
256
+ readonly min: 1200;
257
+ readonly max: 1400;
258
+ readonly level: "중학생";
259
+ readonly description: "추론·비판적 읽기";
260
+ } | {
261
+ readonly min: 1400;
262
+ readonly max: 1600;
263
+ readonly level: "고등학생";
264
+ readonly description: "문학·비문학 혼합";
265
+ } | {
266
+ readonly min: 1600;
267
+ readonly max: 2000;
268
+ readonly level: "성인";
269
+ readonly description: "학술·고전 문학";
270
+ } | undefined;
79
271
  /** 어절 수 → 재생 분수 계산 (200 WPM 기준) */
80
272
  export declare const calcSoundMinutes: (wordCount: number) => number;
81
273
  /** 언어 옵션 (UI Select용) */
@@ -96,7 +288,7 @@ export declare const getGenreOptions: () => {
96
288
  /** 영어레벨 옵션 (UI Select용) */
97
289
  export declare const getEnLevelOptions: () => {
98
290
  value: BookEnLevel;
99
- label: "스토리" | "리더스" | "얼리챕터" | "챕터" | "노블";
291
+ label: "스토리" | "리더스" | "얼리챕터" | "미들챕터" | "챕터" | "노블";
100
292
  }[];
101
293
  /** 출판 연령등급 옵션 (UI Select용) */
102
294
  export declare const getAgeRatingOptions: () => {
@@ -117,6 +309,8 @@ export interface DraftBookMeta {
117
309
  length: BookLength;
118
310
  genre?: BookGenre;
119
311
  quiz_retry_allowed?: boolean;
312
+ ar_index?: number;
313
+ lexile_index?: number;
120
314
  series?: string;
121
315
  cover_url?: string;
122
316
  en_level?: BookEnLevel;
@@ -144,11 +338,11 @@ export interface BookMeta extends DraftBookMeta {
144
338
  }
145
339
  /** 오디오 메타 정보 (TTS 설정) */
146
340
  export type AudioMeta = {
147
- provider: 'AWS' | 'GCP';
148
- language?: 'en-US' | 'ko-KR';
149
- engine?: 'neural' | 'standard' | 'long-form';
341
+ provider: "AWS" | "GCP";
342
+ language?: "en-US" | "ko-KR";
343
+ engine?: "neural" | "standard" | "long-form";
150
344
  voiceName?: string;
151
- voiceGender?: 'Male' | 'Female';
345
+ voiceGender?: "Male" | "Female";
152
346
  };
153
347
  /** 섹션 요약 정보 */
154
348
  export interface SectionSummary {
@@ -232,6 +426,8 @@ export interface DraftBookResponse {
232
426
  draft_book_word_count?: number | null;
233
427
  draft_book_sound_minutes?: number | null;
234
428
  draft_book_quiz_retry_allowed?: boolean;
429
+ draft_book_ar_index?: number | null;
430
+ draft_book_lexile_index?: number | null;
235
431
  draft_book_sections?: SectionSummaryResponse[];
236
432
  draft_book_section_order?: string[];
237
433
  }
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  // ========== 기본 타입 ==========
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getAgeOptions = exports.getAgeRatingOptions = exports.getEnLevelOptions = exports.getGenreOptions = exports.getLengthOptions = exports.getLanguageOptions = exports.calcSoundMinutes = exports.DEFAULT_BOOK_META = exports.BookAgeGrade = exports.PublishAgeRatingLabel = exports.BookEnLevelLabel = exports.BookGenreEnum = exports.BookGenreLabel = exports.BookLengthLabel = exports.BOOK_LEVEL_MAX = exports.BOOK_LEVEL_MIN = exports.BOOK_AGE_MAX = exports.BOOK_AGE_MIN = exports.BookLanguageCode = exports.BookLanguageLabel = void 0;
4
+ exports.getAgeOptions = exports.getAgeRatingOptions = exports.getEnLevelOptions = exports.getGenreOptions = exports.getLengthOptions = exports.getLanguageOptions = exports.calcSoundMinutes = exports.getLexileDescription = exports.getARDescription = exports.LEXILE_INDEX_RANGES = exports.AR_INDEX_RANGES = exports.DEFAULT_BOOK_META = exports.BookAgeGrade = exports.PublishAgeRatingLabel = exports.BookEnLevelLabel = exports.BookGenreEnum = exports.BookGenreLabel = exports.BookLengthLabel = exports.BOOK_LEVEL_MAX = exports.BOOK_LEVEL_MIN = exports.BOOK_AGE_MAX = exports.BOOK_AGE_MIN = exports.BookLanguageCode = exports.BookLanguageLabel = void 0;
5
5
  exports.BookLanguageLabel = {
6
- ko: '한국어',
7
- en: 'English',
6
+ ko: "한국어",
7
+ en: "English",
8
8
  };
9
9
  /** @deprecated BookLanguage 사용 권장 */
10
10
  var BookLanguageCode;
@@ -20,14 +20,14 @@ exports.BOOK_LEVEL_MIN = 5;
20
20
  /** @deprecated BOOK_AGE_MIN/MAX 사용 권장 */
21
21
  exports.BOOK_LEVEL_MAX = 19;
22
22
  exports.BookLengthLabel = {
23
- short: '단편',
24
- medium: '중편',
25
- long: '장편',
23
+ short: "단편",
24
+ medium: "중편",
25
+ long: "장편",
26
26
  };
27
27
  exports.BookGenreLabel = {
28
- fiction: '문학',
29
- 'non-fiction': '비문학',
30
- other: '기타',
28
+ fiction: "문학",
29
+ "non-fiction": "비문학",
30
+ other: "기타",
31
31
  };
32
32
  /** @deprecated BookGenre type 사용 권장 */
33
33
  var BookGenreEnum;
@@ -43,17 +43,18 @@ var BookGenreEnum;
43
43
  BookGenreEnum["OTHER"] = "other";
44
44
  })(BookGenreEnum || (exports.BookGenreEnum = BookGenreEnum = {}));
45
45
  exports.BookEnLevelLabel = {
46
- story: '스토리',
47
- readers: '리더스',
48
- 'early-chapter': '얼리챕터',
49
- chapter: '챕터',
50
- novel: '노블',
46
+ story: "스토리",
47
+ readers: "리더스",
48
+ "early-chapter": "얼리챕터",
49
+ "middle-chapter": "미들챕터",
50
+ chapter: "챕터",
51
+ novel: "노블",
51
52
  };
52
53
  exports.PublishAgeRatingLabel = {
53
- all: '전체이용가',
54
- '12': '12세 이용가',
55
- '15': '15세 이용가',
56
- '19': '19세 이용가',
54
+ all: "전체이용가",
55
+ "12": "12세 이용가",
56
+ "15": "15세 이용가",
57
+ "19": "19세 이용가",
57
58
  };
58
59
  /** @deprecated PublishAgeRating 사용 권장 */
59
60
  var BookAgeGrade;
@@ -67,31 +68,80 @@ var BookAgeGrade;
67
68
  // ========== 기본값 ==========
68
69
  /** 새 책 생성 시 기본값 */
69
70
  exports.DEFAULT_BOOK_META = {
70
- title: '나의 책',
71
- language: 'en',
71
+ title: "나의 책",
72
+ language: "en",
72
73
  age: 5,
73
- length: 'short',
74
- genre: 'fiction',
74
+ length: "short",
75
+ genre: "fiction",
75
76
  quiz_retry_allowed: true,
77
+ ar_index: 3.0,
78
+ lexile_index: 600,
76
79
  };
80
+ // ========== AR / Lexile 지수 ==========
81
+ /** AR / Lexile 범위 매칭 규칙: min <= value <= max */
82
+ /** AR 지수 범위별 설명 (소수점 1자리 기준) */
83
+ exports.AR_INDEX_RANGES = [
84
+ { min: 0.0, max: 1.9, level: "유아 ~ 초1", description: "그림책, 아주 짧은 문장" },
85
+ { min: 2.0, max: 2.9, level: "초2", description: "기초 리더북" },
86
+ { min: 3.0, max: 3.9, level: "초3", description: "챕터북 시작" },
87
+ { min: 4.0, max: 4.9, level: "초4", description: "본격적인 이야기 구조" },
88
+ { min: 5.0, max: 5.9, level: "초5", description: "어휘·문장 길이 증가" },
89
+ { min: 6.0, max: 6.9, level: "초6", description: "논픽션 비중 증가" },
90
+ { min: 7.0, max: 8.9, level: "중학생", description: "복합 문장, 추론 필요" },
91
+ { min: 9.0, max: 10.9, level: "고등학생", description: "문학 작품, 추상 개념" },
92
+ { min: 11.0, max: 12.0, level: "고급", description: "성인 소설·고전" },
93
+ ];
94
+ /** Lexile 지수 범위별 설명 */
95
+ exports.LEXILE_INDEX_RANGES = [
96
+ { min: 0, max: 200, level: "유아", description: "알파벳·기초 단어" },
97
+ { min: 200, max: 400, level: "초1", description: "아주 쉬운 문장" },
98
+ { min: 400, max: 600, level: "초2", description: "간단한 스토리" },
99
+ { min: 600, max: 800, level: "초3", description: "챕터북" },
100
+ { min: 800, max: 1000, level: "초4", description: "정보량 증가" },
101
+ { min: 1000, max: 1200, level: "초5~6", description: "교과서 수준" },
102
+ { min: 1200, max: 1400, level: "중학생", description: "추론·비판적 읽기" },
103
+ { min: 1400, max: 1600, level: "고등학생", description: "문학·비문학 혼합" },
104
+ { min: 1600, max: 2000, level: "성인", description: "학술·고전 문학" },
105
+ ];
106
+ /** AR 지수로 해당 범위 설명 조회 (min <= value <= max) */
107
+ const getARDescription = (ar) => exports.AR_INDEX_RANGES.find(r => ar >= r.min && ar <= r.max);
108
+ exports.getARDescription = getARDescription;
109
+ /** Lexile 지수로 해당 범위 설명 조회 (min <= value <= max) */
110
+ const getLexileDescription = (lexile) => exports.LEXILE_INDEX_RANGES.find(r => lexile >= r.min && lexile <= r.max);
111
+ exports.getLexileDescription = getLexileDescription;
77
112
  // ========== 헬퍼 함수 ==========
78
113
  /** 어절 수 → 재생 분수 계산 (200 WPM 기준) */
79
114
  const calcSoundMinutes = (wordCount) => Math.ceil(wordCount / 200);
80
115
  exports.calcSoundMinutes = calcSoundMinutes;
81
116
  /** 언어 옵션 (UI Select용) */
82
- const getLanguageOptions = () => Object.entries(exports.BookLanguageLabel).map(([value, label]) => ({ value: value, label }));
117
+ const getLanguageOptions = () => Object.entries(exports.BookLanguageLabel).map(([value, label]) => ({
118
+ value: value,
119
+ label,
120
+ }));
83
121
  exports.getLanguageOptions = getLanguageOptions;
84
122
  /** 길이 옵션 (UI Select용) */
85
- const getLengthOptions = () => Object.entries(exports.BookLengthLabel).map(([value, label]) => ({ value: value, label }));
123
+ const getLengthOptions = () => Object.entries(exports.BookLengthLabel).map(([value, label]) => ({
124
+ value: value,
125
+ label,
126
+ }));
86
127
  exports.getLengthOptions = getLengthOptions;
87
128
  /** 장르 옵션 (UI Select용) */
88
- const getGenreOptions = () => Object.entries(exports.BookGenreLabel).map(([value, label]) => ({ value: value, label }));
129
+ const getGenreOptions = () => Object.entries(exports.BookGenreLabel).map(([value, label]) => ({
130
+ value: value,
131
+ label,
132
+ }));
89
133
  exports.getGenreOptions = getGenreOptions;
90
134
  /** 영어레벨 옵션 (UI Select용) */
91
- const getEnLevelOptions = () => Object.entries(exports.BookEnLevelLabel).map(([value, label]) => ({ value: value, label }));
135
+ const getEnLevelOptions = () => Object.entries(exports.BookEnLevelLabel).map(([value, label]) => ({
136
+ value: value,
137
+ label,
138
+ }));
92
139
  exports.getEnLevelOptions = getEnLevelOptions;
93
140
  /** 출판 연령등급 옵션 (UI Select용) */
94
- const getAgeRatingOptions = () => Object.entries(exports.PublishAgeRatingLabel).map(([value, label]) => ({ value: value, label }));
141
+ const getAgeRatingOptions = () => Object.entries(exports.PublishAgeRatingLabel).map(([value, label]) => ({
142
+ value: value,
143
+ label,
144
+ }));
95
145
  exports.getAgeRatingOptions = getAgeRatingOptions;
96
146
  /** 권장 연령 옵션 (5~19세) */
97
147
  const getAgeOptions = () => Array.from({ length: exports.BOOK_AGE_MAX - exports.BOOK_AGE_MIN + 1 }, (_, i) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readerseye2/cr_type",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
4
4
  "description": "CheckReading shared TypeScript types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",