Skip to content

Commit c6b3ba9

Browse files
zhanbacreeperyang
authored andcommitted
add d.ts to support typescript (#14)
support typescript types
1 parent e8eab40 commit c6b3ba9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tiny-pinyin.d.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
declare namespace TinyPinyin {
2+
interface DICT {
3+
PINYINS: string[]
4+
UNIHANS: string[]
5+
EXCEPTIONS: {
6+
[code: string]: string
7+
}
8+
}
9+
interface Patcher {
10+
(DICT: DICT): void
11+
}
12+
export function isSupported(force?: boolean): boolean
13+
export function parse(
14+
str: string
15+
): {
16+
type: 1 | 2 | 3
17+
source: string
18+
target: string
19+
}[]
20+
export function convertToPinyin(str: string, separator?: string, lowerCase?: boolean): string
21+
export function patchDict(patcher: Patcher | Patcher[]): void
22+
}
23+
24+
declare module 'tiny-pinyin' {
25+
export = TinyPinyin
26+
}

0 commit comments

Comments
 (0)