free-use-bible-api 0.2.0 → 0.3.0
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/README.md +253 -170
- package/dist/cjs/FreeUseBibleApi.cjs +205 -2
- package/dist/cjs/FreeUseBibleApi.cjs.map +2 -2
- package/dist/cjs/types.gen.cjs.map +1 -1
- package/dist/esm/FreeUseBibleApi.js +205 -2
- package/dist/esm/FreeUseBibleApi.js.map +2 -2
- package/dist/types/FreeUseBibleApi.d.ts +162 -1
- package/dist/types/types.gen.d.ts +912 -37
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../FreeUseBibleApi.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\r\n ApiAvailableDatasets,\r\n ApiAvailableTranslations,\r\n ApiCommentaryBook,\r\n ApiCommentaryBookChapter,\r\n ApiDatasetBook,\r\n ApiDatasetBookChapter,\r\n ApiDatasetBooks,\r\n ApiTranslationBook,\r\n ApiTranslationBookChapter,\r\n ApiTranslationBooks,\r\n ApiTranslationComplete,\r\n ChapterVerse,\r\n TranslationChapterReference,\r\n} from './types.gen.js';\r\n\r\n/**\r\n * Options for the FreeUseBibleApi class.\r\n */\r\nexport interface FreeUseBibleApiOptions {\r\n /**\r\n * The API endpoint to use for the requests. If not provided, the default endpoint will be used.\r\n */\r\n endpoint?: string;\r\n\r\n /**\r\n * Whether to cache responses in memory.\r\n *\r\n * Defaults to `true`.\r\n */\r\n useCache?: boolean;\r\n}\r\n\r\n/**\r\n * Options for the `getChapterText` method.\r\n */\r\nexport interface GetChapterTextOptions {\r\n /**\r\n * Whether to omit verse numbers from the returned text.\r\n * Defaults to `false`.\r\n */\r\n omitVerseNumbers?: boolean;\r\n\r\n /**\r\n * Whether to omit the chapter reference from the returned text.\r\n */\r\n omitReference?: boolean;\r\n}\r\n\r\n/**\r\n * Options for the `getVerseText` method.\r\n */\r\nexport interface GetVerseTextOptions {\r\n /**\r\n * Whether to omit the chapter reference from the returned text.\r\n */\r\n omitReference?: boolean;\r\n}\r\n\r\n/**\r\n * A reference to a specific verse in a Bible translation, commentary, or dataset.\r\n */\r\nexport interface VerseReference {\r\n /**\r\n * The chapter number of the reference. This should be a positive integer.\r\n */\r\n chapter: number;\r\n\r\n /**\r\n * The verse number of the reference.\r\n *\r\n * If omitted, then the reference refers to the entire chapter rather than a specific verse.\r\n */\r\n verse?: number;\r\n\r\n /**\r\n * The ending verse number of the reference, for references that span multiple verses. This should be greater than or equal to the `verse` property if it is provided.\r\n */\r\n endVerse?: number;\r\n\r\n /**\r\n * The ending chapter number of the reference, for references that span multiple chapters. This should be greater than or equal to the `chapter` property if it is provided.\r\n */\r\n endChapter?: number;\r\n}\r\n\r\n/**\r\n * A client for interacting with the [Free Use Bible API](https://bible.helloao.org/).\r\n *\r\n * This API provides access to a large collection of Bible translations, commentaries, and datasets that are free to use.\r\n */\r\nexport class FreeUseBibleApi {\r\n endpoint: string = 'https://bible.helloao.org/';\r\n private _responseCache = new Map<string, Promise<unknown>>();\r\n private _useCache: boolean = true;\r\n\r\n constructor(options?: FreeUseBibleApiOptions) {\r\n this.endpoint = options?.endpoint ?? this.endpoint;\r\n this._useCache = options?.useCache ?? this._useCache;\r\n }\r\n\r\n /**\r\n * Gets the list of available Bible translations from the API.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getAvailableTranslations(\r\n endpoint?: string\r\n ): Promise<ApiAvailableTranslations> {\r\n return this._getJson<ApiAvailableTranslations>(\r\n 'api/available_translations.json',\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the complete content of a specific Bible translation.\r\n *\r\n * The results of this endpoint are very large, so the response is not cached.\r\n * @param translation The ID of the translation to get the complete content for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getCompleteTranslation(\r\n translation: string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationComplete> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n return this._getJson<ApiTranslationComplete>(\r\n `api/${encodedTranslation}/complete.json`,\r\n endpoint,\r\n false\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of available Bible commentaries from the API.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getAvailableCommentaries(\r\n endpoint?: string\r\n ): Promise<ApiAvailableTranslations> {\r\n return this._getJson<ApiAvailableTranslations>(\r\n 'api/available_commentaries.json',\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of available datasets from the API.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getAvailableDatasets(\r\n endpoint?: string\r\n ): Promise<ApiAvailableDatasets> {\r\n return this._getJson<ApiAvailableDatasets>(\r\n 'api/available_datasets.json',\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of books for a given Bible translation.\r\n * @param translation The ID of the translation to get the books for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getTranslationBooks(\r\n translation: string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBooks> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n return this._getJson<ApiTranslationBooks>(\r\n `api/${encodedTranslation}/books.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of books for a given Bible commentary.\r\n * @param commentary The ID of the commentary to get the books for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getCommentaryBooks(\r\n commentary: string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBooks> {\r\n const encodedCommentary = encodeURIComponent(commentary);\r\n return this._getJson<ApiTranslationBooks>(\r\n `api/${encodedCommentary}/books.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of books for a given dataset.\r\n * @param dataset The ID of the dataset to get the books for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getDatasetBooks(\r\n dataset: string,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBooks> {\r\n const encodedDataset = encodeURIComponent(dataset);\r\n return this._getJson<ApiDatasetBooks>(\r\n `api/d/${encodedDataset}/books.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific Bible translation.\r\n * @param translation The ID of the translation to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getTranslationBookChapter(\r\n translation: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiTranslationBookChapter>(\r\n `api/${encodedTranslation}/${encodedBook}/${encodedChapter}.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific Bible commentary.\r\n * @param commentary The ID of the commentary to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getCommentaryBookChapter(\r\n commentary: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter> {\r\n const encodedCommentary = encodeURIComponent(commentary);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiTranslationBookChapter>(\r\n `api/${encodedCommentary}/${encodedBook}/${encodedChapter}.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific dataset.\r\n * @param dataset The ID of the dataset to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getDatasetBookChapter(\r\n dataset: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter> {\r\n const encodedDataset = encodeURIComponent(dataset);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiDatasetBookChapter>(\r\n `api/d/${encodedDataset}/${encodedBook}/${encodedChapter}.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter | null>;\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiDatasetBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter | null>;\r\n async getNextChapter(\r\n chapter:\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | null\r\n > {\r\n if (!chapter.nextChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n >(chapter.nextChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter | null>;\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiDatasetBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter | null>;\r\n async getPreviousChapter(\r\n chapter:\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | null\r\n > {\r\n if (!chapter.previousChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n >(chapter.previousChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the first chapter for a given book, if available.\r\n * @param book The book to get the first chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The first chapter, or null if there is no first chapter.\r\n */\r\n getFirstChapter(\r\n book: ApiCommentaryBook,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the first chapter for a given book, if available.\r\n * @param book The book to get the first chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The first chapter, or null if there is no first chapter.\r\n */\r\n getFirstChapter(\r\n book: ApiTranslationBook,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter>;\r\n /**\r\n * Gets the first chapter for a given book, if available.\r\n * @param book The book to get the first chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The first chapter, or null if there is no first chapter.\r\n */\r\n getFirstChapter(\r\n book: ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter>;\r\n async getFirstChapter(\r\n book: ApiTranslationBook | ApiCommentaryBook | ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | null\r\n > {\r\n if (!book.firstChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n >(book.firstChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the last chapter for a given book, if available.\r\n * @param book The book to get the last chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The last chapter, or null if there is no last chapter.\r\n */\r\n getLastChapter(\r\n book: ApiCommentaryBook,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the last chapter for a given book, if available.\r\n * @param book The book to get the last chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The last chapter, or null if there is no last chapter.\r\n */\r\n getLastChapter(\r\n book: ApiTranslationBook,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter>;\r\n /**\r\n * Gets the last chapter for a given book, if available.\r\n * @param book The book to get the last chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The last chapter, or null if there is no last chapter.\r\n */\r\n getLastChapter(\r\n book: ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter>;\r\n async getLastChapter(\r\n book: ApiTranslationBook | ApiCommentaryBook | ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | null\r\n > {\r\n if (!book.lastChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n >(book.lastChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Formats a verse reference as a human-readable string.\r\n *\r\n * e.g. Genesis 1:1-2, John 3:16, Exodus 20-22, etc.\r\n *\r\n * @param book The book that the reference is for.\r\n * @param reference The reference to format.\r\n */\r\n formatReference(\r\n book: ApiTranslationBook,\r\n reference: VerseReference\r\n ): string {\r\n const bookName = book.name;\r\n const chapter = reference.chapter;\r\n const verse = reference.verse;\r\n const endChapter = reference.endChapter;\r\n const endVerse = reference.endVerse;\r\n\r\n let referenceStr = `${bookName} ${chapter}`;\r\n if (endChapter) {\r\n referenceStr += `-${endChapter}`;\r\n } else if (verse) {\r\n referenceStr += `:${verse}`;\r\n if (endVerse) {\r\n referenceStr += `-${endVerse}`;\r\n }\r\n }\r\n return referenceStr;\r\n }\r\n\r\n /**\r\n * Gets the text for a verse.\r\n * @param verse The verse to get the text for.\r\n * @param options Options for getting the verse text.\r\n */\r\n getVerseText(verse: ChapterVerse): string {\r\n let content = '';\r\n for (let part of verse.content) {\r\n if (typeof part === 'string') {\r\n content += part;\r\n } else if (typeof part === 'object' && 'text' in part) {\r\n if (part.poem) {\r\n content += '\\n';\r\n for (let i = 0; i < part.poem; i++) {\r\n content += '\\t';\r\n }\r\n }\r\n content += part.text;\r\n } else if (typeof part === 'object' && 'lineBreak' in part) {\r\n content += '\\n';\r\n } else if (typeof part === 'object') {\r\n content += ' ';\r\n }\r\n }\r\n return content.trim();\r\n }\r\n\r\n /**\r\n * Gets the verse text for the given chapter.\r\n * By default, the returned text includes markers for verse numbers and a reference to the chapter, but these can be omitted by passing options to the `options` parameter.\r\n * @param chapter The chapter to get the text for.\r\n * @param options Options for getting the chapter text.\r\n */\r\n getChapterVerseText(\r\n chapter: ApiTranslationBookChapter,\r\n options: GetChapterTextOptions = {}\r\n ): string {\r\n let content = '';\r\n for (let chapterContent of chapter.chapter.content) {\r\n if (chapterContent.type === 'verse') {\r\n if (!options.omitVerseNumbers) {\r\n content += `[${chapterContent.number}] `;\r\n }\r\n content += this.getVerseText(chapterContent) + ' ';\r\n } else if (chapterContent.type === 'line_break') {\r\n content = content.trim() + '\\n';\r\n }\r\n }\r\n\r\n if (!options.omitReference) {\r\n content = `${this.formatReference(chapter.book, {\r\n chapter: chapter.chapter.number,\r\n })}\\n${content.trim()}`;\r\n }\r\n\r\n return content.trim();\r\n }\r\n\r\n private _getJson<T>(\r\n path: string,\r\n endpoint: string | undefined,\r\n useCache: boolean = true\r\n ): Promise<T> {\r\n const url = this._buildUrl(path, endpoint);\r\n const existing = this._responseCache.get(url) as Promise<T> | undefined;\r\n if (existing) {\r\n return existing;\r\n }\r\n\r\n const request: Promise<T> = fetch(url)\r\n .then(async (response) => {\r\n if (response.status < 200 || response.status >= 300) {\r\n throw new Error(\r\n `Failed request to ${url}. Status: ${response.status} ${response.statusText}`\r\n );\r\n }\r\n return await response.json();\r\n })\r\n .catch((error) => {\r\n this._responseCache.delete(url);\r\n throw error;\r\n });\r\n\r\n if (this._useCache && useCache) {\r\n this._responseCache.set(url, request);\r\n }\r\n return request;\r\n }\r\n\r\n private _buildUrl(path: string, endpoint?: string): string {\r\n if (/^https?:\\/\\//i.test(path)) {\r\n return path;\r\n }\r\n\r\n const baseEndpoint = endpoint ?? this.endpoint;\r\n return new URL(path, baseEndpoint).href;\r\n }\r\n}\r\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import type {\r\n ApiAvailableDatasets,\r\n ApiAvailableTranslations,\r\n ApiCommentaryBook,\r\n ApiCommentaryBookChapter,\r\n ApiDatasetBook,\r\n ApiDatasetBookChapter,\r\n ApiDatasetBooks,\r\n ApiSimpleCommentaryBookChapter,\r\n ApiSimpleTranslationBookChapter,\r\n ApiSimpleTranslationBookChapterWords,\r\n ApiSimpleTranslationComplete,\r\n ApiTranslationBook,\r\n ApiTranslationBookChapter,\r\n ApiTranslationBookChapterWords,\r\n ApiTranslationBooks,\r\n ApiTranslationComplete,\r\n ChapterVerse,\r\n ChapterWord,\r\n SimpleChapterVerse,\r\n SimpleChapterWord,\r\n TranslationChapterReference,\r\n} from './types.gen.js';\r\n\r\n/**\r\n * Options for the FreeUseBibleApi class.\r\n */\r\nexport interface FreeUseBibleApiOptions {\r\n /**\r\n * The API endpoint to use for the requests. If not provided, the default endpoint will be used.\r\n */\r\n endpoint?: string;\r\n\r\n /**\r\n * Whether to cache responses in memory.\r\n *\r\n * Defaults to `true`.\r\n */\r\n useCache?: boolean;\r\n}\r\n\r\n/**\r\n * Options for the `getChapterText` method.\r\n */\r\nexport interface GetChapterTextOptions {\r\n /**\r\n * Whether to omit verse numbers from the returned text.\r\n * Defaults to `false`.\r\n */\r\n omitVerseNumbers?: boolean;\r\n\r\n /**\r\n * Whether to omit the chapter reference from the returned text.\r\n */\r\n omitReference?: boolean;\r\n}\r\n\r\n/**\r\n * Options for the `getVerseText` method.\r\n */\r\nexport interface GetVerseTextOptions {\r\n /**\r\n * Whether to omit the chapter reference from the returned text.\r\n */\r\n omitReference?: boolean;\r\n}\r\n\r\n/**\r\n * A word-level annotation, paired with the text of the verse that it covers.\r\n */\r\nexport interface AnnotatedWord extends ChapterWord {\r\n /**\r\n * The text that the annotation applies to.\r\n */\r\n text: string;\r\n}\r\n\r\n/**\r\n * A word-level annotation in a simplified chapter, paired with the text of the verse that it covers.\r\n */\r\nexport interface SimpleAnnotatedWord extends SimpleChapterWord {\r\n /**\r\n * The text that the annotation applies to.\r\n */\r\n text: string;\r\n}\r\n\r\n/**\r\n * A reference to a specific verse in a Bible translation, commentary, or dataset.\r\n */\r\nexport interface VerseReference {\r\n /**\r\n * The chapter number of the reference. This should be a positive integer.\r\n */\r\n chapter: number;\r\n\r\n /**\r\n * The verse number of the reference.\r\n *\r\n * If omitted, then the reference refers to the entire chapter rather than a specific verse.\r\n */\r\n verse?: number;\r\n\r\n /**\r\n * The ending verse number of the reference, for references that span multiple verses. This should be greater than or equal to the `verse` property if it is provided.\r\n */\r\n endVerse?: number;\r\n\r\n /**\r\n * The ending chapter number of the reference, for references that span multiple chapters. This should be greater than or equal to the `chapter` property if it is provided.\r\n */\r\n endChapter?: number;\r\n}\r\n\r\n/**\r\n * A client for interacting with the [Free Use Bible API](https://bible.helloao.org/).\r\n *\r\n * This API provides access to a large collection of Bible translations, commentaries, and datasets that are free to use.\r\n */\r\nexport class FreeUseBibleApi {\r\n endpoint: string = 'https://bible.helloao.org/';\r\n private _responseCache = new Map<string, Promise<unknown>>();\r\n private _useCache: boolean = true;\r\n\r\n constructor(options?: FreeUseBibleApiOptions) {\r\n this.endpoint = options?.endpoint ?? this.endpoint;\r\n this._useCache = options?.useCache ?? this._useCache;\r\n }\r\n\r\n /**\r\n * Gets the list of available Bible translations from the API.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getAvailableTranslations(\r\n endpoint?: string\r\n ): Promise<ApiAvailableTranslations> {\r\n return this._getJson<ApiAvailableTranslations>(\r\n 'api/available_translations.json',\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the complete content of a specific Bible translation.\r\n *\r\n * The results of this endpoint are very large, so the response is not cached.\r\n * @param translation The ID of the translation to get the complete content for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getCompleteTranslation(\r\n translation: string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationComplete> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n return this._getJson<ApiTranslationComplete>(\r\n `api/${encodedTranslation}/complete.json`,\r\n endpoint,\r\n false\r\n );\r\n }\r\n\r\n /**\r\n * Gets the complete content of a specific Bible translation, using the simplified chapter format.\r\n *\r\n * The results of this endpoint are very large, so the response is not cached.\r\n * @param translation The ID of the translation to get the complete content for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getSimpleCompleteTranslation(\r\n translation: string,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationComplete> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n return this._getJson<ApiSimpleTranslationComplete>(\r\n `api/${encodedTranslation}/complete.simple.json`,\r\n endpoint,\r\n false\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of available Bible commentaries from the API.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getAvailableCommentaries(\r\n endpoint?: string\r\n ): Promise<ApiAvailableTranslations> {\r\n return this._getJson<ApiAvailableTranslations>(\r\n 'api/available_commentaries.json',\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of available datasets from the API.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getAvailableDatasets(\r\n endpoint?: string\r\n ): Promise<ApiAvailableDatasets> {\r\n return this._getJson<ApiAvailableDatasets>(\r\n 'api/available_datasets.json',\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of books for a given Bible translation.\r\n * @param translation The ID of the translation to get the books for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getTranslationBooks(\r\n translation: string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBooks> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n return this._getJson<ApiTranslationBooks>(\r\n `api/${encodedTranslation}/books.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of books for a given Bible commentary.\r\n * @param commentary The ID of the commentary to get the books for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getCommentaryBooks(\r\n commentary: string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBooks> {\r\n const encodedCommentary = encodeURIComponent(commentary);\r\n return this._getJson<ApiTranslationBooks>(\r\n `api/c/${encodedCommentary}/books.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the list of books for a given dataset.\r\n * @param dataset The ID of the dataset to get the books for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getDatasetBooks(\r\n dataset: string,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBooks> {\r\n const encodedDataset = encodeURIComponent(dataset);\r\n return this._getJson<ApiDatasetBooks>(\r\n `api/d/${encodedDataset}/books.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific Bible translation.\r\n * @param translation The ID of the translation to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getTranslationBookChapter(\r\n translation: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiTranslationBookChapter>(\r\n `api/${encodedTranslation}/${encodedBook}/${encodedChapter}.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the word-level annotations (Strong's numbers and related source data) for a specific chapter of a specific book for a specific Bible translation.\r\n *\r\n * Only some translations have word-level annotations. This request will fail for chapters that don't have any.\r\n * Use `getChapterWords()` to get the annotations for a chapter that you have already loaded, which returns null instead of failing.\r\n * @param translation The ID of the translation to get the annotations for.\r\n * @param book The ID of the book to get the annotations for.\r\n * @param chapter The chapter number to get the annotations for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getTranslationBookChapterWords(\r\n translation: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapterWords> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiTranslationBookChapterWords>(\r\n `api/${encodedTranslation}/${encodedBook}/${encodedChapter}.words.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the word-level annotations for the given chapter, if it has any.\r\n * @param chapter The chapter to get the annotations for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The annotations for the chapter, or null if the chapter doesn't have any.\r\n */\r\n async getChapterWords(\r\n chapter: ApiTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapterWords | null> {\r\n if (!chapter.thisChapterWordsLink) {\r\n return null;\r\n }\r\n return this._getJson<ApiTranslationBookChapterWords>(\r\n chapter.thisChapterWordsLink,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific Bible translation, using the simplified chapter format.\r\n *\r\n * In the simplified format, each verse's content is a single string instead of a list of formatted content, and footnotes, inline headings, the Words of Jesus, and poetry are represented as offset ranges into that string.\r\n * @param translation The ID of the translation to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getSimpleTranslationBookChapter(\r\n translation: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationBookChapter> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiSimpleTranslationBookChapter>(\r\n `api/${encodedTranslation}/${encodedBook}/${encodedChapter}.simple.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the word-level annotations (Strong's numbers and related source data) for a specific chapter of a specific book for a specific Bible translation, with their offsets remapped onto the text of each simplified verse.\r\n *\r\n * Use this instead of `getTranslationBookChapterWords()` when working with the simplified chapter format, since the offsets in the regular annotations are anchored to a verse's content array instead of its plain text.\r\n * Use `getSimpleChapterWords()` to get the annotations for a simplified chapter that you have already loaded, which returns null instead of failing.\r\n * @param translation The ID of the translation to get the annotations for.\r\n * @param book The ID of the book to get the annotations for.\r\n * @param chapter The chapter number to get the annotations for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getSimpleTranslationBookChapterWords(\r\n translation: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationBookChapterWords> {\r\n const encodedTranslation = encodeURIComponent(translation);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiSimpleTranslationBookChapterWords>(\r\n `api/${encodedTranslation}/${encodedBook}/${encodedChapter}.words.simple.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the simplified version of a given chapter, if available.\r\n * @param chapter The chapter to get the simplified version of.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The simplified chapter, or null if simplified chapters aren't available for it.\r\n */\r\n getSimpleChapter(\r\n chapter: ApiCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleCommentaryBookChapter | null>;\r\n /**\r\n * Gets the simplified version of a given chapter, if available.\r\n * @param chapter The chapter to get the simplified version of.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The simplified chapter, or null if simplified chapters aren't available for it.\r\n */\r\n getSimpleChapter(\r\n chapter: ApiTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationBookChapter | null>;\r\n async getSimpleChapter(\r\n chapter: ApiTranslationBookChapter | ApiCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<\r\n ApiSimpleTranslationBookChapter | ApiSimpleCommentaryBookChapter | null\r\n > {\r\n if (!chapter.simpleChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n ApiSimpleTranslationBookChapter | ApiSimpleCommentaryBookChapter\r\n >(chapter.simpleChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the word-level annotations for the given simplified chapter, if it has any.\r\n * @param chapter The simplified chapter to get the annotations for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The annotations for the chapter, or null if the chapter doesn't have any.\r\n */\r\n async getSimpleChapterWords(\r\n chapter: ApiSimpleTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationBookChapterWords | null> {\r\n if (!chapter.thisChapterWordsLink) {\r\n return null;\r\n }\r\n return this._getJson<ApiSimpleTranslationBookChapterWords>(\r\n chapter.thisChapterWordsLink,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific Bible commentary.\r\n * @param commentary The ID of the commentary to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getCommentaryBookChapter(\r\n commentary: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter> {\r\n const encodedCommentary = encodeURIComponent(commentary);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiTranslationBookChapter>(\r\n `api/c/${encodedCommentary}/${encodedBook}/${encodedChapter}.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific Bible commentary, using the simplified chapter format.\r\n * @param commentary The ID of the commentary to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getSimpleCommentaryBookChapter(\r\n commentary: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiSimpleCommentaryBookChapter> {\r\n const encodedCommentary = encodeURIComponent(commentary);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiSimpleCommentaryBookChapter>(\r\n `api/c/${encodedCommentary}/${encodedBook}/${encodedChapter}.simple.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the content of a specific chapter of a specific book for a specific dataset.\r\n * @param dataset The ID of the dataset to get the chapter for.\r\n * @param book The ID of the book to get the chapter for.\r\n * @param chapter The chapter number to get.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n */\r\n async getDatasetBookChapter(\r\n dataset: string,\r\n book: string,\r\n chapter: number | string,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter> {\r\n const encodedDataset = encodeURIComponent(dataset);\r\n const encodedBook = encodeURIComponent(book);\r\n const encodedChapter = encodeURIComponent(String(chapter));\r\n return this._getJson<ApiDatasetBookChapter>(\r\n `api/d/${encodedDataset}/${encodedBook}/${encodedChapter}.json`,\r\n endpoint\r\n );\r\n }\r\n\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter | null>;\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiDatasetBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter | null>;\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiSimpleCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleCommentaryBookChapter | null>;\r\n /**\r\n * Gets the next chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the next chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The next chapter, or null if there is no next chapter.\r\n */\r\n getNextChapter(\r\n chapter: ApiSimpleTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationBookChapter | null>;\r\n async getNextChapter(\r\n chapter:\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | ApiSimpleTranslationBookChapter\r\n | ApiSimpleCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | ApiSimpleTranslationBookChapter\r\n | ApiSimpleCommentaryBookChapter\r\n | null\r\n > {\r\n if (!chapter.nextChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | ApiSimpleTranslationBookChapter\r\n | ApiSimpleCommentaryBookChapter\r\n >(chapter.nextChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter | null>;\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiDatasetBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter | null>;\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiSimpleCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleCommentaryBookChapter | null>;\r\n /**\r\n * Gets the previous chapter for a given chapter, if available.\r\n * @param chapter The chapter to get the previous chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The previous chapter, or null if there is no previous chapter.\r\n */\r\n getPreviousChapter(\r\n chapter: ApiSimpleTranslationBookChapter,\r\n endpoint?: string\r\n ): Promise<ApiSimpleTranslationBookChapter | null>;\r\n async getPreviousChapter(\r\n chapter:\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | ApiSimpleTranslationBookChapter\r\n | ApiSimpleCommentaryBookChapter,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | ApiSimpleTranslationBookChapter\r\n | ApiSimpleCommentaryBookChapter\r\n | null\r\n > {\r\n if (!chapter.previousChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | ApiSimpleTranslationBookChapter\r\n | ApiSimpleCommentaryBookChapter\r\n >(chapter.previousChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the first chapter for a given book, if available.\r\n * @param book The book to get the first chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The first chapter, or null if there is no first chapter.\r\n */\r\n getFirstChapter(\r\n book: ApiCommentaryBook,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the first chapter for a given book, if available.\r\n * @param book The book to get the first chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The first chapter, or null if there is no first chapter.\r\n */\r\n getFirstChapter(\r\n book: ApiTranslationBook,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter>;\r\n /**\r\n * Gets the first chapter for a given book, if available.\r\n * @param book The book to get the first chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The first chapter, or null if there is no first chapter.\r\n */\r\n getFirstChapter(\r\n book: ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter>;\r\n async getFirstChapter(\r\n book: ApiTranslationBook | ApiCommentaryBook | ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | null\r\n > {\r\n if (!book.firstChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n >(book.firstChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Gets the last chapter for a given book, if available.\r\n * @param book The book to get the last chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The last chapter, or null if there is no last chapter.\r\n */\r\n getLastChapter(\r\n book: ApiCommentaryBook,\r\n endpoint?: string\r\n ): Promise<ApiCommentaryBookChapter | null>;\r\n /**\r\n * Gets the last chapter for a given book, if available.\r\n * @param book The book to get the last chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The last chapter, or null if there is no last chapter.\r\n */\r\n getLastChapter(\r\n book: ApiTranslationBook,\r\n endpoint?: string\r\n ): Promise<ApiTranslationBookChapter>;\r\n /**\r\n * Gets the last chapter for a given book, if available.\r\n * @param book The book to get the last chapter for.\r\n * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.\r\n * @returns The last chapter, or null if there is no last chapter.\r\n */\r\n getLastChapter(\r\n book: ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<ApiDatasetBookChapter>;\r\n async getLastChapter(\r\n book: ApiTranslationBook | ApiCommentaryBook | ApiDatasetBook,\r\n endpoint?: string\r\n ): Promise<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n | null\r\n > {\r\n if (!book.lastChapterApiLink) {\r\n return null;\r\n }\r\n return this._getJson<\r\n | ApiTranslationBookChapter\r\n | ApiCommentaryBookChapter\r\n | ApiDatasetBookChapter\r\n >(book.lastChapterApiLink, endpoint);\r\n }\r\n\r\n /**\r\n * Formats a verse reference as a human-readable string.\r\n *\r\n * e.g. Genesis 1:1-2, John 3:16, Exodus 20-22, etc.\r\n *\r\n * @param book The book that the reference is for.\r\n * @param reference The reference to format.\r\n */\r\n formatReference(\r\n book: ApiTranslationBook,\r\n reference: VerseReference\r\n ): string {\r\n const bookName = book.name;\r\n const chapter = reference.chapter;\r\n const verse = reference.verse;\r\n const endChapter = reference.endChapter;\r\n const endVerse = reference.endVerse;\r\n\r\n let referenceStr = `${bookName} ${chapter}`;\r\n if (endChapter) {\r\n referenceStr += `-${endChapter}`;\r\n } else if (verse) {\r\n referenceStr += `:${verse}`;\r\n if (endVerse) {\r\n referenceStr += `-${endVerse}`;\r\n }\r\n }\r\n return referenceStr;\r\n }\r\n\r\n /**\r\n * Gets the text for a verse.\r\n * @param verse The verse to get the text for.\r\n * @param options Options for getting the verse text.\r\n */\r\n getVerseText(verse: ChapterVerse): string {\r\n let content = '';\r\n for (let part of verse.content) {\r\n if (typeof part === 'string') {\r\n content += part;\r\n } else if (typeof part === 'object' && 'text' in part) {\r\n if (part.poem) {\r\n content += '\\n';\r\n for (let i = 0; i < part.poem; i++) {\r\n content += '\\t';\r\n }\r\n }\r\n content += part.text;\r\n } else if (typeof part === 'object' && 'lineBreak' in part) {\r\n content += '\\n';\r\n } else if (typeof part === 'object') {\r\n content += ' ';\r\n }\r\n }\r\n return content.trim();\r\n }\r\n\r\n /**\r\n * Gets the verse text for the given chapter.\r\n * By default, the returned text includes markers for verse numbers and a reference to the chapter, but these can be omitted by passing options to the `options` parameter.\r\n * @param chapter The chapter to get the text for.\r\n * @param options Options for getting the chapter text.\r\n */\r\n getChapterVerseText(\r\n chapter: ApiTranslationBookChapter,\r\n options: GetChapterTextOptions = {}\r\n ): string {\r\n let content = '';\r\n for (let chapterContent of chapter.chapter.content) {\r\n if (chapterContent.type === 'verse') {\r\n if (!options.omitVerseNumbers) {\r\n content += `[${chapterContent.number}] `;\r\n }\r\n content += this.getVerseText(chapterContent) + ' ';\r\n } else if (chapterContent.type === 'line_break') {\r\n content = content.trim() + '\\n';\r\n }\r\n }\r\n\r\n if (!options.omitReference) {\r\n content = `${this.formatReference(chapter.book, {\r\n chapter: chapter.chapter.number,\r\n })}\\n${content.trim()}`;\r\n }\r\n\r\n return content.trim();\r\n }\r\n\r\n /**\r\n * Gets the verse text for the given simplified chapter.\r\n * By default, the returned text includes markers for verse numbers and a reference to the chapter, but these can be omitted by passing options to the `options` parameter.\r\n * @param chapter The simplified chapter to get the text for.\r\n * @param options Options for getting the chapter text.\r\n */\r\n getSimpleChapterVerseText(\r\n chapter: ApiSimpleTranslationBookChapter,\r\n options: GetChapterTextOptions = {}\r\n ): string {\r\n let content = '';\r\n for (let chapterContent of chapter.chapter.content) {\r\n if (chapterContent.type === 'verse') {\r\n if (!options.omitVerseNumbers) {\r\n content += `[${chapterContent.number}] `;\r\n }\r\n content += chapterContent.text.trim() + ' ';\r\n } else if (chapterContent.type === 'line_break') {\r\n content = content.trim() + '\\n';\r\n }\r\n }\r\n\r\n if (!options.omitReference) {\r\n content = `${this.formatReference(chapter.book, {\r\n chapter: chapter.chapter.number,\r\n })}\\n${content.trim()}`;\r\n }\r\n\r\n return content.trim();\r\n }\r\n\r\n /**\r\n * Gets the text that the given word-level annotation applies to.\r\n *\r\n * Annotations are anchored to a range of characters in a single item of the verse's content,\r\n * so that the ranges stay correct for verses whose content is split into multiple items,\r\n * such as poem lines and the words of Jesus.\r\n * @param verse The verse that the annotation is in.\r\n * @param word The annotation to get the text for.\r\n * @returns The annotated text, or an empty string if the annotation doesn't point at any text.\r\n */\r\n getWordText(verse: ChapterVerse, word: ChapterWord): string {\r\n const content = verse.content[word.contentIndex];\r\n\r\n if (typeof content === 'string') {\r\n return content.slice(word.start, word.end);\r\n } else if (\r\n typeof content === 'object' &&\r\n content !== null &&\r\n 'text' in content\r\n ) {\r\n return content.text.slice(word.start, word.end);\r\n }\r\n\r\n // Line breaks, inline headings, and footnote references have no text of their own.\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the word-level annotations for the given verse, paired with the text that each one applies to.\r\n * @param verse The verse to get the annotations for.\r\n * @param words The annotations for the chapter that the verse is in.\r\n * @returns The annotations for the verse, in the order that they occur. Empty if the verse has no annotations.\r\n */\r\n getVerseWords(\r\n verse: ChapterVerse,\r\n words: ApiTranslationBookChapterWords\r\n ): AnnotatedWord[] {\r\n const verseWords = words.verses[verse.number.toString()] ?? [];\r\n\r\n return verseWords.map((word) => ({\r\n ...word,\r\n text: this.getWordText(verse, word),\r\n }));\r\n }\r\n\r\n /**\r\n * Gets the text that the given simplified word-level annotation applies to.\r\n * @param verse The simplified verse that the annotation is in.\r\n * @param word The annotation to get the text for.\r\n * @returns The annotated text.\r\n */\r\n getSimpleWordText(\r\n verse: SimpleChapterVerse,\r\n word: SimpleChapterWord\r\n ): string {\r\n return verse.text.slice(word.start, word.end);\r\n }\r\n\r\n /**\r\n * Gets the word-level annotations for the given simplified verse, paired with the text that each one applies to.\r\n * @param verse The simplified verse to get the annotations for.\r\n * @param words The simplified annotations for the chapter that the verse is in.\r\n * @returns The annotations for the verse, in the order that they occur. Empty if the verse has no annotations.\r\n */\r\n getSimpleVerseWords(\r\n verse: SimpleChapterVerse,\r\n words: ApiSimpleTranslationBookChapterWords\r\n ): SimpleAnnotatedWord[] {\r\n const verseWords = words.verses[verse.number.toString()] ?? [];\r\n\r\n return verseWords.map((word) => ({\r\n ...word,\r\n text: this.getSimpleWordText(verse, word),\r\n }));\r\n }\r\n\r\n private _getJson<T>(\r\n path: string,\r\n endpoint: string | undefined,\r\n useCache: boolean = true\r\n ): Promise<T> {\r\n const url = this._buildUrl(path, endpoint);\r\n const existing = this._responseCache.get(url) as Promise<T> | undefined;\r\n if (existing) {\r\n return existing;\r\n }\r\n\r\n const request: Promise<T> = fetch(url)\r\n .then(async (response) => {\r\n if (response.status < 200 || response.status >= 300) {\r\n throw new Error(\r\n `Failed request to ${url}. Status: ${response.status} ${response.statusText}`\r\n );\r\n }\r\n return await response.json();\r\n })\r\n .catch((error) => {\r\n this._responseCache.delete(url);\r\n throw error;\r\n });\r\n\r\n if (this._useCache && useCache) {\r\n this._responseCache.set(url, request);\r\n }\r\n return request;\r\n }\r\n\r\n private _buildUrl(path: string, endpoint?: string): string {\r\n if (/^https?:\\/\\//i.test(path)) {\r\n return path;\r\n }\r\n\r\n const baseEndpoint = endpoint ?? this.endpoint;\r\n return new URL(path, baseEndpoint).href;\r\n }\r\n}\r\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../types.gen.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is auto-generated by @hey-api/openapi-ts\r\n\r\nexport type ClientOptions = {\r\n baseUrl: 'https://bible.helloao.org' | (string & {});\r\n};\r\n\r\n/**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\nexport type BookId =\r\n | 'GEN'\r\n | 'EXO'\r\n | 'LEV'\r\n | 'NUM'\r\n | 'DEU'\r\n | 'JOS'\r\n | 'JDG'\r\n | 'RUT'\r\n | '1SA'\r\n | '2SA'\r\n | '1KI'\r\n | '2KI'\r\n | '1CH'\r\n | '2CH'\r\n | 'EZR'\r\n | 'NEH'\r\n | 'EST'\r\n | 'JOB'\r\n | 'PSA'\r\n | 'PRO'\r\n | 'ECC'\r\n | 'SNG'\r\n | 'ISA'\r\n | 'JER'\r\n | 'LAM'\r\n | 'EZK'\r\n | 'DAN'\r\n | 'HOS'\r\n | 'JOL'\r\n | 'AMO'\r\n | 'OBA'\r\n | 'JON'\r\n | 'MIC'\r\n | 'NAM'\r\n | 'HAB'\r\n | 'ZEP'\r\n | 'HAG'\r\n | 'ZEC'\r\n | 'MAL'\r\n | 'MAT'\r\n | 'MRK'\r\n | 'LUK'\r\n | 'JHN'\r\n | 'ACT'\r\n | 'ROM'\r\n | '1CO'\r\n | '2CO'\r\n | 'GAL'\r\n | 'EPH'\r\n | 'PHP'\r\n | 'COL'\r\n | '1TH'\r\n | '2TH'\r\n | '1TI'\r\n | '2TI'\r\n | 'TIT'\r\n | 'PHM'\r\n | 'HEB'\r\n | 'JAS'\r\n | '1PE'\r\n | '2PE'\r\n | '1JN'\r\n | '2JN'\r\n | '3JN'\r\n | 'JUD'\r\n | 'REV'\r\n | 'TOB'\r\n | 'JDT'\r\n | 'ESG'\r\n | 'WIS'\r\n | 'SIR'\r\n | 'BAR'\r\n | 'LJE'\r\n | 'S3Y'\r\n | 'SUS'\r\n | 'BEL'\r\n | '1MA'\r\n | '2MA'\r\n | '3MA'\r\n | '4MA'\r\n | '1ES'\r\n | '2ES'\r\n | 'MAN'\r\n | 'PS2'\r\n | 'ODA'\r\n | 'PSS'\r\n | 'EZA'\r\n | '5EZ'\r\n | '6EZ'\r\n | 'DAG'\r\n | 'PS3'\r\n | '2BA'\r\n | 'LBA'\r\n | 'JUB'\r\n | 'ENO'\r\n | '1MQ'\r\n | '2MQ'\r\n | '3MQ'\r\n | 'REP'\r\n | '4BA'\r\n | 'LAO';\r\n\r\n/**\r\n * The list of available translations. Maps to the /api/available-translations.json endpoint.\r\n */\r\nexport type ApiAvailableTranslations = {\r\n /**\r\n * The list of translations that are available in the API.\r\n */\r\n translations: Array<ApiTranslation>;\r\n};\r\n\r\n/**\r\n * Defines a translation that is used in the API.\r\n */\r\nexport type ApiTranslation = {\r\n /**\r\n * The ID of the translation.\r\n */\r\n id: string;\r\n /**\r\n * The name of the translation.\r\n */\r\n name: string;\r\n /**\r\n * The website for the translation.\r\n */\r\n website: string;\r\n /**\r\n * The URL that the license for the translation can be found.\r\n */\r\n licenseUrl: string;\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes?: string | null;\r\n /**\r\n * The notice that should be displayed when displaying content from the translation.\r\n */\r\n licenseNotice?: string | null;\r\n /**\r\n * The short name for the translation.\r\n */\r\n shortName?: string;\r\n /**\r\n * The English name for the translation.\r\n */\r\n englishName: string;\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: string;\r\n /**\r\n * The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: 'ltr' | 'rtl';\r\n /**\r\n * The API link for the list of books for this translation. Relative to the API origin.\r\n */\r\n listOfBooksApiLink: string;\r\n availableFormats: Array<'json' | 'usfm'>;\r\n /**\r\n * The number of books that are contained in this translation. Complete translations should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: number;\r\n /**\r\n * The total number of chapters that are contained in this translation. Complete translations should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: number;\r\n /**\r\n * The total number of verses that are contained in this translation. Complete translations should have the same number of verses as the Bible (around 31,102 - some translations exclude verses based on the aparent likelyhood of existing in the original source texts).\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The total number of apocryphal books that are contained in this translation.\r\n */\r\n numberOfApocryphalBooks?: number;\r\n /**\r\n * The total number of apocryphal chapters that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalChapters?: number;\r\n /**\r\n * The total number of apocryphal verses that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalVerses?: number;\r\n /**\r\n * Gets the name of the language that the translation is in. Null or undefined if the name of the language is not known.\r\n */\r\n languageName?: string;\r\n /**\r\n * Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName?: string;\r\n /**\r\n * The API link for downloading the complete translation as a single JSON file. Relative to the API origin. Undefined if complete translation files are not available.\r\n */\r\n completeTranslationApiLink?: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a translation.\r\n */\r\nexport type ApiTranslationBooks = {\r\n /**\r\n * The translation information for the books.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The list of books that are available for the translation.\r\n */\r\n books: Array<ApiTranslationBook>;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a translation book.\r\n */\r\nexport type ApiTranslationBook = {\r\n id: BookId;\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.\r\n */\r\n title: string | null;\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: number;\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal?: boolean;\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: number;\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: string;\r\n firstChapterReference: TranslationChapterReference;\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: number;\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: string;\r\n lastChapterReference: TranslationChapterReference;\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines a reference to a chapter in a translation.\r\n */\r\nexport type TranslationChapterReference = {\r\n /**\r\n * The ID of the translation that the chapter reference is for.\r\n */\r\n translationId: string;\r\n book: BookId;\r\n /**\r\n * The chapter number of the chapter reference.\r\n */\r\n chapter: number;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter in a translation.\r\n */\r\nexport type ApiTranslationBookChapter = {\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<ChapterContent>;\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: Array<ChapterFootnote>;\r\n };\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: TranslationBookChapterAudioLinks;\r\n /**\r\n * The translation information for the book chapter.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiTranslationBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: TranslationChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterReference: TranslationChapterReference | null;\r\n /**\r\n * The links to the audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioLinks: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterReference: TranslationChapterReference | null;\r\n /**\r\n * The links to the audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioLinks: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines a union type that represents a single piece of chapter content. A piece of chapter content can be one of the following things: A heading, a line break, a verse, or a Hebrew Subtitle.\r\n */\r\nexport type ChapterContent =\r\n | ({\r\n type: 'heading';\r\n } & ChapterHeading)\r\n | ({\r\n type: 'line_break';\r\n } & ChapterLineBreak)\r\n | ({\r\n type: 'verse';\r\n } & ChapterVerse)\r\n | ({\r\n type: 'hebrew_subtitle';\r\n } & ChapterHebrewSubtitle);\r\n\r\n/**\r\n * Defines the schema for a heading in a chapter.\r\n */\r\nexport type ChapterHeading = {\r\n type: 'heading';\r\n /**\r\n * The content for the heading. If multiple strings are included in the array, they should be concatenated with a space.\r\n */\r\n content: Array<string>;\r\n};\r\n\r\n/**\r\n * Defines the schema for a line break in a chapter.\r\n */\r\nexport type ChapterLineBreak = {\r\n type: 'line_break';\r\n};\r\n\r\n/**\r\n * Defines the schema for a verse in a chapter.\r\n */\r\nexport type ChapterVerse = {\r\n type: 'verse';\r\n /**\r\n * The number of the verse.\r\n */\r\n number: number;\r\n /**\r\n * The list of content for the verse. Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: Array<\r\n | string\r\n | FormattedText\r\n | InlineHeading\r\n | InlineLineBreak\r\n | VerseFootnoteReference\r\n >;\r\n};\r\n\r\n/**\r\n * Defines the schema for formatted text. That is, text that is formatted in a particular manner.\r\n */\r\nexport type FormattedText = {\r\n /**\r\n * The text that is formatted.\r\n */\r\n text: string;\r\n /**\r\n * Whether the text represents a poem. The number indicates the level of indent. Common in Psalms.\r\n */\r\n poem?: number;\r\n /**\r\n * Whether the text represents the Words of Jesus.\r\n */\r\n wordsOfJesus?: boolean;\r\n};\r\n\r\n/**\r\n * Defines the schema for a heading that is embedded in a verse.\r\n */\r\nexport type InlineHeading = {\r\n /**\r\n * The text of the heading.\r\n */\r\n heading: string;\r\n};\r\n\r\n/**\r\n * Defines the schema for a line break that is embedded in a verse.\r\n */\r\nexport type InlineLineBreak = {\r\n lineBreak: true;\r\n};\r\n\r\n/**\r\n * Defines the schema for a footnote reference in a verse or a Hebrew Subtitle.\r\n */\r\nexport type VerseFootnoteReference = {\r\n /**\r\n * The ID of the note.\r\n */\r\n noteId: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for a Hebrew Subtitle in a chapter.\r\n */\r\nexport type ChapterHebrewSubtitle = {\r\n type: 'hebrew_subtitle';\r\n /**\r\n * The content that is contained in the subtitle. Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: Array<string | FormattedText | VerseFootnoteReference>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a footnote.\r\n */\r\nexport type ChapterFootnote = {\r\n /**\r\n * The ID of the note that is referenced.\r\n */\r\n noteId: number;\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: string;\r\n /**\r\n * The verse reference for the footnote. Undefined if the footnote isn't associated with a specific verse.\r\n */\r\n reference?: {\r\n chapter: number;\r\n verse: number;\r\n };\r\n /**\r\n * The caller that should be used for the footnote. For footnotes, a \"caller\" is the character that is used in the text to reference to footnote. For example, in the text: Hello (a) World ---- (a) This is a footnote. The \"(a)\" is the caller. If \"+\", then the caller should be autogenerated. If null, then the caller should be empty. If a string, then the caller should be that string.\r\n */\r\n caller: '+' | string | null;\r\n};\r\n\r\n/**\r\n * Defines the schema for the audio links for a book chapter.\r\n */\r\nexport type TranslationBookChapterAudioLinks = {\r\n [key: string]: string;\r\n};\r\n\r\n/**\r\n * Defines the complete translation download data. Maps to the /api/:translationId/complete.json endpoint.\r\n */\r\nexport type ApiTranslationComplete = {\r\n /**\r\n * The translation metadata.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The complete list of books with all their chapters.\r\n */\r\n books: Array<ApiTranslationCompleteBook>;\r\n};\r\n\r\n/**\r\n * A book in the complete translation download.\r\n */\r\nexport type ApiTranslationCompleteBook = {\r\n id: BookId;\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.\r\n */\r\n title: string | null;\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: number;\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal?: boolean;\r\n /**\r\n * The number of chapters in the book.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The total number of verses in the book.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The complete list of chapters with all content.\r\n */\r\n chapters: Array<TranslationBookChapter>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a book chapter.\r\n */\r\nexport type TranslationBookChapter = {\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<ChapterContent>;\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: Array<ChapterFootnote>;\r\n };\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: TranslationBookChapterAudioLinks;\r\n};\r\n\r\n/**\r\n * The list of available commentaries. Maps to the /api/available-commentaries.json endpoint.\r\n */\r\nexport type ApiAvailableCommentaries = {\r\n /**\r\n * The list of commentaries that are available in the API.\r\n */\r\n commentaries: Array<ApiCommentary>;\r\n};\r\n\r\n/**\r\n * Defines a commentary that is used in the API.\r\n */\r\nexport type ApiCommentary = {\r\n /**\r\n * The ID of the commentary.\r\n */\r\n id: string;\r\n /**\r\n * The name of the commentary.\r\n */\r\n name: string;\r\n /**\r\n * The website for the commentary.\r\n */\r\n website: string;\r\n /**\r\n * The URL that the license for the commentary can be found.\r\n */\r\n licenseUrl: string;\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes?: string | null;\r\n /**\r\n * The English name for the commentary.\r\n */\r\n englishName: string;\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: string;\r\n /**\r\n * The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: 'ltr' | 'rtl';\r\n /**\r\n * The API link for the list of books for this commentary. Relative to the API origin.\r\n */\r\n listOfBooksApiLink: string;\r\n /**\r\n * The API link for the list of profiles for this commentary. Relative to the API origin.\r\n */\r\n listOfProfilesApiLink: string;\r\n availableFormats: Array<'json' | 'usfm'>;\r\n /**\r\n * The number of books that are contained in this commentary. Complete commentaries should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: number;\r\n /**\r\n * The total number of chapters that are contained in this commentary. Complete commentaries should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: number;\r\n /**\r\n * The total number of verses that are contained in this commentary. Complete commentaries should have the same number of verses as the Bible (around 31,102 - some commentaries exclude verses based on the aparent likelyhood of existing in the original source texts).\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The total number of profiles that are contained in this commentary. Profiles are used to provide additional information about people and people groups that are mentioned in the Bible.\r\n */\r\n totalNumberOfProfiles: number;\r\n /**\r\n * Gets the name of the language that the commentary is in. Null or undefined if the name of the language is not known.\r\n */\r\n languageName?: string;\r\n /**\r\n * Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName?: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a commentary.\r\n */\r\nexport type ApiCommentaryBooks = {\r\n /**\r\n * The commentary information for the books.\r\n */\r\n commentary: ApiCommentary;\r\n /**\r\n * The list of books that are available for the commentary.\r\n */\r\n books: Array<ApiCommentaryBook>;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a commentary book.\r\n */\r\nexport type ApiCommentaryBook = {\r\n id: BookId;\r\n /**\r\n * The name that the commentary provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The commentary's introduction for the book. Undefined if the commentary didn't provide an introduction for the book.\r\n */\r\n introduction?: string;\r\n /**\r\n * The summary of the commentary's introduction for the book. Undefined if the commentary didn't provide a summary for the book.\r\n */\r\n introductionSummary?: string;\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: number;\r\n /**\r\n * The number of the first chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n firstChapterNumber: number | null;\r\n /**\r\n * The link to the first chapter of the book. Null if the comentary book has no chapters.\r\n */\r\n firstChapterApiLink: string | null;\r\n /**\r\n * The reference for the first chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n firstChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of the last chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n lastChapterNumber: number | null;\r\n /**\r\n * The link to the last chapter of the book. Null if the comentary book has no chapters.\r\n */\r\n lastChapterApiLink: string | null;\r\n /**\r\n * The reference for the last chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n lastChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines a reference to a chapter in a commentary.\r\n */\r\nexport type CommentaryChapterReference = {\r\n /**\r\n * The ID of the commentary that the chapter reference is for.\r\n */\r\n commentaryId: string;\r\n book: BookId;\r\n /**\r\n * The chapter number of the chapter reference.\r\n */\r\n chapter: number;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book chapter in a commentary.\r\n */\r\nexport type ApiCommentaryBookChapter = {\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The introduction that the commentary provided to the chapter. Not all commentaries provide an introduction to a chapter.\r\n */\r\n introduction?: string;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<ChapterVerse>;\r\n };\r\n /**\r\n * The commentary information for the book chapter.\r\n */\r\n commentary: ApiCommentary;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiCommentaryBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: CommentaryChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the commentary.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the commentary.\r\n */\r\n nextChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the commentary.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the commentary.\r\n */\r\n previousChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n};\r\n\r\n/**\r\n * The list of available datasets. Maps to the /api/available-datasets.json endpoint.\r\n */\r\nexport type ApiAvailableDatasets = {\r\n /**\r\n * The list of datasets that are available in the API.\r\n */\r\n datasets: Array<ApiDataset>;\r\n};\r\n\r\n/**\r\n * Defines a dataset that is used in the API.\r\n */\r\nexport type ApiDataset = {\r\n /**\r\n * The ID of the dataset.\r\n */\r\n id: string;\r\n /**\r\n * The name of the dataset.\r\n */\r\n name: string;\r\n /**\r\n * The website for the dataset.\r\n */\r\n website: string;\r\n /**\r\n * The URL that the license for the dataset can be found.\r\n */\r\n licenseUrl: string;\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes?: string | null;\r\n /**\r\n * The English name for the dataset.\r\n */\r\n englishName: string;\r\n /**\r\n * The ISO 639 3-letter language tag that the dataset is primarily in.\r\n */\r\n language: string;\r\n /**\r\n * The direction that the language is written in.\r\n */\r\n textDirection: 'ltr' | 'rtl';\r\n /**\r\n * The API link for the list of books for this dataset. Relative to the API origin.\r\n */\r\n listOfBooksApiLink: string;\r\n availableFormats: Array<'json'>;\r\n /**\r\n * The number of books that are contained in this dataset.\r\n */\r\n numberOfBooks: number;\r\n /**\r\n * The total number of chapters that are contained in this dataset.\r\n */\r\n totalNumberOfChapters: number;\r\n /**\r\n * The total number of verses that are contained in this dataset.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The total number of references that are contained in this dataset.\r\n */\r\n totalNumberOfReferences: number;\r\n /**\r\n * Gets the name of the language that the dataset is in. Null or undefined if the name of the language is not known.\r\n */\r\n languageName?: string;\r\n /**\r\n * Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName?: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a dataset.\r\n */\r\nexport type ApiDatasetBooks = {\r\n /**\r\n * The dataset information for the books.\r\n */\r\n dataset: ApiDataset;\r\n /**\r\n * The list of books that are available for the dataset.\r\n */\r\n books: Array<ApiDatasetBook>;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book in a dataset.\r\n */\r\nexport type ApiDatasetBook = {\r\n id: BookId;\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: number;\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: number;\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: string;\r\n firstChapterReference: DatasetChapterReference;\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: number;\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: string;\r\n lastChapterReference: DatasetChapterReference;\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The number of references that the book contains.\r\n */\r\n totalNumberOfReferences: number;\r\n};\r\n\r\n/**\r\n * Defines a reference to a chapter in a dataset.\r\n */\r\nexport type DatasetChapterReference = {\r\n /**\r\n * The ID of the dataset that the chapter reference is for.\r\n */\r\n datasetId: string;\r\n book: BookId;\r\n /**\r\n * The chapter number of the chapter reference.\r\n */\r\n chapter: number;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book chapter in a dataset.\r\n */\r\nexport type ApiDatasetBookChapter = {\r\n /**\r\n * The data for the chapter.\r\n */\r\n chapter: DatasetChapterData;\r\n /**\r\n * The dataset information for the book chapter.\r\n */\r\n dataset: ApiDataset;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiDatasetBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: DatasetChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the dataset.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the dataset.\r\n */\r\n nextChapterReference: DatasetChapterReference | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the dataset.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the dataset.\r\n */\r\n previousChapterReference: DatasetChapterReference | null;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n /**\r\n * The number of references that the chapter contains.\r\n */\r\n numberOfReferences: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a chapter in a dataset.\r\n */\r\nexport type DatasetChapterData = {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<DatasetChapterVerseContent>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a verse in a dataset chapter.\r\n */\r\nexport type DatasetChapterVerseContent = {\r\n /**\r\n * The number of the verse.\r\n */\r\n verse: number;\r\n /**\r\n * The list of references for the verse.\r\n */\r\n references: Array<ScoredVerseRef>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a verse reference that has an arbitrary score attached to it.\r\n */\r\nexport type ScoredVerseRef = {\r\n book: BookId;\r\n /**\r\n * The chapter number that the reference starts at.\r\n */\r\n chapter: number;\r\n /**\r\n * The verse number that the reference starts at.\r\n */\r\n verse: number;\r\n /**\r\n * The rest of the content of the verse reference. This is the part of the string that comes after the verse reference. For example, in \"GEN 1:1 In the beginning, God created the Heavens and the Earth.\", the content would be \"In the beginning, God created the Heavens and the Earth.\"\r\n */\r\n content?: string;\r\n /**\r\n * The chapter that the verse reference ends at. This is used for references that span multiple chapters, such as \"GEN 1:1-2:3\". In this case, the endChapter would be 2.\r\n */\r\n endChapter?: number;\r\n /**\r\n * The verse that the verse reference ends at. This is used for references that span multiple verses, such as \"GEN 1:1-1:3\". In this case, the endVerse would be 3.\r\n */\r\n endVerse?: number;\r\n /**\r\n * The score for the verse reference. The meaning of the score is arbitrary and is determined by the dataset.\r\n */\r\n score: number;\r\n};\r\n\r\nexport type GetAvailableTranslationsData = {\r\n body?: never;\r\n path?: never;\r\n query?: never;\r\n url: '/api/available_translations.json';\r\n};\r\n\r\nexport type GetAvailableTranslationsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiAvailableTranslations;\r\n};\r\n\r\nexport type GetAvailableTranslationsResponse =\r\n GetAvailableTranslationsResponses[keyof GetAvailableTranslationsResponses];\r\n\r\nexport type GetTranslationBooksData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/books.json';\r\n};\r\n\r\nexport type GetTranslationBooksErrors = {\r\n /**\r\n * 404 Not Found - The specified translation was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationBooksResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationBooks;\r\n};\r\n\r\nexport type GetTranslationBooksResponse =\r\n GetTranslationBooksResponses[keyof GetTranslationBooksResponses];\r\n\r\nexport type GetTranslationBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/{book}/{chapter}.json';\r\n};\r\n\r\nexport type GetTranslationBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified translation, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationBookChapter;\r\n};\r\n\r\nexport type GetTranslationBookChapterResponse =\r\n GetTranslationBookChapterResponses[keyof GetTranslationBookChapterResponses];\r\n\r\nexport type GetTranslationCompleteData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/complete.json';\r\n};\r\n\r\nexport type GetTranslationCompleteErrors = {\r\n /**\r\n * 404 Not Found - The specified translation was not found, or complete translations are not available.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationCompleteResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationComplete;\r\n};\r\n\r\nexport type GetTranslationCompleteResponse =\r\n GetTranslationCompleteResponses[keyof GetTranslationCompleteResponses];\r\n\r\nexport type GetAvailableCommentariesData = {\r\n body?: never;\r\n path?: never;\r\n query?: never;\r\n url: '/api/available_commentaries.json';\r\n};\r\n\r\nexport type GetAvailableCommentariesResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiAvailableCommentaries;\r\n};\r\n\r\nexport type GetAvailableCommentariesResponse =\r\n GetAvailableCommentariesResponses[keyof GetAvailableCommentariesResponses];\r\n\r\nexport type GetCommentaryBooksData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The commentary ID of the commentary to get the books or chapter content for.\r\n */\r\n commentary: string;\r\n };\r\n query?: never;\r\n url: '/api/c/{commentary}/books.json';\r\n};\r\n\r\nexport type GetCommentaryBooksErrors = {\r\n /**\r\n * 404 Not Found - The specified commentary was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetCommentaryBooksResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiCommentaryBooks;\r\n};\r\n\r\nexport type GetCommentaryBooksResponse =\r\n GetCommentaryBooksResponses[keyof GetCommentaryBooksResponses];\r\n\r\nexport type GetCommentaryBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The commentary ID of the commentary to get the books or chapter content for.\r\n */\r\n commentary: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/c/{commentary}/{book}/{chapter}.json';\r\n};\r\n\r\nexport type GetCommentaryBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified commentary, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetCommentaryBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiCommentaryBookChapter;\r\n};\r\n\r\nexport type GetCommentaryBookChapterResponse =\r\n GetCommentaryBookChapterResponses[keyof GetCommentaryBookChapterResponses];\r\n\r\nexport type GetAvailableDatasetsData = {\r\n body?: never;\r\n path?: never;\r\n query?: never;\r\n url: '/api/available_datasets.json';\r\n};\r\n\r\nexport type GetAvailableDatasetsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiAvailableDatasets;\r\n};\r\n\r\nexport type GetAvailableDatasetsResponse =\r\n GetAvailableDatasetsResponses[keyof GetAvailableDatasetsResponses];\r\n\r\nexport type GetDatasetBooksData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The dataset ID of the dataset to get the books or chapter content for.\r\n */\r\n dataset: string;\r\n };\r\n query?: never;\r\n url: '/api/d/{dataset}/books.json';\r\n};\r\n\r\nexport type GetDatasetBooksErrors = {\r\n /**\r\n * 404 Not Found - The specified dataset was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetDatasetBooksResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiDatasetBooks;\r\n};\r\n\r\nexport type GetDatasetBooksResponse =\r\n GetDatasetBooksResponses[keyof GetDatasetBooksResponses];\r\n\r\nexport type GetDatasetBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The dataset ID of the dataset to get the books or chapter content for.\r\n */\r\n dataset: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/d/{dataset}/{book}/{chapter}.json';\r\n};\r\n\r\nexport type GetDatasetBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified dataset, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetDatasetBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiDatasetBookChapter;\r\n};\r\n\r\nexport type GetDatasetBookChapterResponse =\r\n GetDatasetBookChapterResponses[keyof GetDatasetBookChapterResponses];\r\n"],
|
|
4
|
+
"sourcesContent": ["// This file is auto-generated by @hey-api/openapi-ts\r\n\r\nexport type ClientOptions = {\r\n baseUrl: 'https://bible.helloao.org' | (string & {});\r\n};\r\n\r\n/**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\nexport type BookId =\r\n | 'GEN'\r\n | 'EXO'\r\n | 'LEV'\r\n | 'NUM'\r\n | 'DEU'\r\n | 'JOS'\r\n | 'JDG'\r\n | 'RUT'\r\n | '1SA'\r\n | '2SA'\r\n | '1KI'\r\n | '2KI'\r\n | '1CH'\r\n | '2CH'\r\n | 'EZR'\r\n | 'NEH'\r\n | 'EST'\r\n | 'JOB'\r\n | 'PSA'\r\n | 'PRO'\r\n | 'ECC'\r\n | 'SNG'\r\n | 'ISA'\r\n | 'JER'\r\n | 'LAM'\r\n | 'EZK'\r\n | 'DAN'\r\n | 'HOS'\r\n | 'JOL'\r\n | 'AMO'\r\n | 'OBA'\r\n | 'JON'\r\n | 'MIC'\r\n | 'NAM'\r\n | 'HAB'\r\n | 'ZEP'\r\n | 'HAG'\r\n | 'ZEC'\r\n | 'MAL'\r\n | 'MAT'\r\n | 'MRK'\r\n | 'LUK'\r\n | 'JHN'\r\n | 'ACT'\r\n | 'ROM'\r\n | '1CO'\r\n | '2CO'\r\n | 'GAL'\r\n | 'EPH'\r\n | 'PHP'\r\n | 'COL'\r\n | '1TH'\r\n | '2TH'\r\n | '1TI'\r\n | '2TI'\r\n | 'TIT'\r\n | 'PHM'\r\n | 'HEB'\r\n | 'JAS'\r\n | '1PE'\r\n | '2PE'\r\n | '1JN'\r\n | '2JN'\r\n | '3JN'\r\n | 'JUD'\r\n | 'REV'\r\n | 'TOB'\r\n | 'JDT'\r\n | 'ESG'\r\n | 'WIS'\r\n | 'SIR'\r\n | 'BAR'\r\n | 'LJE'\r\n | 'S3Y'\r\n | 'SUS'\r\n | 'BEL'\r\n | '1MA'\r\n | '2MA'\r\n | '3MA'\r\n | '4MA'\r\n | '1ES'\r\n | '2ES'\r\n | 'MAN'\r\n | 'PS2'\r\n | 'ODA'\r\n | 'PSS'\r\n | 'EZA'\r\n | '5EZ'\r\n | '6EZ'\r\n | 'DAG'\r\n | 'PS3'\r\n | '2BA'\r\n | 'LBA'\r\n | 'JUB'\r\n | 'ENO'\r\n | '1MQ'\r\n | '2MQ'\r\n | '3MQ'\r\n | 'REP'\r\n | '4BA'\r\n | 'LAO';\r\n\r\n/**\r\n * The list of available translations. Maps to the /api/available-translations.json endpoint.\r\n */\r\nexport type ApiAvailableTranslations = {\r\n /**\r\n * The list of translations that are available in the API.\r\n */\r\n translations: Array<ApiTranslation>;\r\n};\r\n\r\n/**\r\n * Defines a translation that is used in the API.\r\n */\r\nexport type ApiTranslation = {\r\n /**\r\n * The ID of the translation.\r\n */\r\n id: string;\r\n /**\r\n * The name of the translation.\r\n */\r\n name: string;\r\n /**\r\n * The website for the translation.\r\n */\r\n website: string;\r\n /**\r\n * The URL that the license for the translation can be found.\r\n */\r\n licenseUrl: string;\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes?: string | null;\r\n /**\r\n * The notice that should be displayed when displaying content from the translation.\r\n */\r\n licenseNotice?: string | null;\r\n /**\r\n * The short name for the translation.\r\n */\r\n shortName?: string;\r\n /**\r\n * The English name for the translation.\r\n */\r\n englishName: string;\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: string;\r\n /**\r\n * The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: 'ltr' | 'rtl';\r\n /**\r\n * The API link for the list of books for this translation. Relative to the API origin.\r\n */\r\n listOfBooksApiLink: string;\r\n availableFormats: Array<'json' | 'usfm'>;\r\n /**\r\n * The number of books that are contained in this translation. Complete translations should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: number;\r\n /**\r\n * The total number of chapters that are contained in this translation. Complete translations should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: number;\r\n /**\r\n * The total number of verses that are contained in this translation. Complete translations should have the same number of verses as the Bible (around 31,102 - some translations exclude verses based on the aparent likelyhood of existing in the original source texts).\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The total number of apocryphal books that are contained in this translation.\r\n */\r\n numberOfApocryphalBooks?: number;\r\n /**\r\n * The total number of apocryphal chapters that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalChapters?: number;\r\n /**\r\n * The total number of apocryphal verses that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalVerses?: number;\r\n /**\r\n * Gets the name of the language that the translation is in. Null or undefined if the name of the language is not known.\r\n */\r\n languageName?: string;\r\n /**\r\n * Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName?: string;\r\n /**\r\n * The API link for downloading the complete translation as a single JSON file. Relative to the API origin. Undefined if complete translation files are not available.\r\n */\r\n completeTranslationApiLink?: string;\r\n /**\r\n * The API link for downloading the complete translation as a single JSON file, using the simplified chapter format. Relative to the API origin. Undefined if complete translation files are not available.\r\n */\r\n simpleCompleteTranslationApiLink?: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a translation.\r\n */\r\nexport type ApiTranslationBooks = {\r\n /**\r\n * The translation information for the books.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The list of books that are available for the translation.\r\n */\r\n books: Array<ApiTranslationBook>;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a translation book.\r\n */\r\nexport type ApiTranslationBook = {\r\n id: BookId;\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.\r\n */\r\n title: string | null;\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: number;\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal?: boolean;\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: number;\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: string;\r\n firstChapterReference: TranslationChapterReference;\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: number;\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: string;\r\n lastChapterReference: TranslationChapterReference;\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines a reference to a chapter in a translation.\r\n */\r\nexport type TranslationChapterReference = {\r\n /**\r\n * The ID of the translation that the chapter reference is for.\r\n */\r\n translationId: string;\r\n book: BookId;\r\n /**\r\n * The chapter number of the chapter reference.\r\n */\r\n chapter: number;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter in a translation.\r\n */\r\nexport type ApiTranslationBookChapter = {\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<ChapterContent>;\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: Array<ChapterFootnote>;\r\n };\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: TranslationBookChapterAudioLinks;\r\n /**\r\n * The links to the audio timings for different audio versions for the chapter. Relative to the API origin.\r\n */\r\n thisChapterAudioTimings: {\r\n [key: string]: string;\r\n };\r\n /**\r\n * The translation information for the book chapter.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiTranslationBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: TranslationChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterReference: TranslationChapterReference | null;\r\n /**\r\n * The links to the audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioLinks: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The links to the audio timings for different audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioTimings: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The links to the audio timings for different audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioTimings: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterReference: TranslationChapterReference | null;\r\n /**\r\n * The links to the audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioLinks: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The link to the word-level annotations for this chapter. Relative to the API origin. Omitted if the chapter doesn't have any word-level annotations.\r\n */\r\n thisChapterWordsLink?: string;\r\n /**\r\n * The link to the word-level annotations for the next chapter. Relative to the API origin. Omitted if this is the last chapter in the translation, or if the next chapter doesn't have any word-level annotations.\r\n */\r\n nextChapterWordsLink?: string;\r\n /**\r\n * The link to the word-level annotations for the previous chapter. Relative to the API origin. Omitted if this is the first chapter in the translation, or if the previous chapter doesn't have any word-level annotations.\r\n */\r\n previousChapterWordsLink?: string;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n /**\r\n * The API link to the simplified version of this chapter. Relative to the API origin. Omitted if simplified chapters are not available.\r\n */\r\n simpleChapterApiLink?: string;\r\n};\r\n\r\n/**\r\n * Defines a union type that represents a single piece of chapter content. A piece of chapter content can be one of the following things: A heading, a line break, a verse, or a Hebrew Subtitle.\r\n */\r\nexport type ChapterContent =\r\n | ({\r\n type: 'heading';\r\n } & ChapterHeading)\r\n | ({\r\n type: 'line_break';\r\n } & ChapterLineBreak)\r\n | ({\r\n type: 'verse';\r\n } & ChapterVerse)\r\n | ({\r\n type: 'hebrew_subtitle';\r\n } & ChapterHebrewSubtitle);\r\n\r\n/**\r\n * Defines the schema for a heading in a chapter.\r\n */\r\nexport type ChapterHeading = {\r\n type: 'heading';\r\n /**\r\n * The content for the heading. If multiple strings are included in the array, they should be concatenated with a space.\r\n */\r\n content: Array<string>;\r\n};\r\n\r\n/**\r\n * Defines the schema for a line break in a chapter.\r\n */\r\nexport type ChapterLineBreak = {\r\n type: 'line_break';\r\n};\r\n\r\n/**\r\n * Defines the schema for a verse in a chapter.\r\n */\r\nexport type ChapterVerse = {\r\n type: 'verse';\r\n /**\r\n * The number of the verse.\r\n */\r\n number: number;\r\n /**\r\n * The list of content for the verse. Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: Array<\r\n | string\r\n | FormattedText\r\n | InlineHeading\r\n | InlineLineBreak\r\n | VerseFootnoteReference\r\n >;\r\n};\r\n\r\n/**\r\n * Defines the schema for formatted text. That is, text that is formatted in a particular manner.\r\n */\r\nexport type FormattedText = {\r\n /**\r\n * The text that is formatted.\r\n */\r\n text: string;\r\n /**\r\n * Whether the text represents a poem. The number indicates the level of indent. Common in Psalms.\r\n */\r\n poem?: number;\r\n /**\r\n * Whether the text represents the Words of Jesus.\r\n */\r\n wordsOfJesus?: boolean;\r\n};\r\n\r\n/**\r\n * Defines the schema for a heading that is embedded in a verse.\r\n */\r\nexport type InlineHeading = {\r\n /**\r\n * The text of the heading.\r\n */\r\n heading: string;\r\n};\r\n\r\n/**\r\n * Defines the schema for a line break that is embedded in a verse.\r\n */\r\nexport type InlineLineBreak = {\r\n lineBreak: true;\r\n};\r\n\r\n/**\r\n * Defines the schema for a footnote reference in a verse or a Hebrew Subtitle.\r\n */\r\nexport type VerseFootnoteReference = {\r\n /**\r\n * The ID of the note.\r\n */\r\n noteId: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for a Hebrew Subtitle in a chapter.\r\n */\r\nexport type ChapterHebrewSubtitle = {\r\n type: 'hebrew_subtitle';\r\n /**\r\n * The content that is contained in the subtitle. Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: Array<string | FormattedText | VerseFootnoteReference>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a footnote.\r\n */\r\nexport type ChapterFootnote = {\r\n /**\r\n * The ID of the note that is referenced.\r\n */\r\n noteId: number;\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: string;\r\n /**\r\n * The verse reference for the footnote. Undefined if the footnote isn't associated with a specific verse.\r\n */\r\n reference?: {\r\n chapter: number;\r\n verse: number;\r\n };\r\n /**\r\n * The caller that should be used for the footnote. For footnotes, a \"caller\" is the character that is used in the text to reference to footnote. For example, in the text: Hello (a) World ---- (a) This is a footnote. The \"(a)\" is the caller. If \"+\", then the caller should be autogenerated. If null, then the caller should be empty. If a string, then the caller should be that string.\r\n */\r\n caller: '+' | string | null;\r\n};\r\n\r\n/**\r\n * Defines the schema for the audio links for a book chapter.\r\n */\r\nexport type TranslationBookChapterAudioLinks = {\r\n [key: string]: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter in a translation, using the simplified chapter format.\r\n */\r\nexport type ApiSimpleTranslationBookChapter = {\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: TranslationBookChapterAudioLinks;\r\n /**\r\n * The links to the audio timings for different audio versions for the chapter. Relative to the API origin.\r\n */\r\n thisChapterAudioTimings: {\r\n [key: string]: string;\r\n };\r\n /**\r\n * The translation information for the book chapter.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiTranslationBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: TranslationChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterReference: TranslationChapterReference | null;\r\n /**\r\n * The links to the audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioLinks: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The links to the audio timings for different audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioTimings: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The links to the audio timings for different audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioTimings: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterReference: TranslationChapterReference | null;\r\n /**\r\n * The links to the audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioLinks: {\r\n [key: string]: string;\r\n } | null;\r\n /**\r\n * The link to the word-level annotations for this chapter. Relative to the API origin. Omitted if the chapter doesn't have any word-level annotations.\r\n */\r\n thisChapterWordsLink?: string;\r\n /**\r\n * The link to the word-level annotations for the next chapter. Relative to the API origin. Omitted if this is the last chapter in the translation, or if the next chapter doesn't have any word-level annotations.\r\n */\r\n nextChapterWordsLink?: string;\r\n /**\r\n * The link to the word-level annotations for the previous chapter. Relative to the API origin. Omitted if this is the first chapter in the translation, or if the previous chapter doesn't have any word-level annotations.\r\n */\r\n previousChapterWordsLink?: string;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n /**\r\n * The simplified information for the chapter. Each verse contains a single text string, and the footnotes and formatting are represented by offsets into that string.\r\n */\r\n chapter: SimpleChapterData;\r\n /**\r\n * The API link to the regular (non-simplified) version of this chapter. Relative to the API origin.\r\n */\r\n fullChapterApiLink: string;\r\n};\r\n\r\n/**\r\n * Defines the schema for the data in a simplified chapter. Unlike the regular chapter format, each verse contains a single text string and the footnotes/formatting are represented by offsets into that string.\r\n */\r\nexport type SimpleChapterData = {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<SimpleChapterContent>;\r\n /**\r\n * The list of footnotes that could not be associated with a verse. Footnotes that belong to a verse are included on the verse itself, so this list is usually empty.\r\n */\r\n footnotes: Array<ChapterFootnote>;\r\n};\r\n\r\n/**\r\n * Defines a union type that represents a single piece of content in a simplified chapter. A piece of chapter content can be one of the following things: A heading, a line break, a verse, or a Hebrew Subtitle.\r\n */\r\nexport type SimpleChapterContent =\r\n | ({\r\n type: 'heading';\r\n } & SimpleChapterHeading)\r\n | ({\r\n type: 'line_break';\r\n } & ChapterLineBreak)\r\n | ({\r\n type: 'verse';\r\n } & SimpleChapterVerse)\r\n | ({\r\n type: 'hebrew_subtitle';\r\n } & SimpleChapterHebrewSubtitle);\r\n\r\n/**\r\n * Defines the schema for a heading in a simplified chapter.\r\n */\r\nexport type SimpleChapterHeading = {\r\n type: 'heading';\r\n /**\r\n * The text of the heading.\r\n */\r\n text: string;\r\n};\r\n\r\n/**\r\n * Defines the schema for a verse in a simplified chapter.\r\n */\r\nexport type SimpleChapterVerse = {\r\n type: 'verse';\r\n /**\r\n * The number of the verse.\r\n */\r\n number: number;\r\n /**\r\n * The text of the verse. Lines of poetry and line breaks are separated by newline (\\n) characters.\r\n */\r\n text: string;\r\n /**\r\n * The footnotes that occur in the verse.\r\n */\r\n footnotes: Array<SimpleVerseFootnote>;\r\n /**\r\n * The headings that occur in the middle of the verse. Omitted if the verse contains no inline headings.\r\n */\r\n headings?: Array<SimpleInlineHeading>;\r\n /**\r\n * The ranges of the verse text that represent the Words of Jesus. Omitted if the verse contains none.\r\n */\r\n wordsOfJesus?: Array<SimpleTextRange>;\r\n /**\r\n * The ranges of the verse text that represent lines of poetry. Omitted if the verse contains none.\r\n */\r\n poem?: Array<SimplePoemRange>;\r\n};\r\n\r\n/**\r\n * Defines the schema for a footnote in a simplified verse. Unlike the footnotes in the regular chapter format, simplified footnotes include the position that they occur at in the verse text.\r\n */\r\nexport type SimpleVerseFootnote = {\r\n /**\r\n * The ID of the note.\r\n */\r\n noteId: number;\r\n /**\r\n * The index in the verse text that the footnote caller should be inserted at. Measured in UTF-16 code units.\r\n */\r\n offset: number;\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: string;\r\n /**\r\n * The caller that should be used for the footnote. If \"+\", then the caller should be autogenerated. If null, then the caller should be empty. If a string, then the caller should be that string.\r\n */\r\n caller: '+' | string | null;\r\n};\r\n\r\n/**\r\n * Defines the schema for a heading that is embedded in a simplified verse.\r\n */\r\nexport type SimpleInlineHeading = {\r\n /**\r\n * The index in the verse text that the heading occurs at. Measured in UTF-16 code units.\r\n */\r\n offset: number;\r\n /**\r\n * The text of the heading.\r\n */\r\n text: string;\r\n};\r\n\r\n/**\r\n * Defines the schema for a range of text inside a simplified verse. Ranges are expressed as offsets into the text of the verse that contains them, measured in UTF-16 code units.\r\n */\r\nexport type SimpleTextRange = {\r\n /**\r\n * The index of the first character of the range in the verse text. Measured in UTF-16 code units.\r\n */\r\n start: number;\r\n /**\r\n * The index after the last character of the range in the verse text. Measured in UTF-16 code units.\r\n */\r\n end: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for a range of text inside a simplified verse that represents a line of poetry.\r\n */\r\nexport type SimplePoemRange = {\r\n /**\r\n * The index of the first character of the range in the verse text. Measured in UTF-16 code units.\r\n */\r\n start: number;\r\n /**\r\n * The index after the last character of the range in the verse text. Measured in UTF-16 code units.\r\n */\r\n end: number;\r\n /**\r\n * The level of indent that the line of poetry should be displayed with.\r\n */\r\n level: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for a Hebrew Subtitle in a simplified chapter.\r\n */\r\nexport type SimpleChapterHebrewSubtitle = {\r\n /**\r\n * The text of the verse. Lines of poetry and line breaks are separated by newline (\\n) characters.\r\n */\r\n text: string;\r\n /**\r\n * The footnotes that occur in the verse.\r\n */\r\n footnotes: Array<SimpleVerseFootnote>;\r\n /**\r\n * The headings that occur in the middle of the verse. Omitted if the verse contains no inline headings.\r\n */\r\n headings?: Array<SimpleInlineHeading>;\r\n /**\r\n * The ranges of the verse text that represent the Words of Jesus. Omitted if the verse contains none.\r\n */\r\n wordsOfJesus?: Array<SimpleTextRange>;\r\n /**\r\n * The ranges of the verse text that represent lines of poetry. Omitted if the verse contains none.\r\n */\r\n poem?: Array<SimplePoemRange>;\r\n type: 'hebrew_subtitle';\r\n};\r\n\r\n/**\r\n * Defines an interface that contains the audio timings for a book chapter, for a specific reader.\r\n */\r\nexport type ApiTranslationBookChapterAudioTimings = {\r\n /**\r\n * The ID of the translation.\r\n */\r\n translationId: string;\r\n /**\r\n * The ID of the book.\r\n */\r\n bookId: string;\r\n /**\r\n * The number of the chapter.\r\n */\r\n chapterNumber: number;\r\n /**\r\n * The reader for the chapter.\r\n */\r\n reader: string;\r\n /**\r\n * The link to the audio for these timings.\r\n */\r\n audioLink: string;\r\n /**\r\n * The link to the information for this chapter.\r\n */\r\n thisChapterLink: string;\r\n /**\r\n * The link to the information for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterLink: string | null;\r\n /**\r\n * The link to the information for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterLink: string | null;\r\n /**\r\n * The link to this audio timings file.\r\n */\r\n thisChapterAudioTimingsLink: string;\r\n /**\r\n * The link to the timings for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioTimingsLink: string | null;\r\n /**\r\n * The link to the timings for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioTimingsLink: string | null;\r\n /**\r\n * The times in seconds at which each verse starts, in order. The first number (index 0) is the time in the recording at which the first verse starts.\r\n */\r\n verses: Array<number>;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains the word-level annotations for a book chapter.\r\n */\r\nexport type ApiTranslationBookChapterWords = {\r\n /**\r\n * The ID of the translation.\r\n */\r\n translationId: string;\r\n /**\r\n * The ID of the book.\r\n */\r\n bookId: string;\r\n /**\r\n * The number of the chapter.\r\n */\r\n chapterNumber: number;\r\n /**\r\n * The link to the information for this chapter.\r\n */\r\n thisChapterLink: string;\r\n /**\r\n * The link to the information for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterLink: string | null;\r\n /**\r\n * The link to the information for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterLink: string | null;\r\n /**\r\n * The link to this words file.\r\n */\r\n thisChapterWordsLink: string;\r\n /**\r\n * The link to the words for the next chapter. Null if this is the last chapter in the translation, or if the next chapter doesn't have any word-level annotations.\r\n */\r\n nextChapterWordsLink: string | null;\r\n /**\r\n * The link to the words for the previous chapter. Null if this is the first chapter in the translation, or if the previous chapter doesn't have any word-level annotations.\r\n */\r\n previousChapterWordsLink: string | null;\r\n /**\r\n * The annotated words for each verse in the chapter, keyed by verse number. Each list is in the order that the words occur in the verse.\r\n */\r\n verses: {\r\n [key: string]: Array<ChapterWord>;\r\n };\r\n};\r\n\r\n/**\r\n * Defines the schema for a word-level annotation in a chapter. The annotation is anchored to a range of characters in a single item of a verse's content.\r\n */\r\nexport type ChapterWord = {\r\n /**\r\n * The index of the item in the verse's content array that the annotation applies to.\r\n */\r\n contentIndex: number;\r\n /**\r\n * The index of the first character of the annotated word in the content item's text.\r\n */\r\n start: number;\r\n /**\r\n * The index after the last character of the annotated word in the content item's text. That is, text.slice(start, end) is the annotated word.\r\n */\r\n end: number;\r\n /**\r\n * The Strong's number(s) for the word. Omitted if the translation only provided other annotations for the word.\r\n */\r\n strongs?: Array<string>;\r\n /**\r\n * The dictionary (citation) form of the word. Omitted if the translation did not provide one.\r\n */\r\n lemma?: string;\r\n /**\r\n * The morphology parse code for the word. Omitted if the translation did not provide one.\r\n */\r\n morph?: string;\r\n /**\r\n * The pointer to the word in the source text, in the <sourceName>:<location> format. Omitted if the translation did not provide one.\r\n */\r\n srcloc?: string;\r\n /**\r\n * Which occurrence of the source word this word is. 1-based. Omitted if the translation did not provide one.\r\n */\r\n occurrence?: number;\r\n /**\r\n * The total number of times that the source word occurs. Omitted if the translation did not provide one.\r\n */\r\n occurrences?: number;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains the word-level annotations for a book chapter, with their offsets remapped onto the text of each simplified verse.\r\n */\r\nexport type ApiSimpleTranslationBookChapterWords = {\r\n /**\r\n * The ID of the translation.\r\n */\r\n translationId: string;\r\n /**\r\n * The ID of the book.\r\n */\r\n bookId: string;\r\n /**\r\n * The number of the chapter.\r\n */\r\n chapterNumber: number;\r\n /**\r\n * The link to the information for this chapter.\r\n */\r\n thisChapterLink: string;\r\n /**\r\n * The link to the information for the next chapter. Null if this is the last chapter in the translation.\r\n */\r\n nextChapterLink: string | null;\r\n /**\r\n * The link to the information for the previous chapter. Null if this is the first chapter in the translation.\r\n */\r\n previousChapterLink: string | null;\r\n /**\r\n * The link to this words file.\r\n */\r\n thisChapterWordsLink: string;\r\n /**\r\n * The link to the words for the next chapter. Null if this is the last chapter in the translation, or if the next chapter doesn't have any word-level annotations.\r\n */\r\n nextChapterWordsLink: string | null;\r\n /**\r\n * The link to the words for the previous chapter. Null if this is the first chapter in the translation, or if the previous chapter doesn't have any word-level annotations.\r\n */\r\n previousChapterWordsLink: string | null;\r\n /**\r\n * The annotated words for each verse in the chapter, keyed by verse number. Each list is in the order that the words occur in the verse. The offsets are into the text of the simplified verse.\r\n */\r\n verses: {\r\n [key: string]: Array<SimpleChapterWord>;\r\n };\r\n};\r\n\r\n/**\r\n * Defines the schema for a word-level annotation in a simplified chapter. The annotation is anchored to a range of characters in the verse's text.\r\n */\r\nexport type SimpleChapterWord = {\r\n /**\r\n * The index of the first character of the annotated word in the content item's text.\r\n */\r\n start: number;\r\n /**\r\n * The index after the last character of the annotated word in the content item's text. That is, text.slice(start, end) is the annotated word.\r\n */\r\n end: number;\r\n /**\r\n * The Strong's number(s) for the word. Omitted if the translation only provided other annotations for the word.\r\n */\r\n strongs?: Array<string>;\r\n /**\r\n * The dictionary (citation) form of the word. Omitted if the translation did not provide one.\r\n */\r\n lemma?: string;\r\n /**\r\n * The morphology parse code for the word. Omitted if the translation did not provide one.\r\n */\r\n morph?: string;\r\n /**\r\n * The pointer to the word in the source text, in the <sourceName>:<location> format. Omitted if the translation did not provide one.\r\n */\r\n srcloc?: string;\r\n /**\r\n * Which occurrence of the source word this word is. 1-based. Omitted if the translation did not provide one.\r\n */\r\n occurrence?: number;\r\n /**\r\n * The total number of times that the source word occurs. Omitted if the translation did not provide one.\r\n */\r\n occurrences?: number;\r\n};\r\n\r\n/**\r\n * Defines the complete translation download data. Maps to the /api/:translationId/complete.json endpoint.\r\n */\r\nexport type ApiTranslationComplete = {\r\n /**\r\n * The translation metadata.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The complete list of books with all their chapters.\r\n */\r\n books: Array<ApiTranslationCompleteBook>;\r\n};\r\n\r\n/**\r\n * A book in the complete translation download.\r\n */\r\nexport type ApiTranslationCompleteBook = {\r\n id: BookId;\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.\r\n */\r\n title: string | null;\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: number;\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal?: boolean;\r\n /**\r\n * The number of chapters in the book.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The total number of verses in the book.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The complete list of chapters with all content.\r\n */\r\n chapters: Array<TranslationCompleteChapter>;\r\n};\r\n\r\n/**\r\n * A chapter in the complete translation download.\r\n */\r\nexport type TranslationCompleteChapter = {\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<ChapterContent>;\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: Array<ChapterFootnote>;\r\n };\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: TranslationBookChapterAudioLinks;\r\n /**\r\n * The audio timings (per-verse start times, in seconds) for different audio versions for the chapter.\r\n */\r\n thisChapterAudioTimings: TranslationBookChapterAudioTimings;\r\n /**\r\n * The word-level annotations (Strong's numbers and related source data) for the chapter's verses. Omitted if the translation doesn't have any word-level annotations for the chapter.\r\n */\r\n thisChapterWords?: TranslationBookChapterWords;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for the audio timings for a book chapter. Maps a reader ID to the list of times (in seconds) that each verse starts, in verse order.\r\n */\r\nexport type TranslationBookChapterAudioTimings = {\r\n [key: string]: Array<number>;\r\n};\r\n\r\n/**\r\n * Defines the schema for the word-level annotations for a book chapter. Maps a verse number to the list of annotated words in the verse, in order.\r\n */\r\nexport type TranslationBookChapterWords = {\r\n [key: string]: Array<ChapterWord>;\r\n};\r\n\r\n/**\r\n * Defines the complete translation download data, using the simplified chapter format. Maps to the /api/:translationId/complete.simple.json endpoint.\r\n */\r\nexport type ApiSimpleTranslationComplete = {\r\n /**\r\n * The translation metadata.\r\n */\r\n translation: ApiTranslation;\r\n /**\r\n * The complete list of books with all their chapters.\r\n */\r\n books: Array<ApiSimpleTranslationCompleteBook>;\r\n};\r\n\r\n/**\r\n * A book in the complete translation download, using the simplified chapter format.\r\n */\r\nexport type ApiSimpleTranslationCompleteBook = {\r\n id: BookId;\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.\r\n */\r\n title: string | null;\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: number;\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal?: boolean;\r\n /**\r\n * The number of chapters in the book.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The total number of verses in the book.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The complete list of chapters with all content.\r\n */\r\n chapters: Array<SimpleTranslationCompleteChapter>;\r\n};\r\n\r\n/**\r\n * A chapter in the complete translation download, using the simplified chapter format.\r\n */\r\nexport type SimpleTranslationCompleteChapter = {\r\n /**\r\n * The simplified information for the chapter.\r\n */\r\n chapter: SimpleChapterData;\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: TranslationBookChapterAudioLinks;\r\n /**\r\n * The audio timings (per-verse start times, in seconds) for different audio versions for the chapter.\r\n */\r\n thisChapterAudioTimings: TranslationBookChapterAudioTimings;\r\n /**\r\n * The word-level annotations (Strong's numbers and related source data) for the chapter's verses, with their offsets remapped onto the simplified verse text. Omitted if the translation doesn't have any word-level annotations for the chapter.\r\n */\r\n thisChapterWords?: SimpleTranslationBookChapterWords;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for the word-level annotations for a book chapter, using the simplified format. Maps a verse number to the list of annotated words in the verse, in order.\r\n */\r\nexport type SimpleTranslationBookChapterWords = {\r\n [key: string]: Array<SimpleChapterWord>;\r\n};\r\n\r\n/**\r\n * The list of available commentaries. Maps to the /api/available-commentaries.json endpoint.\r\n */\r\nexport type ApiAvailableCommentaries = {\r\n /**\r\n * The list of commentaries that are available in the API.\r\n */\r\n commentaries: Array<ApiCommentary>;\r\n};\r\n\r\n/**\r\n * Defines a commentary that is used in the API.\r\n */\r\nexport type ApiCommentary = {\r\n /**\r\n * The ID of the commentary.\r\n */\r\n id: string;\r\n /**\r\n * The name of the commentary.\r\n */\r\n name: string;\r\n /**\r\n * The website for the commentary.\r\n */\r\n website: string;\r\n /**\r\n * The URL that the license for the commentary can be found.\r\n */\r\n licenseUrl: string;\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes?: string | null;\r\n /**\r\n * The English name for the commentary.\r\n */\r\n englishName: string;\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: string;\r\n /**\r\n * The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: 'ltr' | 'rtl';\r\n /**\r\n * The API link for the list of books for this commentary. Relative to the API origin.\r\n */\r\n listOfBooksApiLink: string;\r\n /**\r\n * The API link for the list of profiles for this commentary. Relative to the API origin.\r\n */\r\n listOfProfilesApiLink: string;\r\n availableFormats: Array<'json' | 'usfm'>;\r\n /**\r\n * The number of books that are contained in this commentary. Complete commentaries should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: number;\r\n /**\r\n * The total number of chapters that are contained in this commentary. Complete commentaries should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: number;\r\n /**\r\n * The total number of verses that are contained in this commentary. Complete commentaries should have the same number of verses as the Bible (around 31,102 - some commentaries exclude verses based on the aparent likelyhood of existing in the original source texts).\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The total number of profiles that are contained in this commentary. Profiles are used to provide additional information about people and people groups that are mentioned in the Bible.\r\n */\r\n totalNumberOfProfiles: number;\r\n /**\r\n * Gets the name of the language that the commentary is in. Null or undefined if the name of the language is not known.\r\n */\r\n languageName?: string;\r\n /**\r\n * Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName?: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a commentary.\r\n */\r\nexport type ApiCommentaryBooks = {\r\n /**\r\n * The commentary information for the books.\r\n */\r\n commentary: ApiCommentary;\r\n /**\r\n * The list of books that are available for the commentary.\r\n */\r\n books: Array<ApiCommentaryBook>;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a commentary book.\r\n */\r\nexport type ApiCommentaryBook = {\r\n id: BookId;\r\n /**\r\n * The name that the commentary provided for the book.\r\n */\r\n name: string;\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: string;\r\n /**\r\n * The commentary's introduction for the book. Undefined if the commentary didn't provide an introduction for the book.\r\n */\r\n introduction?: string;\r\n /**\r\n * The summary of the commentary's introduction for the book. Undefined if the commentary didn't provide a summary for the book.\r\n */\r\n introductionSummary?: string;\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: number;\r\n /**\r\n * The number of the first chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n firstChapterNumber: number | null;\r\n /**\r\n * The link to the first chapter of the book. Null if the comentary book has no chapters.\r\n */\r\n firstChapterApiLink: string | null;\r\n /**\r\n * The reference for the first chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n firstChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of the last chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n lastChapterNumber: number | null;\r\n /**\r\n * The link to the last chapter of the book. Null if the comentary book has no chapters.\r\n */\r\n lastChapterApiLink: string | null;\r\n /**\r\n * The reference for the last chapter in the book. Null if the comentary book has no chapters.\r\n */\r\n lastChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: number;\r\n};\r\n\r\n/**\r\n * Defines a reference to a chapter in a commentary.\r\n */\r\nexport type CommentaryChapterReference = {\r\n /**\r\n * The ID of the commentary that the chapter reference is for.\r\n */\r\n commentaryId: string;\r\n book: BookId;\r\n /**\r\n * The chapter number of the chapter reference.\r\n */\r\n chapter: number;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book chapter in a commentary.\r\n */\r\nexport type ApiCommentaryBookChapter = {\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The introduction that the commentary provided to the chapter. Not all commentaries provide an introduction to a chapter.\r\n */\r\n introduction?: string;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<ChapterVerse>;\r\n };\r\n /**\r\n * The commentary information for the book chapter.\r\n */\r\n commentary: ApiCommentary;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiCommentaryBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: CommentaryChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the commentary.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the commentary.\r\n */\r\n nextChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the commentary.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the commentary.\r\n */\r\n previousChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n /**\r\n * The API link to the simplified version of this chapter. Relative to the API origin. Omitted if simplified chapters are not available.\r\n */\r\n simpleChapterApiLink?: string;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book chapter in a commentary, using the simplified chapter format.\r\n */\r\nexport type ApiSimpleCommentaryBookChapter = {\r\n /**\r\n * The commentary information for the book chapter.\r\n */\r\n commentary: ApiCommentary;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiCommentaryBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: CommentaryChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the commentary.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the commentary.\r\n */\r\n nextChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the commentary.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the commentary.\r\n */\r\n previousChapterReference: CommentaryChapterReference | null;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n /**\r\n * The simplified information for the chapter. Each verse contains a single text string, and the footnotes and formatting are represented by offsets into that string.\r\n */\r\n chapter: SimpleCommentaryChapterData;\r\n /**\r\n * The API link to the regular (non-simplified) version of this chapter. Relative to the API origin.\r\n */\r\n fullChapterApiLink: string;\r\n};\r\n\r\n/**\r\n * Defines the schema for the data in a simplified commentary chapter.\r\n */\r\nexport type SimpleCommentaryChapterData = {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The introduction that the commentary provided to the chapter. Not all commentaries provide an introduction to a chapter.\r\n */\r\n introduction?: string;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<SimpleChapterVerse>;\r\n};\r\n\r\n/**\r\n * The list of available datasets. Maps to the /api/available-datasets.json endpoint.\r\n */\r\nexport type ApiAvailableDatasets = {\r\n /**\r\n * The list of datasets that are available in the API.\r\n */\r\n datasets: Array<ApiDataset>;\r\n};\r\n\r\n/**\r\n * Defines a dataset that is used in the API.\r\n */\r\nexport type ApiDataset = {\r\n /**\r\n * The ID of the dataset.\r\n */\r\n id: string;\r\n /**\r\n * The name of the dataset.\r\n */\r\n name: string;\r\n /**\r\n * The website for the dataset.\r\n */\r\n website: string;\r\n /**\r\n * The URL that the license for the dataset can be found.\r\n */\r\n licenseUrl: string;\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes?: string | null;\r\n /**\r\n * The English name for the dataset.\r\n */\r\n englishName: string;\r\n /**\r\n * The ISO 639 3-letter language tag that the dataset is primarily in.\r\n */\r\n language: string;\r\n /**\r\n * The direction that the language is written in.\r\n */\r\n textDirection: 'ltr' | 'rtl';\r\n /**\r\n * The API link for the list of books for this dataset. Relative to the API origin.\r\n */\r\n listOfBooksApiLink: string;\r\n availableFormats: Array<'json'>;\r\n /**\r\n * The number of books that are contained in this dataset.\r\n */\r\n numberOfBooks: number;\r\n /**\r\n * The total number of chapters that are contained in this dataset.\r\n */\r\n totalNumberOfChapters: number;\r\n /**\r\n * The total number of verses that are contained in this dataset.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The total number of references that are contained in this dataset.\r\n */\r\n totalNumberOfReferences: number;\r\n /**\r\n * Gets the name of the language that the dataset is in. Null or undefined if the name of the language is not known.\r\n */\r\n languageName?: string;\r\n /**\r\n * Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName?: string;\r\n};\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a dataset.\r\n */\r\nexport type ApiDatasetBooks = {\r\n /**\r\n * The dataset information for the books.\r\n */\r\n dataset: ApiDataset;\r\n /**\r\n * The list of books that are available for the dataset.\r\n */\r\n books: Array<ApiDatasetBook>;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book in a dataset.\r\n */\r\nexport type ApiDatasetBook = {\r\n id: BookId;\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: number;\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: number;\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: string;\r\n firstChapterReference: DatasetChapterReference;\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: number;\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: string;\r\n lastChapterReference: DatasetChapterReference;\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: number;\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: number;\r\n /**\r\n * The number of references that the book contains.\r\n */\r\n totalNumberOfReferences: number;\r\n};\r\n\r\n/**\r\n * Defines a reference to a chapter in a dataset.\r\n */\r\nexport type DatasetChapterReference = {\r\n /**\r\n * The ID of the dataset that the chapter reference is for.\r\n */\r\n datasetId: string;\r\n book: BookId;\r\n /**\r\n * The chapter number of the chapter reference.\r\n */\r\n chapter: number;\r\n};\r\n\r\n/**\r\n * Defines a schema that contains information about a book chapter in a dataset.\r\n */\r\nexport type ApiDatasetBookChapter = {\r\n /**\r\n * The data for the chapter.\r\n */\r\n chapter: DatasetChapterData;\r\n /**\r\n * The dataset information for the book chapter.\r\n */\r\n dataset: ApiDataset;\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: ApiDatasetBook;\r\n /**\r\n * The API link for this chapter. Relative to the API origin.\r\n */\r\n thisChapterLink: string;\r\n thisChapterReference: DatasetChapterReference;\r\n /**\r\n * The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the dataset.\r\n */\r\n nextChapterApiLink: string | null;\r\n /**\r\n * The reference for the next chapter. Null if this is the last chapter in the dataset.\r\n */\r\n nextChapterReference: DatasetChapterReference | null;\r\n /**\r\n * The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the dataset.\r\n */\r\n previousChapterApiLink: string | null;\r\n /**\r\n * The reference for the previous chapter. Null if this is the first chapter in the dataset.\r\n */\r\n previousChapterReference: DatasetChapterReference | null;\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: number;\r\n /**\r\n * The number of references that the chapter contains.\r\n */\r\n numberOfReferences: number;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a chapter in a dataset.\r\n */\r\nexport type DatasetChapterData = {\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: number;\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: Array<DatasetChapterVerseContent>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a verse in a dataset chapter.\r\n */\r\nexport type DatasetChapterVerseContent = {\r\n /**\r\n * The number of the verse.\r\n */\r\n verse: number;\r\n /**\r\n * The list of references for the verse.\r\n */\r\n references: Array<ScoredVerseRef>;\r\n};\r\n\r\n/**\r\n * Defines the schema for information about a verse reference that has an arbitrary score attached to it.\r\n */\r\nexport type ScoredVerseRef = {\r\n book: BookId;\r\n /**\r\n * The chapter number that the reference starts at.\r\n */\r\n chapter: number;\r\n /**\r\n * The verse number that the reference starts at.\r\n */\r\n verse: number;\r\n /**\r\n * The rest of the content of the verse reference. This is the part of the string that comes after the verse reference. For example, in \"GEN 1:1 In the beginning, God created the Heavens and the Earth.\", the content would be \"In the beginning, God created the Heavens and the Earth.\"\r\n */\r\n content?: string;\r\n /**\r\n * The chapter that the verse reference ends at. This is used for references that span multiple chapters, such as \"GEN 1:1-2:3\". In this case, the endChapter would be 2.\r\n */\r\n endChapter?: number;\r\n /**\r\n * The verse that the verse reference ends at. This is used for references that span multiple verses, such as \"GEN 1:1-1:3\". In this case, the endVerse would be 3.\r\n */\r\n endVerse?: number;\r\n /**\r\n * The score for the verse reference. The meaning of the score is arbitrary and is determined by the dataset.\r\n */\r\n score: number;\r\n};\r\n\r\nexport type GetAvailableTranslationsData = {\r\n body?: never;\r\n path?: never;\r\n query?: never;\r\n url: '/api/available_translations.json';\r\n};\r\n\r\nexport type GetAvailableTranslationsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiAvailableTranslations;\r\n};\r\n\r\nexport type GetAvailableTranslationsResponse =\r\n GetAvailableTranslationsResponses[keyof GetAvailableTranslationsResponses];\r\n\r\nexport type GetTranslationBooksData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/books.json';\r\n};\r\n\r\nexport type GetTranslationBooksErrors = {\r\n /**\r\n * 404 Not Found - The specified translation was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationBooksResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationBooks;\r\n};\r\n\r\nexport type GetTranslationBooksResponse =\r\n GetTranslationBooksResponses[keyof GetTranslationBooksResponses];\r\n\r\nexport type GetTranslationBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/{book}/{chapter}.json';\r\n};\r\n\r\nexport type GetTranslationBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified translation, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationBookChapter;\r\n};\r\n\r\nexport type GetTranslationBookChapterResponse =\r\n GetTranslationBookChapterResponses[keyof GetTranslationBookChapterResponses];\r\n\r\nexport type GetSimpleTranslationBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/{book}/{chapter}.simple.json';\r\n};\r\n\r\nexport type GetSimpleTranslationBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified translation, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetSimpleTranslationBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiSimpleTranslationBookChapter;\r\n};\r\n\r\nexport type GetSimpleTranslationBookChapterResponse =\r\n GetSimpleTranslationBookChapterResponses[keyof GetSimpleTranslationBookChapterResponses];\r\n\r\nexport type GetTranslationBookChapterAudioTimingsData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n /**\r\n * The ID of the reader to get the audio timings for. For example, \"hays\" for the Hays reading of the Berean Standard Bible.\r\n */\r\n reader: string;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/{book}/{chapter}.{reader}.audioTimings.json';\r\n};\r\n\r\nexport type GetTranslationBookChapterAudioTimingsErrors = {\r\n /**\r\n * 404 Not Found - The specified translation, book, chapter, or reader was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationBookChapterAudioTimingsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationBookChapterAudioTimings;\r\n};\r\n\r\nexport type GetTranslationBookChapterAudioTimingsResponse =\r\n GetTranslationBookChapterAudioTimingsResponses[keyof GetTranslationBookChapterAudioTimingsResponses];\r\n\r\nexport type GetTranslationBookChapterWordsData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/{book}/{chapter}.words.json';\r\n};\r\n\r\nexport type GetTranslationBookChapterWordsErrors = {\r\n /**\r\n * 404 Not Found - The specified translation, book, or chapter was not found, or the chapter does not have any word-level annotations.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationBookChapterWordsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationBookChapterWords;\r\n};\r\n\r\nexport type GetTranslationBookChapterWordsResponse =\r\n GetTranslationBookChapterWordsResponses[keyof GetTranslationBookChapterWordsResponses];\r\n\r\nexport type GetSimpleTranslationBookChapterWordsData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/{book}/{chapter}.words.simple.json';\r\n};\r\n\r\nexport type GetSimpleTranslationBookChapterWordsErrors = {\r\n /**\r\n * 404 Not Found - The specified translation, book, or chapter was not found, or the chapter does not have any word-level annotations.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetSimpleTranslationBookChapterWordsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiSimpleTranslationBookChapterWords;\r\n};\r\n\r\nexport type GetSimpleTranslationBookChapterWordsResponse =\r\n GetSimpleTranslationBookChapterWordsResponses[keyof GetSimpleTranslationBookChapterWordsResponses];\r\n\r\nexport type GetTranslationCompleteData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/complete.json';\r\n};\r\n\r\nexport type GetTranslationCompleteErrors = {\r\n /**\r\n * 404 Not Found - The specified translation was not found, or complete translations are not available.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetTranslationCompleteResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiTranslationComplete;\r\n};\r\n\r\nexport type GetTranslationCompleteResponse =\r\n GetTranslationCompleteResponses[keyof GetTranslationCompleteResponses];\r\n\r\nexport type GetSimpleTranslationCompleteData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The translation ID of the Bible translation to get the books for. For example, \"eng_kjv\" for the King James Version.\r\n */\r\n translation: string;\r\n };\r\n query?: never;\r\n url: '/api/{translation}/complete.simple.json';\r\n};\r\n\r\nexport type GetSimpleTranslationCompleteErrors = {\r\n /**\r\n * 404 Not Found - The specified translation was not found, or complete translations are not available.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetSimpleTranslationCompleteResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiSimpleTranslationComplete;\r\n};\r\n\r\nexport type GetSimpleTranslationCompleteResponse =\r\n GetSimpleTranslationCompleteResponses[keyof GetSimpleTranslationCompleteResponses];\r\n\r\nexport type GetAvailableCommentariesData = {\r\n body?: never;\r\n path?: never;\r\n query?: never;\r\n url: '/api/available_commentaries.json';\r\n};\r\n\r\nexport type GetAvailableCommentariesResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiAvailableCommentaries;\r\n};\r\n\r\nexport type GetAvailableCommentariesResponse =\r\n GetAvailableCommentariesResponses[keyof GetAvailableCommentariesResponses];\r\n\r\nexport type GetCommentaryBooksData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The commentary ID of the commentary to get the books or chapter content for.\r\n */\r\n commentary: string;\r\n };\r\n query?: never;\r\n url: '/api/c/{commentary}/books.json';\r\n};\r\n\r\nexport type GetCommentaryBooksErrors = {\r\n /**\r\n * 404 Not Found - The specified commentary was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetCommentaryBooksResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiCommentaryBooks;\r\n};\r\n\r\nexport type GetCommentaryBooksResponse =\r\n GetCommentaryBooksResponses[keyof GetCommentaryBooksResponses];\r\n\r\nexport type GetCommentaryBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The commentary ID of the commentary to get the books or chapter content for.\r\n */\r\n commentary: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/c/{commentary}/{book}/{chapter}.json';\r\n};\r\n\r\nexport type GetCommentaryBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified commentary, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetCommentaryBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiCommentaryBookChapter;\r\n};\r\n\r\nexport type GetCommentaryBookChapterResponse =\r\n GetCommentaryBookChapterResponses[keyof GetCommentaryBookChapterResponses];\r\n\r\nexport type GetSimpleCommentaryBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The commentary ID of the commentary to get the books or chapter content for.\r\n */\r\n commentary: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/c/{commentary}/{book}/{chapter}.simple.json';\r\n};\r\n\r\nexport type GetSimpleCommentaryBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified commentary, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetSimpleCommentaryBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiSimpleCommentaryBookChapter;\r\n};\r\n\r\nexport type GetSimpleCommentaryBookChapterResponse =\r\n GetSimpleCommentaryBookChapterResponses[keyof GetSimpleCommentaryBookChapterResponses];\r\n\r\nexport type GetAvailableDatasetsData = {\r\n body?: never;\r\n path?: never;\r\n query?: never;\r\n url: '/api/available_datasets.json';\r\n};\r\n\r\nexport type GetAvailableDatasetsResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiAvailableDatasets;\r\n};\r\n\r\nexport type GetAvailableDatasetsResponse =\r\n GetAvailableDatasetsResponses[keyof GetAvailableDatasetsResponses];\r\n\r\nexport type GetDatasetBooksData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The dataset ID of the dataset to get the books or chapter content for.\r\n */\r\n dataset: string;\r\n };\r\n query?: never;\r\n url: '/api/d/{dataset}/books.json';\r\n};\r\n\r\nexport type GetDatasetBooksErrors = {\r\n /**\r\n * 404 Not Found - The specified dataset was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetDatasetBooksResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiDatasetBooks;\r\n};\r\n\r\nexport type GetDatasetBooksResponse =\r\n GetDatasetBooksResponses[keyof GetDatasetBooksResponses];\r\n\r\nexport type GetDatasetBookChapterData = {\r\n body?: never;\r\n path: {\r\n /**\r\n * The dataset ID of the dataset to get the books or chapter content for.\r\n */\r\n dataset: string;\r\n /**\r\n * IDs for books. Follows the USFM standard (https://ubsicap.github.io/usfm/identification/books.html)\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number to get the content for. This should be a positive integer.\r\n */\r\n chapter: number;\r\n };\r\n query?: never;\r\n url: '/api/d/{dataset}/{book}/{chapter}.json';\r\n};\r\n\r\nexport type GetDatasetBookChapterErrors = {\r\n /**\r\n * 404 Not Found - The specified dataset, book, or chapter was not found.\r\n */\r\n 404: unknown;\r\n};\r\n\r\nexport type GetDatasetBookChapterResponses = {\r\n /**\r\n * 200 OK\r\n */\r\n 200: ApiDatasetBookChapter;\r\n};\r\n\r\nexport type GetDatasetBookChapterResponse =\r\n GetDatasetBookChapterResponses[keyof GetDatasetBookChapterResponses];\r\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|