Skip to content

@gracious.tech/fetch-client


@gracious.tech/fetch-client / collection/notes / NotesCollection

Class: NotesCollection

Defined in: client/src/collection/notes.ts:6

Extends

Constructors

Constructor

new NotesCollection(items, requester, languages, language2to3, languages_most_spoken, usage): NotesCollection

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

Parameters

items

Record<string, RuntimeManifestItem>

requester

RequestHandler

languages

Record<string, MetaLanguage>

language2to3

Record<string, string>

languages_most_spoken

string[]

usage

UsageConfig

Returns

NotesCollection

Inherited from

GenericCollection.constructor

Properties

requester

requester: RequestHandler

Defined in: client/src/collection/generic.ts:140

Inherited from

GenericCollection.requester

Methods

has_language()

has_language(language): boolean

Defined in: client/src/collection/generic.ts:181

Check if a language exists (must be 3 character id)

Parameters

language

string

Returns

boolean

Inherited from

GenericCollection.has_language


has_resource()

has_resource(resource): boolean

Defined in: client/src/collection/generic.ts:186

Check if a resource exists

Parameters

resource

string

Returns

boolean

Inherited from

GenericCollection.has_resource


has_book()

has_book(resource, book): boolean

Defined in: client/src/collection/generic.ts:191

Check if a book exists within a resource

Parameters

resource

string

book

string

Returns

boolean

Inherited from

GenericCollection.has_book


get_language()

get_language(code): GetLanguagesItem | undefined

Defined in: client/src/collection/generic.ts:199

Get a language’s metadata

Parameters

code

string

Returns

GetLanguagesItem | undefined

Inherited from

GenericCollection.get_language


get_languages()

Call Signature

get_languages(options): Record<string, GetLanguagesItem>

Defined in: client/src/collection/generic.ts:215

Get available languages as either a list or an object

Parameters
options

ObjT<GetLanguagesOptions>

Returns

Record<string, GetLanguagesItem>

Inherited from

GenericCollection.get_languages

Call Signature

get_languages(options?): GetLanguagesItem[]

Defined in: client/src/collection/generic.ts:216

Get available languages as either a list or an object

Parameters
options?

ObjF<GetLanguagesOptions>

Returns

GetLanguagesItem[]

Inherited from

GenericCollection.get_languages


get_preferred_language()

get_preferred_language(preferences?): GetLanguagesItem

Defined in: client/src/collection/generic.ts:271

Get the user’s preferred available language (no arg required when used in browser)

Parameters

preferences?

string[] = []

Returns

GetLanguagesItem

Inherited from

GenericCollection.get_preferred_language


get_resource()

get_resource(id): GetResourcesItem | undefined

Defined in: client/src/collection/generic.ts:303

Get a resource’s metadata

Parameters

id

string

Returns

GetResourcesItem | undefined

Inherited from

GenericCollection.get_resource


get_resources()

Call Signature

get_resources(options): Record<string, GetResourcesItem>

Defined in: client/src/collection/generic.ts:350

Get available resources as either a list or an object

Parameters
options

ObjT<GetResourcesOptions>

Returns

Record<string, GetResourcesItem>

Inherited from

GenericCollection.get_resources

Call Signature

get_resources(options?): GetResourcesItem[]

Defined in: client/src/collection/generic.ts:351

Get available resources as either a list or an object

Parameters
options?

ObjF<GetResourcesOptions>

Returns

GetResourcesItem[]

Inherited from

GenericCollection.get_resources


get_preferred_resource()

get_preferred_resource(languages?): GetResourcesItem

Defined in: client/src/collection/generic.ts:407

Get user’s preferred available resource (provide language preferences if not in browser)

Parameters

languages?

string[] = []

Returns

GetResourcesItem

Inherited from

GenericCollection.get_preferred_resource


get_books()

Call Signature

get_books(resource, options): Record<string, GetBooksItem>

Defined in: client/src/collection/generic.ts:455

Get which books are available for a resource. If no resource is given, all books will be listed but marked as unavailable. If fetch_translation_extras() has already been called for a translation then local name data will also be available (otherwise only English book names will be available).

Parameters
resource

string | undefined

options

ObjT<GetBooksOptions>

Returns

Record<string, GetBooksItem>

Inherited from

GenericCollection.get_books

Call Signature

get_books(resource?, options?): GetBooksItem[]

Defined in: client/src/collection/generic.ts:457

Get which books are available for a resource. If no resource is given, all books will be listed but marked as unavailable. If fetch_translation_extras() has already been called for a translation then local name data will also be available (otherwise only English book names will be available).

Parameters
resource?

string

options?

ObjF<GetBooksOptions>

Returns

GetBooksItem[]

Inherited from

GenericCollection.get_books


get_completion()

get_completion(resource): GetCompletionReturn

Defined in: client/src/collection/generic.ts:525

Get book ids that are available/missing for a resource for each testament

Parameters

resource

string

Returns

GetCompletionReturn

Inherited from

GenericCollection.get_completion


get_book_url()

get_book_url(resource, book, format?): string

Defined in: client/src/collection/notes.ts:9

Get the URL for a book’s notes (useful for caching and manual retrieval)

Parameters

resource

string

book

string

format?

"html" | "txt"

Returns

string


fetch_notes()

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

Defined in: client/src/collection/notes.ts:16

Fetch study notes for book

Parameters

resource

string

book

string

format?

"html" | "txt"

Returns

Promise<NotesBook>