diff --git a/types/historykana/historykana-tests.ts b/types/historykana/historykana-tests.ts new file mode 100644 index 0000000000..f801ce4f52 --- /dev/null +++ b/types/historykana/historykana-tests.ts @@ -0,0 +1,23 @@ +import historykana from "historykana"; + +// Stock input history +const inputHistory = [ + "y", + "や", + "やm", + "やま", + "やまd", + "やまだ", + "山田", + "山田", + "山田t", + "山田た", + "山田たr", + "山田たろ", + "山田たろう", + "山田太郎", + "山田太郎" +]; + +const result = historykana(inputHistory); +// => やまだたろう diff --git a/types/historykana/index.d.ts b/types/historykana/index.d.ts new file mode 100644 index 0000000000..c99c82de98 --- /dev/null +++ b/types/historykana/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for HistoryKana 1.0 +// Project: https://github.com/terrierscript/historykana +// Definitions by: shiratsuki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/** + * Get Kana string from input history array. + * @param histories Input History Array + * @param options kanaRegexp : Hiragana detection regular expression rule. + */ +declare function historykana(histories: string[], options?: object): string; + +export = historykana; diff --git a/types/historykana/tsconfig.json b/types/historykana/tsconfig.json new file mode 100644 index 0000000000..8ae561d5d6 --- /dev/null +++ b/types/historykana/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "allowSyntheticDefaultImports": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "historykana-tests.ts"] +} diff --git a/types/historykana/tslint.json b/types/historykana/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/historykana/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}