Skip to content

@gracious.tech/fetch-client


@gracious.tech/fetch-client / client / FetchClient

Class: FetchClient ​

Defined in: client/src/client.ts:67

A client for interacting with a fetch(bible) CDN

Constructors ​

Constructor ​

new FetchClient(config?): FetchClient

Defined in: client/src/client.ts:87

Create a new FetchClient, defaulting to the official fetch(bible) collection

Parameters ​

config? ​

FetchClientConfig = {}

Returns ​

FetchClient

Properties ​

collection ​

collection: FetchCollection | undefined

Defined in: client/src/client.ts:82

Synchronous access to collection if it has already been fetched with fetch_collection()


requester ​

requester: RequestHandler

Defined in: client/src/client.ts:84

Access to request handler and its caching methods

Methods ​

fetch_collection() ​

fetch_collection(): Promise<FetchCollection>

Defined in: client/src/client.ts:95

Fetch the collection’s manifest and return a FetchCollection object for interacting with it

Returns ​

Promise<FetchCollection>


fetch_book() ​

Call Signature ​

fetch_book(resource, book, format?): Promise<BibleBookHtml>

Defined in: client/src/client.ts:113

Manually fetch contents of book for a translation without needing to request FetchCollection

Parameters ​
resource ​

string

book ​

string

format? ​

"html"

Returns ​

Promise<BibleBookHtml>

Call Signature ​

fetch_book(resource, book, format): Promise<BibleBookUsx>

Defined in: client/src/client.ts:114

Manually fetch contents of book for a translation without needing to request FetchCollection

Parameters ​
resource ​

string

book ​

string

format ​

"usx"

Returns ​

Promise<BibleBookUsx>

Call Signature ​

fetch_book(resource, book, format): Promise<BibleBookUsfm>

Defined in: client/src/client.ts:115

Manually fetch contents of book for a translation without needing to request FetchCollection

Parameters ​
resource ​

string

book ​

string

format ​

"usfm"

Returns ​

Promise<BibleBookUsfm>

Call Signature ​

fetch_book(resource, book, format): Promise<BibleBookTxt>

Defined in: client/src/client.ts:116

Manually fetch contents of book for a translation without needing to request FetchCollection

Parameters ​
resource ​

string

book ​

string

format ​

"txt"

Returns ​

Promise<BibleBookTxt>


fetch_translation_extras() ​

fetch_translation_extras(resource): Promise<TranslationExtra>

Defined in: client/src/client.ts:133

Manually fetch extra metadata for a translation without needing to request FetchCollection

Parameters ​

resource ​

string

Returns ​

Promise<TranslationExtra>


fetch_glosses() ​

fetch_glosses(resource, book): Promise<GlossesBook>

Defined in: client/src/client.ts:142

Manually fetch glosses for book without needing to request FetchCollection

Parameters ​

resource ​

string

book ​

string

Returns ​

Promise<GlossesBook>


fetch_notes() ​

fetch_notes(resource, book, format?): Promise<NotesBook>

Defined in: client/src/client.ts:149

Manually fetch study notes for book without needing to request FetchCollection

Parameters ​

resource ​

string

book ​

string

format? ​

"html" | "txt"

Returns ​

Promise<NotesBook>


fetch_crossref() ​

fetch_crossref(book, size?): Promise<BookCrossref>

Defined in: client/src/client.ts:156

Fetch cross-reference data for a book

Parameters ​

book ​

string

size? ​

"small" | "medium" | "large"

Returns ​

Promise<BookCrossref>


fetch_sections() ​

fetch_sections(): Promise<SectionData>

Defined in: client/src/client.ts:164

Fetch section data (importance/popularity), a translation-independent resource

Returns ​

Promise<SectionData>


fetch_search(id, format): Promise<SearchWords>

Defined in: client/src/client.ts:172

Fetch search data for a testament

Parameters ​

id ​

string

format ​

"strongs" | "original"

Returns ​

Promise<SearchWords>