lookup#
Interfaces#
Lookup#
Defined in: editor/src/lookup/index.ts:56
The services a statement’s value is looked up in.
Methods#
reconcile()#
reconcile(
system,kind,texts,signal?):Promise<readonly (Candidate|null)[]>
Defined in: editor/src/lookup/index.ts:90
The best candidate for each text, null where none is found: one
request for all texts at MusicBrainz (with its match), one search per
text elsewhere (match false).
Parameters#
system#
string
kind#
texts#
readonly string[]
signal?#
AbortSignal
Returns#
Promise<readonly (Candidate | null)[]>
Throws#
LookupError As search.
resolvable()#
resolvable(
system):boolean
Defined in: editor/src/lookup/index.ts:60
Whether resolve asks system.
Parameters#
system#
string
Returns#
boolean
resolve()#
resolve(
system,iri,signal?):Promise<Candidate|null>
Defined in: editor/src/lookup/index.ts:82
The thing an IRI names in system, with its cross-references; null
without a request where the system is not resolvable or the IRI is
none of its things, and null for a video oEmbed does not describe.
Parameters#
system#
string
iri#
string
signal?#
AbortSignal
Returns#
Promise<Candidate | null>
Throws#
LookupError As search.
search()#
search(
system,kind,text,signal?):Promise<readonlyCandidate[]>
Defined in: editor/src/lookup/index.ts:69
The things of kind that system finds for text, in the service’s
order, without cross-references; [] without a request where the
system is not searchable for the kind or the text is blank.
Parameters#
system#
string
kind#
text#
string
signal?#
AbortSignal
Returns#
Promise<readonly Candidate[]>
Throws#
LookupError When the service does not answer as asked; an aborted request rejects with the signal’s reason instead.
searchable()#
searchable(
system,kind):boolean
Defined in: editor/src/lookup/index.ts:58
Whether search asks system for things of kind.
Parameters#
system#
string
kind#
Returns#
boolean
LookupOptions#
Defined in: editor/src/lookup/index.ts:99
What createLookup is given: how it fetches, the server, and what it searches and labels with.
Properties#
catalogue?#
readonlyoptionalcatalogue?:Catalogue
Defined in: editor/src/lookup/index.ts:107
The catalogue that recognises IRIs; the default catalogue by default.
fetch?#
readonlyoptionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: editor/src/lookup/index.ts:101
The fetch to send requests with; the global one by default.
Call Signature#
(
input,init?):Promise<Response>
Parameters#
input#
RequestInfo | URL
init?#
RequestInit
Returns#
Promise<Response>
Call Signature#
(
input,init?):Promise<Response>
Parameters#
input#
string | Request | URL
init?#
RequestInit
Returns#
Promise<Response>
language?#
readonlyoptionallanguage?:string
Defined in: editor/src/lookup/index.ts:105
The language of labels and descriptions; "en" by default.
server#
readonlyserver:ServerOptions|null
Defined in: editor/src/lookup/index.ts:103
The server MusicBrainz is reached through; null leaves MusicBrainz out.
services?#
readonlyoptionalservices?: () => readonlyService[]
Defined in: editor/src/lookup/index.ts:112
The viewer’s services, read at every request (the editor gives its type profiles’); none by default.
Returns#
readonly Service[]
Variables#
lookupOf#
lookupOf: () =>
Lookup
Defined in: editor/src/lookup/index.ts:195
Returns#
NO_LOOKUP#
constNO_LOOKUP:Lookup
Defined in: editor/src/lookup/index.ts:186
The lookup of an editor that looks nothing up: nothing searchable or resolvable, no request.
provideLookup#
provideLookup: (
context) =>Lookup
Defined in: editor/src/lookup/index.ts:195
Parameters#
context#
Returns#
Functions#
createLookup()#
createLookup(
options):Lookup
Defined in: editor/src/lookup/index.ts:130
The lookup of the services options reach.
Parameters#
options#
Returns#
References#
Candidate#
Re-exports Candidate
CrossReference#
Re-exports CrossReference
ExtendValue#
Re-exports ExtendValue
LookupError#
Re-exports LookupError
LookupErrorCode#
Re-exports LookupErrorCode
ReconciliationCandidate#
Re-exports ReconciliationCandidate
ReconciliationClient#
Re-exports ReconciliationClient
ReconciliationOptions#
Re-exports ReconciliationOptions
ReconciliationQuery#
Re-exports ReconciliationQuery
ReconciliationType#
Re-exports ReconciliationType
ServiceManifest#
Re-exports ServiceManifest
ServicePath#
Re-exports ServicePath
Suggestion#
Re-exports Suggestion
VALUE_KINDS#
Re-exports VALUE_KINDS
ValueKind#
Re-exports ValueKind