Skip to content

Commit

Permalink
Added types
Browse files Browse the repository at this point in the history
  • Loading branch information
andreihar committed May 2, 2024
1 parent 1b8155e commit f72f8b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "Taiwanese Hokkien Transliterator and Tokeniser",
"main": "taibun/index.js",
"types": "taibun/index.d.ts",
"scripts": {
"test": "jest"
},
Expand Down
23 changes: 23 additions & 0 deletions taibun/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
interface ConverterOptions {
system?: 'Tailo' | 'POJ' | 'Zhuyin' | 'TLPA' | 'Pingyim' | 'Tongiong' | 'IPA';
dialect?: 'south' | 'north';
format?: 'mark' | 'number' | 'strip';
delimiter?: string;
sandhi?: 'auto' | 'none' | 'excLast' | 'inclLast';
punctuation?: 'format' | 'none';
convertNonCjk?: boolean;
}

export class Converter {
constructor(options?: ConverterOptions);
get(input: string): string;
}

export class Tokeniser {
constructor();
tokenise(input: string): string[];
}

export function isCjk(input: string): boolean;
export function toTraditional(input: string): string;
export function toSimplified(input: string): string;

0 comments on commit f72f8b9

Please sign in to comment.