-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add d.ts to support typescript (#14)
support typescript types
- Loading branch information
1 parent
e8eab40
commit c6b3ba9
Showing
1 changed file
with
26 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
declare namespace TinyPinyin { | ||
interface DICT { | ||
PINYINS: string[] | ||
UNIHANS: string[] | ||
EXCEPTIONS: { | ||
[code: string]: string | ||
} | ||
} | ||
interface Patcher { | ||
(DICT: DICT): void | ||
} | ||
export function isSupported(force?: boolean): boolean | ||
export function parse( | ||
str: string | ||
): { | ||
type: 1 | 2 | 3 | ||
source: string | ||
target: string | ||
}[] | ||
export function convertToPinyin(str: string, separator?: string, lowerCase?: boolean): string | ||
export function patchDict(patcher: Patcher | Patcher[]): void | ||
} | ||
|
||
declare module 'tiny-pinyin' { | ||
export = TinyPinyin | ||
} |