From 9c61553ebb198319f830a64057cbbf287f3576c6 Mon Sep 17 00:00:00 2001 From: shiratsuki <37891706+h-shiratsuki@users.noreply.github.com> Date: Fri, 27 Apr 2018 11:02:47 +0900 Subject: [PATCH] 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. --- types/historykana/historykana-tests.ts | 23 +++++++++++++++++++++++ types/historykana/index.d.ts | 14 ++++++++++++++ types/historykana/tsconfig.json | 17 +++++++++++++++++ types/historykana/tslint.json | 3 +++ 4 files changed, 57 insertions(+) create mode 100644 types/historykana/historykana-tests.ts create mode 100644 types/historykana/index.d.ts create mode 100644 types/historykana/tsconfig.json create mode 100644 types/historykana/tslint.json 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" +}