Initialize with the GNOME Typescript Template

This commit is contained in:
Aylur
2023-06-24 16:20:26 +02:00
commit 7e82ac0fed
37 changed files with 4483 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
declare function _(id: string): string;
declare function print(args: string): void;
declare function log(obj: object, others?: object[]): void;
declare function log(msg: string, subsitutions?: any[]): void;
declare const pkg: {
version: string;
name: string;
};
declare module console {
export function error(obj: object, others?: object[]): void;
export function error(msg: string, subsitutions?: any[]): void;
}
declare interface String {
format(...replacements: string[]): string;
format(...replacements: number[]): string;
}
declare interface Number {
toFixed(digits: number): number;
}
+35
View File
@@ -0,0 +1,35 @@
export namespace Gettext {
export enum LocaleCategory {
CTYPE = 0,
NUMERIC = 1,
TIME = 2,
COLLATE = 3,
MONETARY = 4,
MESSAGES = 5,
ALL = 6,
}
export function setlocale(category: LocaleCategory, locale: string | null): string | null;
export function textdomain(domainName: string): void;
export function bindtextdomain(domainName: string, dirName: string): void;
export function gettext(msgid: string): string;
export function dgettext(domainName: string | null, msgid: string): string;
export function dcgettext(domainName: string | null, msgid: string, category: LocaleCategory): string;
export function ngettext(msgid1: string, msgid2: string, n: number): string;
export function dngettext(domainName: string | null, msgid1: string, msgid2: string, n: number): string;
export function pgettext(context: string | null, msgid: string): string;
export function dpgettext(domainName: string | null, context: string | null, msgid: string): string;
export class GettextObject {
gettext(msgid: string): string;
ngettext(msgid1: string, msgid2: string, n: number): string;
pgettext(context: string | null, msgid: string): string;
}
export function domain(domainName: string | null): GettextObject;
}
export default Gettext;