Skip to content

Commit

Permalink
Merge pull request #34 from septs/master
Browse files Browse the repository at this point in the history
rewrite typescript definition file
  • Loading branch information
rubenv authored Jun 25, 2019
2 parents b8676a4 + 3b28b3e commit 6357bf3
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions pofile.d.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
declare module pofile {
function parse(data: string): PO;
function load(fileName: string, callback: (err: NodeJS.ErrnoException | null, po: PO) => void): void;
declare interface IHeaders {
'Project-Id-Version': string;
'Report-Msgid-Bugs-To': string;
'POT-Creation-Date': string;
'PO-Revision-Date': string;
'Last-Translator': string;
'Language': string;
'Language-Team': string;
'Content-Type': string;
'Content-Transfer-Encoding': string;
'Plural-Forms': string;
[name: string]: string;
}

class PO {
public comments: string[];
public extractedComments: string[];
public items: Item[];
public headers: Partial<IHeaders>
declare class Item {
public msgid: string;
public msgctxt?: string;
public references: string[];
public msgid_plural?: string;
public msgstr: string[];
public comments: string[];
public extractedComments: string[];
public flags: Record<string, boolean | undefined>;
private nplurals: number;
private obsolete: boolean;

public save(filename: string, callback: (err?: NodeJS.ErrnoException) => void): void;
public toString(): string;
}
public toString(): string;
}

interface IHeaders {
'Project-Id-Version': string;
'Report-Msgid-Bugs-To': string;
'POT-Creation-Date': string;
'PO-Revision-Date': string;
'Last-Translator': string;
'Language': string;
'Language-Team': string;
'Content-Type': string;
'Content-Transfer-Encoding': string;
'Plural-Forms': string;
}
declare class PO {
public comments: string[];
public extractedComments: string[];
public items: Item[];
public headers: Partial<IHeaders>

class Item {
public msgid: string;
public msgctxt?: string;
public references: string[];
public msgid_plural?: string;
public msgstr: string[];
public comments: string[];
public extractedComments: string[];
public flags: { [flag: string]: boolean | undefined }
private nplurals: number;
private obsolete: boolean;
public static parse(data: string): PO;
public static parsePluralForms(forms: string): PO;
public static load(fileName: string, callback: (err: NodeJS.ErrnoException, po: PO) => void): void;
public static Item: typeof Item;

public toString(): string;
}
public save(fileName: string, callback: (err: NodeJS.ErrnoException) => void): void;
public toString(): string;
}

export = pofile
export = PO

0 comments on commit 6357bf3

Please sign in to comment.