-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from septs/master
rewrite typescript definition file
- Loading branch information
Showing
1 changed file
with
38 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |