@helloao/tools 0.0.1

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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/generation/api.d.ts +203 -0
  3. package/generation/api.js +153 -0
  4. package/generation/api.spec.d.ts +2 -0
  5. package/generation/api.spec.js +463 -0
  6. package/generation/audio.d.ts +20 -0
  7. package/generation/audio.js +60 -0
  8. package/generation/audio.spec.d.ts +2 -0
  9. package/generation/audio.spec.js +36 -0
  10. package/generation/book-order.d.ts +15 -0
  11. package/generation/book-order.js +494 -0
  12. package/generation/book-order.spec.d.ts +2 -0
  13. package/generation/book-order.spec.js +8 -0
  14. package/generation/common-types.d.ts +327 -0
  15. package/generation/common-types.js +2 -0
  16. package/generation/dataset.d.ts +34 -0
  17. package/generation/dataset.js +106 -0
  18. package/generation/index.d.ts +7 -0
  19. package/generation/index.js +38 -0
  20. package/index.d.ts +5 -0
  21. package/index.js +32 -0
  22. package/package.json +27 -0
  23. package/parser/codex-parser.d.ts +97 -0
  24. package/parser/codex-parser.js +160 -0
  25. package/parser/codex-parser.spec.d.ts +2 -0
  26. package/parser/codex-parser.spec.js +645 -0
  27. package/parser/index.d.ts +7 -0
  28. package/parser/index.js +35 -0
  29. package/parser/iterators.d.ts +89 -0
  30. package/parser/iterators.js +222 -0
  31. package/parser/iterators.spec.d.ts +2 -0
  32. package/parser/iterators.spec.js +174 -0
  33. package/parser/types.d.ts +144 -0
  34. package/parser/types.js +2 -0
  35. package/parser/usfm-parser.d.ts +135 -0
  36. package/parser/usfm-parser.js +840 -0
  37. package/parser/usfm-parser.spec.d.ts +2 -0
  38. package/parser/usfm-parser.spec.js +1593 -0
  39. package/parser/usx-parser.d.ts +33 -0
  40. package/parser/usx-parser.js +425 -0
  41. package/parser/usx-parser.spec.d.ts +2 -0
  42. package/parser/usx-parser.spec.js +1260 -0
  43. package/typings/types.d.ts +14 -0
  44. package/utils.d.ts +29 -0
  45. package/utils.js +73 -0
  46. package/utils.spec.d.ts +2 -0
  47. package/utils.spec.js +42 -0
