ITranslatorConnector | @jupyterlab (original) (raw)
Hierarchy (View Summary)
- IDataConnector<
Language,
Language
| ILanguageList,
{ language: string } | undefined,
>- ITranslatorConnector
Implemented by
Index
Methods
fetch
- fetch(): Promise<ILanguageList>
Promise<ILanguageList>
Returns- fetch(opts: { language: string }): Promise<Language>
Parameters
- opts: { language: string }
Returns Promise<Language>
A promise that bears a data payload if available.
Notes
The promise returned by this method may be rejected if an error occurs in retrieving the data. Nonexistence of an id
resolves with undefined
.
list
- list(
query?: string,
): Promise<
{ ids: (undefined | { language: string })[]; values: Language[] },
> Parameters
Optional
query: string
Returns Promise<{ ids: (undefined | { language: string })[]; values: Language[] }>
A promise that bears a list of values
and an associated list of fetch ids
.
Notes
The promise returned by this method may be rejected if an error occurs in retrieving the data. The two lists will always be the same size. If there is no data, this method will succeed with empty ids
and values
.
remove
- remove(id: undefined | { language: string }): Promise<any>
Parameters
- id: undefined | { language: string }
Returns Promise<any>
A promise that is rejected if remove fails and succeeds otherwise.
Notes
This promise may resolve with a back-end response or undefined
. Existence of resolved content in the promise is not prescribed and must be tested for. For example, some back-ends may return a copy of the item of type T
being removed while others may return no content.
save
- save(
id: undefined | { language: string },
value: Language | ILanguageList,
): Promise<any> Promise<any>
Returns
A promise that is rejected if saving fails and succeeds otherwise.
Notes
This promise may resolve with a back-end response or undefined
. Existence of resolved content in the promise is not prescribed and must be tested for. For example, some back-ends may return a copy of the item of type T
being saved while others may return no content.