@helloao/tools 0.0.18 → 0.0.19
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/types/generation/api.d.ts +735 -0
- package/dist/types/generation/audio.d.ts +20 -0
- package/dist/types/generation/book-order.d.ts +19 -0
- package/dist/types/generation/common-types.d.ts +546 -0
- package/dist/types/generation/dataset.d.ts +84 -0
- package/dist/types/generation/index.d.ts +7 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/log.d.ts +23 -0
- package/dist/types/parser/codex-parser.d.ts +158 -0
- package/dist/types/parser/commentary-csv-parser.d.ts +12 -0
- package/dist/types/parser/index.d.ts +8 -0
- package/dist/types/parser/iterators.d.ts +89 -0
- package/dist/types/parser/tyndale-xml-parser.d.ts +8 -0
- package/dist/types/parser/types.d.ts +204 -0
- package/dist/types/parser/usfm-parser.d.ts +135 -0
- package/dist/types/parser/usx-parser.d.ts +37 -0
- package/dist/types/utils.d.ts +48 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TranslationBookChapterAudioLinks } from './common-types.js';
|
|
2
|
+
type AudioTranslationUrlGenerator = (bookId: string, chapter: number) => string;
|
|
3
|
+
/**
|
|
4
|
+
* A map of translation IDs to a map of reader IDs to the URL generator for the audio file.
|
|
5
|
+
*/
|
|
6
|
+
export declare const KNOWN_AUDIO_TRANSLATIONS: Map<string, Map<string, AudioTranslationUrlGenerator>>;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the audio URLs for the given translation, book, and chapter.
|
|
9
|
+
* @param translationId The ID of the translation.
|
|
10
|
+
* @param bookId The ID of the book.
|
|
11
|
+
* @param chapter The number of the chapter.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAudioUrlsForChapter(translationId: string, bookId: string, chapter: number): TranslationBookChapterAudioLinks;
|
|
14
|
+
/**
|
|
15
|
+
* Capitalizes the first letter of the given string.
|
|
16
|
+
* @param str The string to capitalize.
|
|
17
|
+
*/
|
|
18
|
+
export declare function capitalize(str: string): string;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=audio.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines a map that maps the book ID of apocryphal books to the numerical order of the book.
|
|
3
|
+
*/
|
|
4
|
+
export declare const apocryphaBooks: Map<string, number>;
|
|
5
|
+
/**
|
|
6
|
+
* Defines a map that maps the book ID to the numerical order of the book.
|
|
7
|
+
*/
|
|
8
|
+
export declare const bookOrderMap: Map<string, number>;
|
|
9
|
+
/**
|
|
10
|
+
* Defines a map that maps the book ID to the number of chapters the book has.
|
|
11
|
+
*/
|
|
12
|
+
export declare const bookChapterCountMap: Map<string, number>;
|
|
13
|
+
/**
|
|
14
|
+
* Defines a map that maps a locale ID to a book name map.
|
|
15
|
+
*/
|
|
16
|
+
export declare const bookIdMap: Map<string, Map<string, {
|
|
17
|
+
commonName: string;
|
|
18
|
+
}>>;
|
|
19
|
+
//# sourceMappingURL=book-order.d.ts.map
|
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import { VerseRef } from '../utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Defines an interface that contains information about a input file.
|
|
4
|
+
*/
|
|
5
|
+
export type InputFile = InputTranslationFile | InputCommentaryFile;
|
|
6
|
+
export interface InputFileBase {
|
|
7
|
+
name?: string;
|
|
8
|
+
content: string;
|
|
9
|
+
sha256?: string;
|
|
10
|
+
}
|
|
11
|
+
export type InputFileMetadata = InputTranslationMetadata | InputCommentaryMetadata;
|
|
12
|
+
export interface InputTranslationFile extends InputFileBase {
|
|
13
|
+
fileType: 'usfm' | 'usx' | 'json';
|
|
14
|
+
metadata: InputTranslationMetadata;
|
|
15
|
+
}
|
|
16
|
+
export interface InputCommentaryFile extends InputFileBase {
|
|
17
|
+
fileType: 'commentary/csv' | 'commentary/tyndale-xml';
|
|
18
|
+
metadata: InputCommentaryMetadata;
|
|
19
|
+
}
|
|
20
|
+
export type OutputFileContent = object | ReadableStream;
|
|
21
|
+
/**
|
|
22
|
+
* Defines an interface that contains information about a output file.
|
|
23
|
+
*/
|
|
24
|
+
export interface OutputFile {
|
|
25
|
+
/**
|
|
26
|
+
* The path that the file should be stored at.
|
|
27
|
+
*/
|
|
28
|
+
path: string;
|
|
29
|
+
/**
|
|
30
|
+
* The content of the file.
|
|
31
|
+
*/
|
|
32
|
+
content: OutputFileContent | (() => Promise<OutputFileContent>);
|
|
33
|
+
/**
|
|
34
|
+
* Whether the file can be merged with files of the same name but from other datasets.
|
|
35
|
+
*/
|
|
36
|
+
mergable?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface MetadataBase {
|
|
39
|
+
/**
|
|
40
|
+
* The name of the translation.
|
|
41
|
+
*/
|
|
42
|
+
name: string;
|
|
43
|
+
/**
|
|
44
|
+
* The english name of the translation.
|
|
45
|
+
*/
|
|
46
|
+
englishName: string;
|
|
47
|
+
/**
|
|
48
|
+
* The website for the translation.
|
|
49
|
+
*/
|
|
50
|
+
website: string;
|
|
51
|
+
/**
|
|
52
|
+
* The URL that the license for the translation can be found.
|
|
53
|
+
*/
|
|
54
|
+
licenseUrl: string;
|
|
55
|
+
/**
|
|
56
|
+
* The ISO 639 letter language tag that the translation is primarily in.
|
|
57
|
+
*/
|
|
58
|
+
language: string;
|
|
59
|
+
/**
|
|
60
|
+
* The direction that the text is written in.
|
|
61
|
+
*/
|
|
62
|
+
direction: 'ltr' | 'rtl';
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The metadata for a translation that is input into the generator.
|
|
66
|
+
*/
|
|
67
|
+
export interface InputTranslationMetadata extends MetadataBase {
|
|
68
|
+
/**
|
|
69
|
+
* The ID of the translation.
|
|
70
|
+
*/
|
|
71
|
+
id: string;
|
|
72
|
+
/**
|
|
73
|
+
* The short name for the translation.
|
|
74
|
+
*/
|
|
75
|
+
shortName: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The metadata for a translation that is input into the generator.
|
|
79
|
+
*/
|
|
80
|
+
export interface InputCommentaryMetadata extends MetadataBase {
|
|
81
|
+
/**
|
|
82
|
+
* The ID of the commentary.
|
|
83
|
+
*/
|
|
84
|
+
id: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Defines an interface that contains information about a translation.
|
|
88
|
+
*/
|
|
89
|
+
export interface Translation {
|
|
90
|
+
/**
|
|
91
|
+
* The ID of the translation.
|
|
92
|
+
*/
|
|
93
|
+
id: string;
|
|
94
|
+
/**
|
|
95
|
+
* The name of the translation.
|
|
96
|
+
*/
|
|
97
|
+
name: string;
|
|
98
|
+
/**
|
|
99
|
+
* The website for the translation.
|
|
100
|
+
*/
|
|
101
|
+
website: string;
|
|
102
|
+
/**
|
|
103
|
+
* The URL that the license for the translation can be found.
|
|
104
|
+
*/
|
|
105
|
+
licenseUrl: string;
|
|
106
|
+
/**
|
|
107
|
+
* The API-added notes for the license.
|
|
108
|
+
*/
|
|
109
|
+
licenseNotes?: string | null;
|
|
110
|
+
/**
|
|
111
|
+
* The short name for the translation.
|
|
112
|
+
*/
|
|
113
|
+
shortName?: string;
|
|
114
|
+
/**
|
|
115
|
+
* The English name for the translation.
|
|
116
|
+
*/
|
|
117
|
+
englishName: string;
|
|
118
|
+
/**
|
|
119
|
+
* The ISO 639 3-letter language tag that the translation is primarily in.
|
|
120
|
+
*/
|
|
121
|
+
language: string;
|
|
122
|
+
/**
|
|
123
|
+
* The direction that the language is written in.
|
|
124
|
+
* "ltr" indicates that the text is written from the left side of the page to the right.
|
|
125
|
+
* "rtl" indicates that the text is written from the right side of the page to the left.
|
|
126
|
+
*/
|
|
127
|
+
textDirection: 'ltr' | 'rtl';
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Defines an interface that contains information about a commentary.
|
|
131
|
+
*/
|
|
132
|
+
export interface Commentary {
|
|
133
|
+
/**
|
|
134
|
+
* The ID of the commentary.
|
|
135
|
+
*/
|
|
136
|
+
id: string;
|
|
137
|
+
/**
|
|
138
|
+
* The name of the commentary.
|
|
139
|
+
*/
|
|
140
|
+
name: string;
|
|
141
|
+
/**
|
|
142
|
+
* The website for the commentary.
|
|
143
|
+
*/
|
|
144
|
+
website: string;
|
|
145
|
+
/**
|
|
146
|
+
* The URL that the license for the commentary can be found.
|
|
147
|
+
*/
|
|
148
|
+
licenseUrl: string;
|
|
149
|
+
/**
|
|
150
|
+
* The API-added notes for the license.
|
|
151
|
+
*/
|
|
152
|
+
licenseNotes?: string | null;
|
|
153
|
+
/**
|
|
154
|
+
* The english name for the commentary.
|
|
155
|
+
*/
|
|
156
|
+
englishName: string;
|
|
157
|
+
/**
|
|
158
|
+
* The ISO 639 3-letter language tag that the translation is primarily in.
|
|
159
|
+
*/
|
|
160
|
+
language: string;
|
|
161
|
+
/**
|
|
162
|
+
* The direction that the language is written in.
|
|
163
|
+
* "ltr" indicates that the text is written from the left side of the page to the right.
|
|
164
|
+
* "rtl" indicates that the text is written from the right side of the page to the left.
|
|
165
|
+
*/
|
|
166
|
+
textDirection: 'ltr' | 'rtl';
|
|
167
|
+
}
|
|
168
|
+
export interface Dataset {
|
|
169
|
+
/**
|
|
170
|
+
* The ID of the dataset.
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
/**
|
|
174
|
+
* The name of the dataset.
|
|
175
|
+
*/
|
|
176
|
+
name: string;
|
|
177
|
+
/**
|
|
178
|
+
* The website for the dataset.
|
|
179
|
+
*/
|
|
180
|
+
website: string;
|
|
181
|
+
/**
|
|
182
|
+
* The URL that the license for the dataset can be found.
|
|
183
|
+
*/
|
|
184
|
+
licenseUrl: string;
|
|
185
|
+
/**
|
|
186
|
+
* The API-added notes for the license.
|
|
187
|
+
*/
|
|
188
|
+
licenseNotes?: string | null;
|
|
189
|
+
/**
|
|
190
|
+
* The English name for the dataset.
|
|
191
|
+
*/
|
|
192
|
+
englishName: string;
|
|
193
|
+
/**
|
|
194
|
+
* The ISO 639 3-letter language tag that the dataset is primarily in.
|
|
195
|
+
*/
|
|
196
|
+
language: string;
|
|
197
|
+
/**
|
|
198
|
+
* The direction that the language is written in.
|
|
199
|
+
*/
|
|
200
|
+
textDirection: 'ltr' | 'rtl';
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Defines an interface that contains information about a book.
|
|
204
|
+
*/
|
|
205
|
+
export interface TranslationBook {
|
|
206
|
+
/**
|
|
207
|
+
* The ID of the book. Should match the USFM book ID.
|
|
208
|
+
*/
|
|
209
|
+
id: string;
|
|
210
|
+
/**
|
|
211
|
+
* The name that the translation provided for the book.
|
|
212
|
+
*/
|
|
213
|
+
name: string;
|
|
214
|
+
/**
|
|
215
|
+
* The common name for the book.
|
|
216
|
+
*/
|
|
217
|
+
commonName: string;
|
|
218
|
+
/**
|
|
219
|
+
* The title of the book.
|
|
220
|
+
* This is usually a more descriptive version of the book name.
|
|
221
|
+
* If not available, then one was not provided by the translation.
|
|
222
|
+
*/
|
|
223
|
+
title: string | null;
|
|
224
|
+
/**
|
|
225
|
+
* The numerical order of the book in the translation.
|
|
226
|
+
*/
|
|
227
|
+
order: number;
|
|
228
|
+
/**
|
|
229
|
+
* Whether the book is an apocryphal book.
|
|
230
|
+
*/
|
|
231
|
+
isApocryphal?: boolean;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Defines an interface that contains information about a book in a commentary.
|
|
235
|
+
*/
|
|
236
|
+
export interface CommentaryBook {
|
|
237
|
+
/**
|
|
238
|
+
* The ID of the book. Should match the USFM book ID.
|
|
239
|
+
*/
|
|
240
|
+
id: string;
|
|
241
|
+
/**
|
|
242
|
+
* The name that the commentary provided for the book.
|
|
243
|
+
*/
|
|
244
|
+
name: string;
|
|
245
|
+
/**
|
|
246
|
+
* The common name for the book.
|
|
247
|
+
*/
|
|
248
|
+
commonName: string;
|
|
249
|
+
/**
|
|
250
|
+
* The commentary's introduction for the book.
|
|
251
|
+
*/
|
|
252
|
+
introduction?: string;
|
|
253
|
+
/**
|
|
254
|
+
* The summary of the commentary's introduction for the book.
|
|
255
|
+
*/
|
|
256
|
+
introductionSummary?: string;
|
|
257
|
+
/**
|
|
258
|
+
* The order of the book in the Bible.
|
|
259
|
+
*/
|
|
260
|
+
order: number;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Defines an interface that contains information about a dataset book.
|
|
264
|
+
*/
|
|
265
|
+
export interface DatasetBook {
|
|
266
|
+
/**
|
|
267
|
+
* The ID of the book. Should match the USFM book ID.
|
|
268
|
+
*/
|
|
269
|
+
id: string;
|
|
270
|
+
/**
|
|
271
|
+
* The order of the book in the Bible.
|
|
272
|
+
*/
|
|
273
|
+
order: number;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Defines an interface that contains information about a chapter in a dataset.
|
|
277
|
+
*/
|
|
278
|
+
export interface DatasetBookChapter {
|
|
279
|
+
/**
|
|
280
|
+
* The data for the chapter.
|
|
281
|
+
*/
|
|
282
|
+
chapter: DatasetChapterData;
|
|
283
|
+
}
|
|
284
|
+
export interface DatasetChapterData {
|
|
285
|
+
/**
|
|
286
|
+
* The number of the chapter.
|
|
287
|
+
*/
|
|
288
|
+
number: number;
|
|
289
|
+
/**
|
|
290
|
+
* The content of the chapter.
|
|
291
|
+
*/
|
|
292
|
+
content: DatasetChapterVerseContent[];
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Defines an interface that contains information about a verse in a dataset chapter.
|
|
296
|
+
*/
|
|
297
|
+
export interface DatasetChapterVerseContent {
|
|
298
|
+
/**
|
|
299
|
+
* The number of the verse.
|
|
300
|
+
*/
|
|
301
|
+
verse: number;
|
|
302
|
+
/**
|
|
303
|
+
* The list of references for the verse.
|
|
304
|
+
*/
|
|
305
|
+
references: ScoredVerseRef[];
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Defines an interface that contains information about a verse reference that has an arbitrary score attached to it.
|
|
309
|
+
*/
|
|
310
|
+
export interface ScoredVerseRef extends VerseRef {
|
|
311
|
+
/**
|
|
312
|
+
* The score of the verse reference.
|
|
313
|
+
*/
|
|
314
|
+
score: number;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Defines an interface that contains information about a profile in a commentary.
|
|
318
|
+
*/
|
|
319
|
+
export interface CommentaryProfile {
|
|
320
|
+
/**
|
|
321
|
+
* The ID of the profile.
|
|
322
|
+
*/
|
|
323
|
+
id: string;
|
|
324
|
+
/**
|
|
325
|
+
* The subject of the profile.
|
|
326
|
+
*/
|
|
327
|
+
subject: string;
|
|
328
|
+
/**
|
|
329
|
+
* The Bible reference that the profile is associated with.
|
|
330
|
+
*/
|
|
331
|
+
reference: VerseRef | null;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Defines an interface that contains information about a book chapter.
|
|
335
|
+
*/
|
|
336
|
+
export interface TranslationBookChapter {
|
|
337
|
+
/**
|
|
338
|
+
* The information for the chapter.
|
|
339
|
+
*/
|
|
340
|
+
chapter: ChapterData;
|
|
341
|
+
/**
|
|
342
|
+
* The links to different audio versions for the chapter.
|
|
343
|
+
*/
|
|
344
|
+
thisChapterAudioLinks: TranslationBookChapterAudioLinks;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Defines an interface that contains information about a book chapter in a commentary.
|
|
348
|
+
*/
|
|
349
|
+
export interface CommentaryBookChapter {
|
|
350
|
+
/**
|
|
351
|
+
* The information for the chapter.
|
|
352
|
+
*/
|
|
353
|
+
chapter: CommentaryChapterData;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Defines an interface that contains the audio links for a book chapter.
|
|
357
|
+
*/
|
|
358
|
+
export interface TranslationBookChapterAudioLinks {
|
|
359
|
+
/**
|
|
360
|
+
* The reader for the chapter and the URL link to the audio file.
|
|
361
|
+
*/
|
|
362
|
+
[reader: string]: string;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Defines an interface that represents data in a chapter.
|
|
366
|
+
*/
|
|
367
|
+
export interface ChapterData {
|
|
368
|
+
/**
|
|
369
|
+
* The number of the chapter.
|
|
370
|
+
*/
|
|
371
|
+
number: number;
|
|
372
|
+
/**
|
|
373
|
+
* The content of the chapter.
|
|
374
|
+
*/
|
|
375
|
+
content: ChapterContent[];
|
|
376
|
+
/**
|
|
377
|
+
* The list of footnotes for the chapter.
|
|
378
|
+
*/
|
|
379
|
+
footnotes: ChapterFootnote[];
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Defines an interface that represents data in a chapter in a commentary.
|
|
383
|
+
*/
|
|
384
|
+
export interface CommentaryChapterData {
|
|
385
|
+
/**
|
|
386
|
+
* The number of the chapter.
|
|
387
|
+
*/
|
|
388
|
+
number: number;
|
|
389
|
+
/**
|
|
390
|
+
* The introduction that the commentary provided to the chapter.
|
|
391
|
+
* Not all commentaries provide an introduction to a chapter.
|
|
392
|
+
*/
|
|
393
|
+
introduction?: string;
|
|
394
|
+
/**
|
|
395
|
+
* The content of the chapter.
|
|
396
|
+
*/
|
|
397
|
+
content: ChapterVerse[];
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* A union type that represents a single piece of chapter content.
|
|
401
|
+
* A piece of chapter content can be one of the following things:
|
|
402
|
+
* - A heading.
|
|
403
|
+
* - A line break.
|
|
404
|
+
* - A verse.
|
|
405
|
+
* - A Hebrew Subtitle.
|
|
406
|
+
*/
|
|
407
|
+
export type ChapterContent = ChapterHeading | ChapterLineBreak | ChapterVerse | ChapterHebrewSubtitle;
|
|
408
|
+
/**
|
|
409
|
+
* A heading in a chapter.
|
|
410
|
+
*/
|
|
411
|
+
export interface ChapterHeading {
|
|
412
|
+
/**
|
|
413
|
+
* Indicates that the content represents a heading.
|
|
414
|
+
*/
|
|
415
|
+
type: 'heading';
|
|
416
|
+
/**
|
|
417
|
+
* The content for the heading.
|
|
418
|
+
* If multiple strings are included in the array, they should be concatenated with a space.
|
|
419
|
+
*/
|
|
420
|
+
content: string[];
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* A line break in a chapter.
|
|
424
|
+
*/
|
|
425
|
+
export interface ChapterLineBreak {
|
|
426
|
+
/**
|
|
427
|
+
* Indicates that the content represents a line break.
|
|
428
|
+
*/
|
|
429
|
+
type: 'line_break';
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* A Hebrew Subtitle in a chapter.
|
|
433
|
+
* These are often used included as informational content that appeared in the original manuscripts.
|
|
434
|
+
* For example, Psalms 49 has the Hebrew Subtitle "To the choirmaster. A Psalm of the Sons of Korah."
|
|
435
|
+
*/
|
|
436
|
+
export interface ChapterHebrewSubtitle {
|
|
437
|
+
/**
|
|
438
|
+
* Indicates that the content represents a Hebrew Subtitle.
|
|
439
|
+
*/
|
|
440
|
+
type: 'hebrew_subtitle';
|
|
441
|
+
/**
|
|
442
|
+
* The list of content that is contained in the subtitle.
|
|
443
|
+
* Each element in the list could be a string, formatted text, or a footnote reference.
|
|
444
|
+
*/
|
|
445
|
+
content: (string | FormattedText | VerseFootnoteReference)[];
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* A verse in a chapter.
|
|
449
|
+
*/
|
|
450
|
+
export interface ChapterVerse {
|
|
451
|
+
/**
|
|
452
|
+
* Indicates that the content is a verse.
|
|
453
|
+
*/
|
|
454
|
+
type: 'verse';
|
|
455
|
+
/**
|
|
456
|
+
* The number of the verse.
|
|
457
|
+
*/
|
|
458
|
+
number: number;
|
|
459
|
+
/**
|
|
460
|
+
* The list of content for the verse.
|
|
461
|
+
* Each element in the list could be a string, formatted text, or a footnote reference.
|
|
462
|
+
*/
|
|
463
|
+
content: (string | FormattedText | InlineHeading | InlineLineBreak | VerseFootnoteReference)[];
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Formatted text. That is, text that is formated in a particular manner.
|
|
467
|
+
*/
|
|
468
|
+
export interface FormattedText {
|
|
469
|
+
/**
|
|
470
|
+
* The text that is formatted.
|
|
471
|
+
*/
|
|
472
|
+
text: string;
|
|
473
|
+
/**
|
|
474
|
+
* Whether the text represents a poem.
|
|
475
|
+
* The number indicates the level of indent.
|
|
476
|
+
*
|
|
477
|
+
* Common in Psalms.
|
|
478
|
+
*/
|
|
479
|
+
poem?: number;
|
|
480
|
+
/**
|
|
481
|
+
* Whether the text represents the Words of Jesus.
|
|
482
|
+
*/
|
|
483
|
+
wordsOfJesus?: boolean;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Defines an interface that represents a heading that is embedded in a verse.
|
|
487
|
+
*/
|
|
488
|
+
export interface InlineHeading {
|
|
489
|
+
/**
|
|
490
|
+
* The text of the heading.
|
|
491
|
+
*/
|
|
492
|
+
heading: string;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Defines an interface that represents a line break that is embedded in a verse.
|
|
496
|
+
*/
|
|
497
|
+
export interface InlineLineBreak {
|
|
498
|
+
lineBreak: true;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* A footnote reference in a verse or a Hebrew Subtitle.
|
|
502
|
+
*/
|
|
503
|
+
export interface VerseFootnoteReference {
|
|
504
|
+
/**
|
|
505
|
+
* The ID of the note.
|
|
506
|
+
*/
|
|
507
|
+
noteId: number;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Information about a footnote.
|
|
511
|
+
*/
|
|
512
|
+
export interface ChapterFootnote {
|
|
513
|
+
/**
|
|
514
|
+
* The ID of the note that is referenced.
|
|
515
|
+
*/
|
|
516
|
+
noteId: number;
|
|
517
|
+
/**
|
|
518
|
+
* The text of the footnote.
|
|
519
|
+
*/
|
|
520
|
+
text: string;
|
|
521
|
+
/**
|
|
522
|
+
* The verse reference for the footnote.
|
|
523
|
+
*/
|
|
524
|
+
reference?: {
|
|
525
|
+
chapter: number;
|
|
526
|
+
verse: number;
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* The caller that should be used for the footnote.
|
|
530
|
+
* For footnotes, a "caller" is the character that is used in the text to reference to footnote.
|
|
531
|
+
*
|
|
532
|
+
* For example, in the text:
|
|
533
|
+
* Hello (a) World
|
|
534
|
+
*
|
|
535
|
+
* ----
|
|
536
|
+
* (a) This is a footnote.
|
|
537
|
+
*
|
|
538
|
+
* The "(a)" is the caller.
|
|
539
|
+
*
|
|
540
|
+
* If "+", then the caller should be autogenerated.
|
|
541
|
+
* If null, then the caller should be empty.
|
|
542
|
+
* If a string, then the caller should be that string.
|
|
543
|
+
*/
|
|
544
|
+
caller: '+' | string | null;
|
|
545
|
+
}
|
|
546
|
+
//# sourceMappingURL=common-types.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Commentary, CommentaryBook, CommentaryBookChapter, CommentaryProfile, InputFile, Translation, TranslationBook, TranslationBookChapter, Dataset as CommonDataset, DatasetBook, DatasetBookChapter } from './common-types.js';
|
|
2
|
+
import { ParseMessage } from '../parser/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Defines an interface that contains generated dataset info.
|
|
5
|
+
*/
|
|
6
|
+
export interface DatasetOutput {
|
|
7
|
+
/**
|
|
8
|
+
* The list of translations that are available in the dataset.
|
|
9
|
+
*/
|
|
10
|
+
translations: DatasetTranslation[];
|
|
11
|
+
/**
|
|
12
|
+
* The list of commentaries that are available in the dataset.
|
|
13
|
+
*/
|
|
14
|
+
commentaries: DatasetCommentary[];
|
|
15
|
+
/**
|
|
16
|
+
* The list of datasets that are available in the dataset.
|
|
17
|
+
*/
|
|
18
|
+
datasets?: DatasetDataset[];
|
|
19
|
+
parseMessages?: {
|
|
20
|
+
[key: string]: ParseMessage[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Defines a translation that is used in the dataset.
|
|
25
|
+
*/
|
|
26
|
+
export interface DatasetTranslation extends Translation {
|
|
27
|
+
/**
|
|
28
|
+
* The list of books that are available for the translation.
|
|
29
|
+
*/
|
|
30
|
+
books: DatasetTranslationBook[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Defines a commentary that is used in the dataset.
|
|
34
|
+
*/
|
|
35
|
+
export interface DatasetCommentary extends Commentary {
|
|
36
|
+
/**
|
|
37
|
+
* The list of books that are available for the commentary.
|
|
38
|
+
*/
|
|
39
|
+
books: DatasetCommentaryBook[];
|
|
40
|
+
/**
|
|
41
|
+
* The list of profiles that are available for the commentary.
|
|
42
|
+
*/
|
|
43
|
+
profiles: DatasetCommentaryProfile[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Defines a translation book that is used in the dataset.
|
|
47
|
+
*/
|
|
48
|
+
export interface DatasetTranslationBook extends TranslationBook {
|
|
49
|
+
/**
|
|
50
|
+
* The list of chapters that are available for the book.
|
|
51
|
+
*/
|
|
52
|
+
chapters: TranslationBookChapter[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Defines a commentary book that is used in the dataset.
|
|
56
|
+
*/
|
|
57
|
+
export interface DatasetCommentaryBook extends CommentaryBook {
|
|
58
|
+
/**
|
|
59
|
+
* The list of chapters that are available for the book.
|
|
60
|
+
*/
|
|
61
|
+
chapters: CommentaryBookChapter[];
|
|
62
|
+
}
|
|
63
|
+
export interface DatasetCommentaryProfile extends CommentaryProfile {
|
|
64
|
+
/**
|
|
65
|
+
* The contents of the profile.
|
|
66
|
+
*/
|
|
67
|
+
content: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface DatasetDataset extends CommonDataset {
|
|
70
|
+
books: DatasetDatasetBook[];
|
|
71
|
+
}
|
|
72
|
+
export interface DatasetDatasetBook extends DatasetBook {
|
|
73
|
+
chapters: DatasetBookChapter[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Generates a list of output files from the given list of input files.
|
|
77
|
+
* @param file The list of files.
|
|
78
|
+
* @param parser The parser to use for parsing the files.
|
|
79
|
+
* @param bookMap The map of book IDs to names. If undefined, then a default map will be used.
|
|
80
|
+
*/
|
|
81
|
+
export declare function generateDataset(files: InputFile[], parser?: DOMParser, bookMap?: Map<string, {
|
|
82
|
+
commonName: string;
|
|
83
|
+
}> | undefined): DatasetOutput;
|
|
84
|
+
//# sourceMappingURL=dataset.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as api from './api.js';
|
|
2
|
+
import * as audio from './audio.js';
|
|
3
|
+
import * as dataset from './dataset.js';
|
|
4
|
+
import * as bookOrder from './book-order.js';
|
|
5
|
+
export * from './common-types.js';
|
|
6
|
+
export { api, audio, dataset, bookOrder };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple logging interface that can be used to log messages.
|
|
3
|
+
*/
|
|
4
|
+
export interface Logger {
|
|
5
|
+
log: (message: any, ...args: any[]) => void;
|
|
6
|
+
warn: (message: string, ...args: any[]) => void;
|
|
7
|
+
error: (message: string, ...args: any[]) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A logger that logs messages to the console.
|
|
11
|
+
*/
|
|
12
|
+
export declare const consoleLogger: Logger;
|
|
13
|
+
/**
|
|
14
|
+
* Gets the logger that is currently being used for logging messages.
|
|
15
|
+
* @returns The logger that is currently being used.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getLogger(): Logger;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the logger to use for logging messages.
|
|
20
|
+
* @param newLogger The new logger to use.
|
|
21
|
+
*/
|
|
22
|
+
export declare function setLogger(newLogger: Logger): void;
|
|
23
|
+
//# sourceMappingURL=log.d.ts.map
|