import type { IRenderMime } from '@jupyterlab/rendermime-interfaces'; import type { ServerConnection } from '@jupyterlab/services'; import type { IDataConnector } from '@jupyterlab/statedb'; import { DataConnector } from '@jupyterlab/statedb'; import { Token } from '@lumino/coreutils'; /** * Application default locale. */ export declare const DEFAULT_LANGUAGE_CODE = "en"; /** * Metadata describing translation domain. */ interface IDomainMetadata { /** * Domain name, e.g. jupyterlab-git. */ domain: string; /** * Language. */ language: string; /** * Plural forms string in gettext format, e.g. `nplurals=2; plural=(n > 1);`. */ plural_forms: string; /** * Version. */ version?: string; } /** * Domain data is a key-value map of translations. * * Empty string key is a special value with the domain metadata. */ export type DomainData = Record & { '': IDomainMetadata; }; export type Language = { /** * Warning message, empty string if absent. * * Present if requested language pack is invalid or missing. */ message: string; /** * Domain data, keyed by domain name. */ data: Record; }; /** * Description of language. */ export interface ILanguageData { /** * Display name of the language in the current language. */ displayName: string; /** * Display name of the language in the language itself. */ nativeName: string; } export interface ILanguageList { /** * Warning message, empty string if absent. * * Present if one or more language packs is invalid. */ message: string; /** * List of available languages, keyed by language identifier. */ data: Record; } /** * Translation connection interface. */ export interface ITranslatorConnector extends IDataConnector { /** * Fetch language list or given language. */ fetch(): Promise; fetch(opts: { language: string; }): Promise; } /** * A service to connect to the server translation endpoint */ export declare const ITranslatorConnector: Token; export declare class TranslatorConnector extends DataConnector implements ITranslatorConnector { constructor(translationsUrl?: string, serverSettings?: ServerConnection.ISettings); fetch(): Promise; fetch(opts: { language: string; }): Promise; private _serverSettings; private _translationsUrl; } /** * Bundle of gettext-based translation functions for a specific domain. */ export type TranslationBundle = IRenderMime.TranslationBundle; /** * Translation provider interface */ export interface ITranslator extends IRenderMime.ITranslator { } /** * Translation provider token */ export declare const ITranslator: Token; export {};