Update node-gettext v3 typings (#43822)

This commit is contained in:
Andrej Mihajlov 2020-04-18 01:03:42 +02:00 committed by GitHub
parent 65c629ec55
commit 1e5dd1d7e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,9 @@
// TypeScript Version: 2.2
export = GetText;
declare class GetText {
static getLanguageCode(locale: string): string;
readonly locale: string;
readonly domain: string;
constructor(options?: { debug?: boolean; sourceLocale?: string });
addTranslations(locale: string, domain: string, translations: object): void;
dgettext(domain: string, msgid: string): string;
@ -16,12 +19,11 @@ declare class GetText {
gettext(msgid: string): string;
ngettext(msgid: string, msgidPlural: string, count: number): string;
npgettext(msgctxt: string, msgid: string, msgidPlural: string, count: number): string;
off(eventName: 'error', callback: (error: any) => void): void;
on(eventName: 'error', callback: (error: any) => void): void;
off(eventName: 'error', callback: (error: Error) => void): void;
on(eventName: 'error', callback: (error: Error) => void): void;
pgettext(msgctxt: string, msgid: string): string;
setLocale(locale: string): void;
setTextDomain(domain: string): void;
static getLanguageCode(locale: string): string;
textdomain(domain: string): void;
warn(message: string): void;
}