@@ -0,0 +1,327 @@
1
+ /**
2
+ * Defines an interface that contains information about a input file.
3
+ */
4
+ export interface InputFile {
5
+ name?: string;
6
+ metadata: ParseTreeMetadata;
7
+ content: string;
8
+ sha256?: string;
9
+ fileType: 'usfm' | 'usx' | 'json';
10
+ }
11
+ export type OutputFileContent = object | ReadableStream;
12
+ /**
13
+ * Defines an interface that contains information about a output file.
14
+ */
15
+ export interface OutputFile {
16
+ /**
17
+ * The path that the file should be stored at.
18
+ */
19
+ path: string;
20
+ /**
21
+ * The content of the file.
22
+ */
23
+ content: OutputFileContent | (() => Promise<OutputFileContent>);
24
+ /**
25
+ * Whether the file can be merged with files of the same name but from other datasets.
26
+ */
27
+ mergable?: boolean;
28
+ }
29
+ /**
30
+ * Defines an interface that contains metadata for a parse tree.
31
+ */
32
+ export interface ParseTreeMetadata {
33
+ /**
34
+ * Information about the translation.
35
+ */
36
+ translation: InputTranslationMetadata;
37
+ }
38
+ /**
39
+ * The metadata for a translation that is input into the generator.
40
+ */
41
+ export interface InputTranslationMetadata {
42
+ /**
43
+ * The ID of the translation.
44
+ */
45
+ id: string;
46
+ /**
47
+ * The name of the translation.
48
+ */
49
+ name: string;
50
+ /**
51
+ * The english name of the translation.
52
+ */
53
+ englishName: string;
54
+ /**
55
+ * The website for the translation.
56
+ */
57
+ website: string;
58
+ /**
59
+ * The URL that the license for the translation can be found.
60
+ */
61
+ licenseUrl: string;
62
+ /**
63
+ * The short name for the translation.
64
+ */
65
+ shortName?: string;
66
+ /**
67
+ * The ISO 639 letter language tag that the translation is primarily in.
68
+ */
69
+ language: string;
70
+ /**
71
+ * The direction that the text is written in.
72
+ */
73
+ direction: 'ltr' | 'rtl';
74
+ }
75
+ /**
76
+ * Defines an interface that contains information about a translation.
77
+ */
78
+ export interface Translation {
79
+ /**
80
+ * The ID of the translation.
81
+ */
82
+ id: string;
83
+ /**
84
+ * The name of the translation.
85
+ */
86
+ name: string;
87
+ /**
88
+ * The website for the translation.
89
+ */
90
+ website: string;
91
+ /**
92
+ * The URL that the license for the translation can be found.
93
+ */
94
+ licenseUrl: string;
95
+ /**
96
+ * The short name for the translation.
97
+ */
98
+ shortName?: string;
99
+ /**
100
+ * The English name for the translation.
101
+ */
102
+ englishName: string;
103
+ /**
104
+ * The ISO 639 3-letter language tag that the translation is primarily in.
105
+ */
106
+ language: string;
107
+ /**
108
+ * The direction that the language is written in.
109
+ * "ltr" indicates that the text is written from the left side of the page to the right.
110
+ * "rtl" indicates that the text is written from the right side of the page to the left.
111
+ */
112
+ textDirection: 'ltr' | 'rtl';
113
+ }
114
+ /**
115
+ * Defines an interface that contains information about a book.
116
+ */
117
+ export interface TranslationBook {
118
+ /**
119
+ * The ID of the book.
120
+ */
121
+ id: string;
122
+ /**
123
+ * The name that the translation provided for the book.
124
+ */
125
+ name: string;
126
+ /**
127
+ * The common name for the book.
128
+ */
129
+ commonName: string;
130
+ /**
131
+ * The title of the book.
132
+ * This is usually a more descriptive version of the book name.
133
+ * If not available, then one was not provided by the translation.
134
+ */
135
+ title: string | null;
136
+ /**
137
+ * The numerical order of the book in the translation.
138
+ */
139
+ order: number;
140
+ }
141
+ /**
142
+ * Defines an interface that contains information about a book chapter.
143
+ */
144
+ export interface TranslationBookChapter {
145
+ /**
146
+ * The information for the chapter.
147
+ */
148
+ chapter: ChapterData;
149
+ /**
150
+ * The links to different audio versions for the chapter.
151
+ */
152
+ thisChapterAudioLinks: TranslationBookChapterAudioLinks;
153
+ }
154
+ /**
155
+ * Defines an interface that contains the audio links for a book chapter.
156
+ */
157
+ export interface TranslationBookChapterAudioLinks {
158
+ /**
159
+ * The reader for the chapter and the URL link to the audio file.
160
+ */
161
+ [reader: string]: string;
162
+ }
163
+ /**
164
+ * Defines an interface that represents data in a chapter.
165
+ */
166
+ export interface ChapterData {
167
+ /**
168
+ * The number of the chapter.
169
+ */
170
+ number: number;
171
+ /**
172
+ * The content of the chapter.
173
+ */
174
+ content: ChapterContent[];
175
+ /**
176
+ * The list of footnotes for the chapter.
177
+ */
178
+ footnotes: ChapterFootnote[];
179
+ }
180
+ /**
181
+ * A union type that represents a single piece of chapter content.
182
+ * A piece of chapter content can be one of the following things:
183
+ * - A heading.
184
+ * - A line break.
185
+ * - A verse.
186
+ * - A Hebrew Subtitle.
187
+ */
188
+ export type ChapterContent = ChapterHeading | ChapterLineBreak | ChapterVerse | ChapterHebrewSubtitle;
189
+ /**
190
+ * A heading in a chapter.
191
+ */
192
+ export interface ChapterHeading {
193
+ /**
194
+ * Indicates that the content represents a heading.
195
+ */
196
+ type: 'heading';
197
+ /**
198
+ * The content for the heading.
199
+ * If multiple strings are included in the array, they should be concatenated with a space.
200
+ */
201
+ content: string[];
202
+ }
203
+ /**
204
+ * A line break in a chapter.
205
+ */
206
+ export interface ChapterLineBreak {
207
+ /**
208
+ * Indicates that the content represents a line break.
209
+ */
210
+ type: 'line_break';
211
+ }
212
+ /**
213
+ * A Hebrew Subtitle in a chapter.
214
+ * These are often used included as informational content that appeared in the original manuscripts.
215
+ * For example, Psalms 49 has the Hebrew Subtitle "To the choirmaster. A Psalm of the Sons of Korah."
216
+ */
217
+ export interface ChapterHebrewSubtitle {
218
+ /**
219
+ * Indicates that the content represents a Hebrew Subtitle.
220
+ */
221
+ type: 'hebrew_subtitle';
222
+ /**
223
+ * The list of content that is contained in the subtitle.
224
+ * Each element in the list could be a string, formatted text, or a footnote reference.
225
+ */
226
+ content: (string | FormattedText | VerseFootnoteReference)[];
227
+ }
228
+ /**
229
+ * A verse in a chapter.
230
+ */
231
+ export interface ChapterVerse {
232
+ /**
233
+ * Indicates that the content is a verse.
234
+ */
235
+ type: 'verse';
236
+ /**
237
+ * The number of the verse.
238
+ */
239
+ number: number;
240
+ /**
241
+ * The list of content for the verse.
242
+ * Each element in the list could be a string, formatted text, or a footnote reference.
243
+ */
244
+ content: (string | FormattedText | InlineHeading | InlineLineBreak | VerseFootnoteReference)[];
245
+ }
246
+ /**
247
+ * Formatted text. That is, text that is formated in a particular manner.
248
+ */
249
+ export interface FormattedText {
250
+ /**
251
+ * The text that is formatted.
252
+ */
253
+ text: string;
254
+ /**
255
+ * Whether the text represents a poem.
256
+ * The number indicates the level of indent.
257
+ *
258
+ * Common in Psalms.
259
+ */
260
+ poem?: number;
261
+ /**
262
+ * Whether the text represents the Words of Jesus.
263
+ */
264
+ wordsOfJesus?: boolean;
265
+ }
266
+ /**
267
+ * Defines an interface that represents a heading that is embedded in a verse.
268
+ */
269
+ export interface InlineHeading {
270
+ /**
271
+ * The text of the heading.
272
+ */
273
+ heading: string;
274
+ }
275
+ /**
276
+ * Defines an interface that represents a line break that is embedded in a verse.
277
+ */
278
+ export interface InlineLineBreak {
279
+ lineBreak: true;
280
+ }
281
+ /**
282
+ * A footnote reference in a verse or a Hebrew Subtitle.
283
+ */
284
+ export interface VerseFootnoteReference {
285
+ /**
286
+ * The ID of the note.
287
+ */
288
+ noteId: number;
289
+ }
290
+ /**
291
+ * Information about a footnote.
292
+ */
293
+ export interface ChapterFootnote {
294
+ /**
295
+ * The ID of the note that is referenced.
296
+ */
297
+ noteId: number;
298
+ /**
299
+ * The text of the footnote.
300
+ */
301
+ text: string;
302
+ /**
303
+ * The verse reference for the footnote.
304
+ */
305
+ reference?: {
306
+ chapter: number;
307
+ verse: number;
308
+ };
309
+ /**
310
+ * The caller that should be used for the footnote.
311
+ * For footnotes, a "caller" is the character that is used in the text to reference to footnote.
312
+ *
313
+ * For example, in the text:
314
+ * Hello (a) World
315
+ *
316
+ * ----
317
+ * (a) This is a footnote.
318
+ *
319
+ * The "(a)" is the caller.
320
+ *
321
+ * If "+", then the caller should be autogenerated.
322
+ * If null, then the caller should be empty.
323
+ * If a string, then the caller should be that string.
324
+ */
325
+ caller: '+' | string | null;
326
+ }
327
+ //# sourceMappingURL=common-types.d.ts.map
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { InputFile, Translation, TranslationBook, TranslationBookChapter } from "./common-types";
2
+ /**
3
+ * Defines an interface that contains generated dataset info.
4
+ */
5
+ export interface DatasetOutput {
6
+ /**
7
+ * The list of translations that are available in the dataset.
8
+ */
9
+ translations: DatasetTranslation[];
10
+ }
11
+ /**
12
+ * Defines a translation that is used in the dataset.
13
+ */
14
+ export interface DatasetTranslation extends Translation {
15
+ /**
16
+ * The list of books that are available for the translation.
17
+ */
18
+ books: DatasetTranslationBook[];
19
+ }
20
+ /**
21
+ * Defines a translation book that is used in the dataset.
22
+ */
23
+ export interface DatasetTranslationBook extends TranslationBook {
24
+ /**
25
+ * The list of chapters that are available for the book.
26
+ */
27
+ chapters: TranslationBookChapter[];
28
+ }
29
+ /**
30
+ * Generates a list of output files from the given list of input files.
31
+ * @param file The list of files.
32
+ */
33
+ export declare function generateDataset(files: InputFile[], parser?: DOMParser): DatasetOutput;
34
+ //# sourceMappingURL=dataset.d.ts.map
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateDataset = generateDataset;
4
+ const parser_1 = require("../parser");
5
+ const usx_parser_1 = require("../parser/usx-parser");
6
+ const book_order_1 = require("./book-order");
7
+ const lodash_1 = require("lodash");
8
+ const audio_1 = require("./audio");
9
+ const codex_parser_1 = require("../parser/codex-parser");
10
+ /**
11
+ * Generates a list of output files from the given list of input files.
12
+ * @param file The list of files.
13
+ */
14
+ function generateDataset(files, parser = new globalThis.DOMParser()) {
15
+ let output = {
16
+ translations: [],
17
+ };
18
+ let usfmParser = new parser_1.UsfmParser();
19
+ let usxParser = new usx_parser_1.USXParser(parser);
20
+ let codexParser = new codex_parser_1.CodexParser();
21
+ let parsedTranslations = new Map();
22
+ const unknownLanguages = new Set();
23
+ for (let file of files) {
24
+ try {
25
+ let parser;
26
+ if (file.fileType === 'usfm') {
27
+ parser = usfmParser;
28
+ }
29
+ else if (file.fileType === 'usx') {
30
+ parser = usxParser;
31
+ }
32
+ else if (file.fileType === 'json') {
33
+ parser = codexParser;
34
+ }
35
+ else {
36
+ console.warn('[generate] File does not have a valid type!', file.name);
37
+ continue;
38
+ }
39
+ const parsed = parser.parse(file.content);
40
+ const id = parsed.id;
41
+ if (!id) {
42
+ console.warn('[generate] File does not have a valid book ID!', file.name, id);
43
+ continue;
44
+ }
45
+ const order = book_order_1.bookOrderMap.get(id);
46
+ if (typeof order !== 'number') {
47
+ console.warn('[generate] Book does not have an order!', id);
48
+ continue;
49
+ }
50
+ const bookMap = book_order_1.bookIdMap.get(file.metadata.translation.language);
51
+ if (!bookMap) {
52
+ if (!unknownLanguages.has(file.metadata.translation.language)) {
53
+ console.warn('[generate] File does not have a known language!', file.name, file.metadata.translation.language);
54
+ unknownLanguages.add(file.metadata.translation.language);
55
+ }
56
+ }
57
+ const bookName = bookMap?.get(id);
58
+ if (!!bookMap && !bookName) {
59
+ console.warn('[generate] Book name not found for ID!', file.name, id);
60
+ }
61
+ let translation = parsedTranslations.get(file.metadata.translation.id);
62
+ if (!translation) {
63
+ translation = {
64
+ ...(0, lodash_1.omit)(file.metadata.translation, 'direction'),
65
+ textDirection: file.metadata.translation.direction,
66
+ books: []
67
+ };
68
+ output.translations.push(translation);
69
+ parsedTranslations.set(file.metadata.translation.id, translation);
70
+ }
71
+ const name = parsed.header ?? bookName?.commonName ?? parsed.title;
72
+ if (!name) {
73
+ console.warn('[generate] Book does not have a name!', file.name, id);
74
+ continue;
75
+ }
76
+ const commonName = bookName?.commonName ?? parsed.header ?? parsed.title ?? id;
77
+ const book = {
78
+ id: id,
79
+ name,
80
+ commonName,
81
+ title: parsed.title ?? null,
82
+ order,
83
+ chapters: [],
84
+ };
85
+ for (let content of parsed.content) {
86
+ if (content.type === 'chapter') {
87
+ book.chapters.push({
88
+ chapter: {
89
+ number: content.number,
90
+ content: content.content,
91
+ footnotes: content.footnotes
92
+ },
93
+ thisChapterAudioLinks: (0, audio_1.getAudioUrlsForChapter)(translation.id, id, content.number)
94
+ });
95
+ }
96
+ }
97
+ book.chapters = (0, lodash_1.sortBy)(book.chapters, c => c.chapter.number);
98
+ const index = (0, lodash_1.sortedIndexBy)(translation.books, book, b => b.order);
99
+ translation.books.splice(index, 0, book);
100
+ }
101
+ catch (err) {
102
+ console.error(`[generate] Error occurred while parsing ${file.name}`, err);
103
+ }
104
+ }
105
+ return output;
106
+ }
@@ -0,0 +1,7 @@
1
+ import * as api from './api';
2
+ import * as audio from './audio';
3
+ import * as dataset from './dataset';
4
+ import * as bookOrder from './book-order';
5
+ export * from './common-types';
6
+ export { api, audio, dataset, bookOrder };
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.bookOrder = exports.dataset = exports.audio = exports.api = void 0;
30
+ const api = __importStar(require("./api"));
31
+ exports.api = api;
32
+ const audio = __importStar(require("./audio"));
33
+ exports.audio = audio;
34
+ const dataset = __importStar(require("./dataset"));
35
+ exports.dataset = dataset;
36
+ const bookOrder = __importStar(require("./book-order"));
37
+ exports.bookOrder = bookOrder;
38
+ __exportStar(require("./common-types"), exports);
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import * as utils from './utils';
2
+ import * as generation from './generation';
3
+ import * as parser from './parser';
4
+ export { utils, generation, parser, };
5
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.parser = exports.generation = exports.utils = void 0;
27
+ const utils = __importStar(require("./utils"));
28
+ exports.utils = utils;
29
+ const generation = __importStar(require("./generation"));
30
+ exports.generation = generation;
31
+ const parser = __importStar(require("./parser"));
32
+ exports.parser = parser;
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@helloao/tools",
3
+ "version": "0.0.1",
4
+ "description": "A set of tools for managing HelloAO's Free Bible API",
5
+ "module": "index.js",
6
+ "types": "index.d.ts",
7
+ "author": "Kallyn Gowdy <kal@helloao.org>",
8
+ "license": "MIT",
9
+ "dependencies": {
10
+ "lodash": "4.17.21",
11
+ "all-iso-language-codes": "1.0.17",
12
+ "zod": "^3.23.8"
13
+ },
14
+ "devDependencies": {
15
+ "linkedom": "0.18.4",
16
+ "hash.js": "1.1.7"
17
+ },
18
+ "files": [
19
+ "/README.md",
20
+ "/LICENSE.txt",
21
+ "/migrations/**/*.sql",
22
+ "**/*.js",
23
+ "**/*.js.map",
24
+ "**/*.d.ts"
25
+ ],
26
+ "scripts": {}
27
+ }
@@ -0,0 +1,97 @@
1
+ import { z } from 'zod';
2
+ import { ParseTree } from './types';
3
+ export declare const chapterHeadingSchema: z.ZodObject<{
4
+ type: z.ZodLiteral<"chapter-heading">;
5
+ data: z.ZodObject<{
6
+ chapter: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ chapter: number;
9
+ }, {
10
+ chapter: number;
11
+ }>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type: "chapter-heading";
14
+ data: {
15
+ chapter: number;
16
+ };
17
+ }, {
18
+ type: "chapter-heading";
19
+ data: {
20
+ chapter: number;
21
+ };
22
+ }>;
23
+ export declare const metadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
24
+ type: z.ZodLiteral<"chapter-heading">;
25
+ data: z.ZodObject<{
26
+ chapter: z.ZodNumber;
27
+ }, "strip", z.ZodTypeAny, {
28
+ chapter: number;
29
+ }, {
30
+ chapter: number;
31
+ }>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: "chapter-heading";
34
+ data: {
35
+ chapter: number;
36
+ };
37
+ }, {
38
+ type: "chapter-heading";
39
+ data: {
40
+ chapter: number;
41
+ };
42
+ }>]>;
43
+ export declare const codexSchema: z.ZodObject<{
44
+ cells: z.ZodArray<z.ZodObject<{
45
+ language: z.ZodString;
46
+ value: z.ZodString;
47
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
48
+ type: z.ZodString;
49
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
50
+ type: z.ZodString;
51
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
52
+ type: z.ZodString;
53
+ }, z.ZodTypeAny, "passthrough">>>>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ value: string;
56
+ language: string;
57
+ metadata?: z.objectOutputType<{
58
+ type: z.ZodString;
59
+ }, z.ZodTypeAny, "passthrough"> | null | undefined;
60
+ }, {
61
+ value: string;
62
+ language: string;
63
+ metadata?: z.objectInputType<{
64
+ type: z.ZodString;
65
+ }, z.ZodTypeAny, "passthrough"> | null | undefined;
66
+ }>, "many">;
67
+ }, "strip", z.ZodTypeAny, {
68
+ cells: {
69
+ value: string;
70
+ language: string;
71
+ metadata?: z.objectOutputType<{
72
+ type: z.ZodString;
73
+ }, z.ZodTypeAny, "passthrough"> | null | undefined;
74
+ }[];
75
+ }, {
76
+ cells: {
77
+ value: string;
78
+ language: string;
79
+ metadata?: z.objectInputType<{
80
+ type: z.ZodString;
81
+ }, z.ZodTypeAny, "passthrough"> | null | undefined;
82
+ }[];
83
+ }>;
84
+ /**
85
+ * Defines a parser for codex files.
86
+ */
87
+ export declare class CodexParser {
88
+ private _noteCounter;
89
+ /**
90
+ * Parses the specified USX content.
91
+ *
92
+ * @param usx The USX content to parse.
93
+ * @returns The parse tree that was generated.
94
+ */
95
+ parse(codex: string): ParseTree;
96
+ }
97
+ //# sourceMappingURL=codex-parser.d.ts.map