Skip to content

databaseSources#

DatabaseOption#

One entry of the database selector.

Properties#

available#

available: boolean;

Whether this database can be searched. A database that cannot is still listed, so a user who configured it can see it is there and unusable rather than wondering where it went.

id#

id: string;

Routing key. Also the value the selector holds.

label#

label: string;

What the user sees.

origin#

origin: DatabaseOrigin;

DatabaseSearchPage#

A page of search results.

Properties#

compounds#

compounds: Compound[];

total_count#

total_count: number;

DatabaseSource#

A second place the viewer can read compounds from, supplied by the host.

The shared package knows nothing about how a host reaches its own databases, so a caller that has more than the remote source passes one of these in.

Methods#

compound()#

compound(databaseId, compoundId): Promise<CompoundDetail | null>;
Parameters#
Parameter Type
databaseId string
compoundId string
Returns#

Promise<CompoundDetail | null>

listDatabases()#

listDatabases(): Promise<DatabaseOption[]>;
Returns#

Promise<DatabaseOption[]>

search(
   databaseId, 
   query, 
   offset, 
   limit): Promise<DatabaseSearchPage>;
Parameters#
Parameter Type
databaseId string
query string
offset number
limit number
Returns#

Promise<DatabaseSearchPage>

spectrum()#

spectrum(
   databaseId, 
   compoundId, 
   nucleus): Promise<SpectrumResponse | null>;
Parameters#
Parameter Type
databaseId string
compoundId string
nucleus string
Returns#

Promise<SpectrumResponse | null>


DatabaseOrigin#

type DatabaseOrigin = "remote" | "registry";

Where a database in the selector comes from.

remote databases are served by the terraquant.tech nmrdb routes and are the same for everyone. registry databases are the ones configured in the app's own database settings, so they differ per installation.