@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,35 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.iterators = void 0;
30
+ __exportStar(require("./types"), exports);
31
+ __exportStar(require("./usfm-parser"), exports);
32
+ __exportStar(require("./usx-parser"), exports);
33
+ __exportStar(require("./codex-parser"), exports);
34
+ const iterators = __importStar(require("./iterators"));
35
+ exports.iterators = iterators;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Defines an interface that represents an iterator that can be rewound.
3
+ */
4
+ export interface RewindableIterator<T> extends IterableIterator<T> {
5
+ /**
6
+ * Rewinds the iterator by the specified number of elements.
7
+ * @param number The number of elements to rewind.
8
+ */
9
+ rewind(number: number): void;
10
+ }
11
+ /**
12
+ * Defines a class that implements an iterator that can be rewound.
13
+ */
14
+ export declare class Rewindable<T> implements RewindableIterator<T> {
15
+ buffer: T[];
16
+ private _bufferSize;
17
+ private _position;
18
+ private _iterator;
19
+ constructor(iterator: IterableIterator<T>, bufferSize?: number);
20
+ rewind(number: number): void;
21
+ [Symbol.iterator](): IterableIterator<T>;
22
+ next(...args: [] | [undefined]): IteratorResult<T, any>;
23
+ return?(value?: any): IteratorResult<T, any>;
24
+ throw?(e?: any): IteratorResult<T, any>;
25
+ }
26
+ export declare function debug(label: string, iterator: IterableIterator<any>): Generator<any, void, unknown>;
27
+ /**
28
+ * Creates a new rewindable iterator from the given iterator.
29
+ * @param iterator The iterator.
30
+ * @param bufferSize The size of the buffer.
31
+ */
32
+ export declare function rewindable<T>(iterator: IterableIterator<T>, bufferSize?: number): Rewindable<T>;
33
+ /**
34
+ * Gets the char element that is the parent of the given node.
35
+ * @param node The node.
36
+ */
37
+ export declare function parentChar(node: Node): Element | null;
38
+ /**
39
+ * Gets the note element that is the parent of the given node.
40
+ * @param node The node.
41
+ */
42
+ export declare function parentNote(node: Node): Element | null;
43
+ /**
44
+ * Gets the parent node that matches the given filter.
45
+ * @param node The node to start the search from.
46
+ * @param filter The filter that should be used.
47
+ */
48
+ export declare function matchingParent(node: Node, filter: (node: Node) => boolean): Node | null;
49
+ /**
50
+ * Determines if the given node is a child of the parent node.
51
+ * @param node The node to test.
52
+ * @param parent The parent.
53
+ * @returns
54
+ */
55
+ export declare function isParent(node: Node, parent: Node): boolean;
56
+ /**
57
+ * Iterates through all of the nodes in the tree in a depth-first traversal.
58
+ * @param node The node to start the traversal from.
59
+ */
60
+ export declare function iterateAll(node: Node): RewindableIterator<Node>;
61
+ export declare function iterateUntil<T>(iterator: IterableIterator<T>, predicate: (value: T) => boolean): IterableIterator<T>;
62
+ /**
63
+ * Iterates only the elements in the iterator.
64
+ * @param iterator The iterator that should be used.
65
+ */
66
+ export declare function elements(iterator: IterableIterator<Node>): IterableIterator<Element>;
67
+ /**
68
+ * Iterates only the children of the given node in the iterator.
69
+ * @param iterator The iterator that should be used.
70
+ * @param parent The parent node.
71
+ */
72
+ export declare function children(iterator: RewindableIterator<Node>, parent: Node): IterableIterator<Node>;
73
+ /**
74
+ * Wraps the given iterable in a generator that will prevent consumers from calling return() on the iterator.
75
+ * @param iterable The iterable.
76
+ */
77
+ export declare function uncompletable<T>(iterable: IterableIterator<T>): IterableIterator<T>;
78
+ /**
79
+ * Converts the given iterable into an async iterable.
80
+ * @param input The input iterable.
81
+ */
82
+ export declare function toAsyncIterable<T>(input: Iterable<T>): AsyncIterable<T>;
83
+ /**
84
+ * Batches items from the given iterator.
85
+ * @param input The input iterator.
86
+ * @param batchSize The size of each batch.
87
+ */
88
+ export declare function batch<T>(input: Iterable<T>, batchSize: number): Iterable<T[]>;
89
+ //# sourceMappingURL=iterators.d.ts.map
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Rewindable = void 0;
4
+ exports.debug = debug;
5
+ exports.rewindable = rewindable;
6
+ exports.parentChar = parentChar;
7
+ exports.parentNote = parentNote;
8
+ exports.matchingParent = matchingParent;
9
+ exports.isParent = isParent;
10
+ exports.iterateAll = iterateAll;
11
+ exports.iterateUntil = iterateUntil;
12
+ exports.elements = elements;
13
+ exports.children = children;
14
+ exports.uncompletable = uncompletable;
15
+ exports.toAsyncIterable = toAsyncIterable;
16
+ exports.batch = batch;
17
+ /**
18
+ * Defines a class that implements an iterator that can be rewound.
19
+ */
20
+ class Rewindable {
21
+ buffer = [];
22
+ _bufferSize = 0;
23
+ _position = -1;
24
+ _iterator;
25
+ constructor(iterator, bufferSize = 2) {
26
+ this._iterator = iterator;
27
+ this._bufferSize = bufferSize;
28
+ if (this._iterator.return) {
29
+ this.return = (value) => {
30
+ return this._iterator.return(value);
31
+ };
32
+ }
33
+ if (this._iterator.throw) {
34
+ this.throw = (value) => {
35
+ return this._iterator.throw(value);
36
+ };
37
+ }
38
+ }
39
+ rewind(number) {
40
+ this._position += number;
41
+ }
42
+ [Symbol.iterator]() {
43
+ return this;
44
+ }
45
+ next(...args) {
46
+ if (this._position >= 0) {
47
+ let item = this.buffer[this._position];
48
+ this._position--;
49
+ return {
50
+ value: item,
51
+ done: false
52
+ };
53
+ }
54
+ let result = this._iterator.next(...args);
55
+ this.buffer.unshift(result.value);
56
+ if (this.buffer.length > this._bufferSize) {
57
+ this.buffer.splice(this._bufferSize, this.buffer.length - this._bufferSize);
58
+ }
59
+ return result;
60
+ }
61
+ }
62
+ exports.Rewindable = Rewindable;
63
+ function* debug(label, iterator) {
64
+ for (let value of uncompletable(iterator)) {
65
+ if (value instanceof Element) {
66
+ console.log(label, value.outerHTML);
67
+ }
68
+ else if (value instanceof Node) {
69
+ console.log(label, value.textContent);
70
+ }
71
+ else {
72
+ console.log(label, value);
73
+ }
74
+ yield value;
75
+ }
76
+ }
77
+ /**
78
+ * Creates a new rewindable iterator from the given iterator.
79
+ * @param iterator The iterator.
80
+ * @param bufferSize The size of the buffer.
81
+ */
82
+ function rewindable(iterator, bufferSize = 2) {
83
+ return new Rewindable(iterator, bufferSize);
84
+ }
85
+ function* iterateNodes(node) {
86
+ for (let i = 0; i < node.childNodes.length; i++) {
87
+ yield node.childNodes[i];
88
+ }
89
+ }
90
+ /**
91
+ * Gets the char element that is the parent of the given node.
92
+ * @param node The node.
93
+ */
94
+ function parentChar(node) {
95
+ return matchingParent(node, n => n instanceof Element && n.nodeName === 'char');
96
+ }
97
+ /**
98
+ * Gets the note element that is the parent of the given node.
99
+ * @param node The node.
100
+ */
101
+ function parentNote(node) {
102
+ return matchingParent(node, n => n instanceof Element && n.nodeName === 'note');
103
+ }
104
+ /**
105
+ * Gets the parent node that matches the given filter.
106
+ * @param node The node to start the search from.
107
+ * @param filter The filter that should be used.
108
+ */
109
+ function matchingParent(node, filter) {
110
+ let parent = node.parentNode;
111
+ while (parent) {
112
+ if (filter(parent)) {
113
+ return parent;
114
+ }
115
+ parent = parent.parentNode;
116
+ }
117
+ return null;
118
+ }
119
+ /**
120
+ * Determines if the given node is a child of the parent node.
121
+ * @param node The node to test.
122
+ * @param parent The parent.
123
+ * @returns
124
+ */
125
+ function isParent(node, parent) {
126
+ let parentNode = node.parentNode;
127
+ while (parentNode) {
128
+ if (parentNode === parent) {
129
+ return true;
130
+ }
131
+ parentNode = parentNode.parentNode;
132
+ }
133
+ return false;
134
+ }
135
+ /**
136
+ * Iterates through all of the nodes in the tree in a depth-first traversal.
137
+ * @param node The node to start the traversal from.
138
+ */
139
+ function iterateAll(node) {
140
+ return rewindable(_iterateAll(node));
141
+ }
142
+ function* iterateUntil(iterator, predicate) {
143
+ for (let value of iterator) {
144
+ if (predicate(value)) {
145
+ return;
146
+ }
147
+ yield value;
148
+ }
149
+ }
150
+ function* _iterateAll(node) {
151
+ for (let child of node.childNodes) {
152
+ yield child;
153
+ yield* iterateAll(child);
154
+ }
155
+ }
156
+ /**
157
+ * Iterates only the elements in the iterator.
158
+ * @param iterator The iterator that should be used.
159
+ */
160
+ function* elements(iterator) {
161
+ for (let node of uncompletable(iterator)) {
162
+ if (node instanceof Element) {
163
+ yield node;
164
+ }
165
+ }
166
+ }
167
+ /**
168
+ * Iterates only the children of the given node in the iterator.
169
+ * @param iterator The iterator that should be used.
170
+ * @param parent The parent node.
171
+ */
172
+ function* children(iterator, parent) {
173
+ for (let node of uncompletable(iterator)) {
174
+ if (!isParent(node, parent)) {
175
+ iterator.rewind(1);
176
+ return;
177
+ }
178
+ yield node;
179
+ }
180
+ }
181
+ /**
182
+ * Wraps the given iterable in a generator that will prevent consumers from calling return() on the iterator.
183
+ * @param iterable The iterable.
184
+ */
185
+ function* uncompletable(iterable) {
186
+ while (true) {
187
+ const { done, value } = iterable.next();
188
+ if (done) {
189
+ return;
190
+ }
191
+ yield value;
192
+ }
193
+ }
194
+ /**
195
+ * Converts the given iterable into an async iterable.
196
+ * @param input The input iterable.
197
+ */
198
+ async function* toAsyncIterable(input) {
199
+ for (let item of input) {
200
+ yield item;
201
+ }
202
+ }
203
+ /**
204
+ * Batches items from the given iterator.
205
+ * @param input The input iterator.
206
+ * @param batchSize The size of each batch.
207
+ */
208
+ function* batch(input, batchSize) {
209
+ while (true) {
210
+ let batch = [];
211
+ for (let item of input) {
212
+ batch.push(item);
213
+ if (batch.length >= batchSize) {
214
+ break;
215
+ }
216
+ }
217
+ if (batch.length === 0) {
218
+ return;
219
+ }
220
+ yield batch;
221
+ }
222
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=iterators.spec.d.ts.map
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const linkedom_1 = require("linkedom");
4
+ const iterators_1 = require("./iterators");
5
+ describe('iterators', () => {
6
+ let dom;
7
+ beforeEach(() => {
8
+ dom = new linkedom_1.DOMParser();
9
+ });
10
+ describe('iterateAll()', () => {
11
+ it('should iterate through all nodes', () => {
12
+ const html = `
13
+ <div id="0">
14
+ <div id="1">
15
+ <div id="2">abc</div>
16
+ <div id="3">def</div>
17
+ </div>
18
+ <div id="4">
19
+ <div id="5">ghi</div>
20
+ <div id="6">jfk</div>
21
+ </div>
22
+ <div id="7">
23
+ <div id="8">lmn</div>
24
+ <div id="9">opq</div>
25
+ </div>
26
+ </div>
27
+ `;
28
+ const tree = dom.parseFromString(html, 'text/html');
29
+ const node = tree.getElementById('0');
30
+ const iterator = (0, iterators_1.iterateAll)(node);
31
+ expect(iterator).toBeInstanceOf(iterators_1.Rewindable);
32
+ const nodes = [
33
+ ...iterator
34
+ ];
35
+ expect(mapNodes(nodes)).toEqual([
36
+ "#space",
37
+ "1",
38
+ "#space",
39
+ "2",
40
+ "abc",
41
+ "#space",
42
+ "3",
43
+ "def",
44
+ "#space",
45
+ "#space",
46
+ "4",
47
+ "#space",
48
+ "5",
49
+ "ghi",
50
+ "#space",
51
+ "6",
52
+ "jfk",
53
+ "#space",
54
+ "#space",
55
+ "7",
56
+ "#space",
57
+ "8",
58
+ "lmn",
59
+ "#space",
60
+ "9",
61
+ "opq",
62
+ "#space",
63
+ "#space",
64
+ ]);
65
+ });
66
+ });
67
+ describe('children()', () => {
68
+ it('should iterate through all children', () => {
69
+ const html = `
70
+ <div id="0">
71
+ <div id="1">
72
+ <div id="2">abc</div>
73
+ <div id="3">def</div>
74
+ </div>
75
+ <div id="4">
76
+ <div id="5">ghi</div>
77
+ <div id="6">jfk</div>
78
+ </div>
79
+ <div id="7">
80
+ <div id="8">lmn</div>
81
+ <div id="9">opq</div>
82
+ </div>
83
+ </div>
84
+ `;
85
+ const tree = dom.parseFromString(html, 'text/html');
86
+ const root = tree.getElementById('0');
87
+ const node = tree.getElementById('1');
88
+ const iterator = (0, iterators_1.iterateAll)(root);
89
+ for (let node of (0, iterators_1.uncompletable)(iterator)) {
90
+ if (node instanceof linkedom_1.Element && node.id === '1') {
91
+ break;
92
+ }
93
+ }
94
+ const nodes = [
95
+ ...(0, iterators_1.children)(iterator, node)
96
+ ];
97
+ expect(mapNodes(nodes)).toEqual(['#space', '2', 'abc', '#space', '3', 'def', '#space']);
98
+ });
99
+ it('should not exhaust the iterator', () => {
100
+ const html = `
101
+ <div id="0">
102
+ <div id="1">
103
+ <div id="2">abc</div>
104
+ <div id="3">def</div>
105
+ </div>
106
+ <div id="4">
107
+ <div id="5">ghi</div>
108
+ <div id="6">jfk</div>
109
+ </div>
110
+ <div id="7">
111
+ <div id="8">lmn</div>
112
+ <div id="9">opq</div>
113
+ </div>
114
+ </div>
115
+ `;
116
+ const tree = dom.parseFromString(html, 'text/html');
117
+ const root = tree.getElementById('0');
118
+ const node = tree.getElementById('1');
119
+ let iterator = (0, iterators_1.iterateAll)(root);
120
+ for (let node of (0, iterators_1.uncompletable)(iterator)) {
121
+ if (node instanceof linkedom_1.Element && node.id === '1') {
122
+ break;
123
+ }
124
+ }
125
+ const nodes = [
126
+ ...(0, iterators_1.children)(iterator, node)
127
+ ];
128
+ expect(mapNodes(nodes)).toEqual(['#space', '2', 'abc', '#space', '3', 'def', '#space']);
129
+ const remaining = [
130
+ ...iterator
131
+ ];
132
+ expect(mapNodes(remaining)).toEqual(['#space', '4', '#space', '5', 'ghi', '#space', '6', 'jfk', '#space', '#space', '7', '#space', '8', 'lmn', '#space', '9', 'opq', '#space', '#space']);
133
+ });
134
+ });
135
+ describe('rewindable()', () => {
136
+ it('should be able to rewind the iterator', () => {
137
+ function* gen() {
138
+ yield 1;
139
+ yield 2;
140
+ yield 3;
141
+ }
142
+ const iterator = (0, iterators_1.rewindable)(gen());
143
+ const { value: value1 } = iterator.next();
144
+ const { value: value2 } = iterator.next();
145
+ const { value: value3 } = iterator.next();
146
+ iterator.rewind(1);
147
+ const { value: value4 } = iterator.next();
148
+ const { value: value5 } = iterator.next();
149
+ expect(value1).toBe(1);
150
+ expect(value2).toBe(2);
151
+ expect(value3).toBe(3);
152
+ expect(value4).toBe(3);
153
+ expect(value5).toBeUndefined();
154
+ });
155
+ });
156
+ function mapNodes(nodes) {
157
+ return nodes.map(node => {
158
+ if (node.nodeType === linkedom_1.Node.TEXT_NODE) {
159
+ if (/\s/.test(node.textContent)) {
160
+ return '#space';
161
+ }
162
+ else {
163
+ return node.textContent;
164
+ }
165
+ }
166
+ else if (node.nodeType === linkedom_1.Node.ELEMENT_NODE) {
167
+ return node.getAttribute('id');
168
+ }
169
+ else {
170
+ return 'unknown';
171
+ }
172
+ });
173
+ }
174
+ });
@@ -0,0 +1,144 @@
1
+ /**
2
+ * The parse tree that is gathered.
3
+ */
4
+ export interface ParseTree {
5
+ type: 'root';
6
+ /**
7
+ * The ID of the parse tree.
8
+ */
9
+ id?: string;
10
+ /**
11
+ * The header that was associated with the tree.
12
+ */
13
+ header?: string;
14
+ /**
15
+ * The major title that was associated with the tree.
16
+ */
17
+ title?: string;
18
+ /**
19
+ * The list of chapters for the tree.
20
+ */
21
+ content: (Heading | Chapter)[];
22
+ }
23
+ export interface Heading {
24
+ type: 'heading';
25
+ content: string[];
26
+ }
27
+ export type ChapterContent = (Heading | Verse | HebrewSubtitle | LineBreak);
28
+ export type VerseContent = string | FootnoteReference | Text;
29
+ /**
30
+ * Defines an interface that represents a chapter.
31
+ */
32
+ export interface Chapter {
33
+ type: 'chapter';
34
+ number: number;
35
+ /**
36
+ * The contents of the chapter.
37
+ */
38
+ content: ChapterContent[];
39
+ /**
40
+ * The list of footnotes for the chapter.
41
+ */
42
+ footnotes: Footnote[];
43
+ }
44
+ /**
45
+ * Defines an interface that represents a hebrew subtitle.
46
+ */
47
+ export interface HebrewSubtitle {
48
+ type: 'hebrew_subtitle';
49
+ /**
50
+ * The contents of the subtitle.
51
+ */
52
+ content: (string | Text | FootnoteReference)[];
53
+ }
54
+ /**
55
+ * Defines an interface that represents a verse.
56
+ */
57
+ export interface Verse {
58
+ type: 'verse';
59
+ number: number;
60
+ /**
61
+ * The contents of the verse.
62
+ */
63
+ content: (string | Text | InlineHeading | InlineLineBreak | FootnoteReference)[];
64
+ }
65
+ /**
66
+ * Defines an interface that represents text that has some markup attributes applied to it.
67
+ */
68
+ export interface Text {
69
+ /**
70
+ * The text that is contained.
71
+ */
72
+ text: string;
73
+ /**
74
+ * Whether the text represents a poem.
75
+ * The number indicates the level of indent.
76
+ */
77
+ poem?: number;
78
+ /**
79
+ * Whether the text contains the words of Jesus.
80
+ */
81
+ wordsOfJesus?: boolean;
82
+ /**
83
+ * Whether the text is descriptive.
84
+ *
85
+ * This is only used for "hebrew subtitles" that are included inside the verse markers.
86
+ */
87
+ descriptive?: boolean;
88
+ }
89
+ /**
90
+ * Defines an interface that represents a heading that is embedded in a verse.
91
+ */
92
+ export interface InlineHeading {
93
+ /**
94
+ * The text of the heading.
95
+ */
96
+ heading: string;
97
+ }
98
+ /**
99
+ * Defines an interface that represents a line break that is embedded in a verse.
100
+ */
101
+ export interface InlineLineBreak {
102
+ lineBreak: true;
103
+ }
104
+ export interface FootnoteReference {
105
+ /**
106
+ * The ID of the note that is referenced.
107
+ */
108
+ noteId: number;
109
+ }
110
+ export interface Footnote {
111
+ noteId: number;
112
+ /**
113
+ * The text of the footnote.
114
+ */
115
+ text: string;
116
+ /**
117
+ * The caller that should be used for the footnote.
118
+ * For footnotes, a "caller" is the character that is used in the text to reference to footnote.
119
+ *
120
+ * For example, in the text:
121
+ * Hello (a) World
122
+ *
123
+ * ----
124
+ * (a) This is a footnote.
125
+ *
126
+ * The "(a)" is the caller.
127
+ *
128
+ * If "+", then the caller should be autogenerated.
129
+ * If null, then the caller should be empty.
130
+ * If a string, then the caller should be that string.
131
+ */
132
+ caller: '+' | string | null;
133
+ /**
134
+ * The verse reference for the footnote.
135
+ */
136
+ reference?: {
137
+ chapter: number;
138
+ verse: number;
139
+ };
140
+ }
141
+ export interface LineBreak {
142
+ type: 'line_break';
143
+ }
144
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });