Appearance
@gracious.tech/fetch-client / collection/glosses / GlossesCollection
Class: GlossesCollection
Defined in: client/src/collection/glosses.ts:6
Extends
Constructors
Constructor
new GlossesCollection(
items,requester,languages,language2to3,languages_most_spoken,usage):GlossesCollection
Defined in: client/src/collection/generic.ts:142
Parameters
items
Record<string, RuntimeManifestItem>
requester
languages
Record<string, MetaLanguage>
language2to3
Record<string, string>
languages_most_spoken
string[]
usage
Returns
GlossesCollection
Inherited from
Properties
requester
requester:
RequestHandler
Defined in: client/src/collection/generic.ts:140
Inherited from
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
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
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
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
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
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
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
Inherited from
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
Inherited from
GenericCollection.get_completion
get_book_url()
get_book_url(
resource,book):string
Defined in: client/src/collection/glosses.ts:9
Get the URL for a book’s glosses (useful for caching and manual retrieval)
Parameters
resource
string
book
string
Returns
string
fetch_glosses()
fetch_glosses(
resource,book):Promise<GlossesBook>
Defined in: client/src/collection/glosses.ts:16
Fetch glosses for book
Parameters
resource
string
book
string
Returns
Promise<GlossesBook>