add historykana types (#25222)

* add historykana types

* Fixed test error

* Fixed unified-signatures error

* Fix strictNullChecks to true.

* Fix export default to export equal

* Deleted module.
This commit is contained in:
shiratsuki
2018-04-26 19:02:47 -07:00
committed by Wesley Wigham
parent 40fd64f487
commit 9c61553ebb
4 changed files with 57 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import historykana from "historykana";
// Stock input history
const inputHistory = [
"y",
"や",
"やm",
"やま",
"やまd",
"やまだ",
"山田",
"山田",
"山田t",
"山田た",
"山田たr",
"山田たろ",
"山田たろう",
"山田太郎",
"山田太郎"
];
const result = historykana(inputHistory);
// => やまだたろう
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for HistoryKana 1.0
// Project: https://github.com/terrierscript/historykana
// Definitions by: shiratsuki <https://github.com/h-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;
+17
View File
@@ -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"]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}