diff --git a/types/smshelper/index.d.ts b/types/smshelper/index.d.ts new file mode 100644 index 0000000000..88ec20a160 --- /dev/null +++ b/types/smshelper/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for smshelper 0.1 +// Project: https://github.com/jaygel179/smshelper.js#readme +// Definitions by: André Matthies +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function count(text: string): number; + +export function detectEncoding(text: string): 'GSM_7BIT' | 'GSM_7BIT_EX' | 'UTF16'; + +export function parts(text: string): number; diff --git a/types/smshelper/smshelper-tests.ts b/types/smshelper/smshelper-tests.ts new file mode 100644 index 0000000000..343b9a1c19 --- /dev/null +++ b/types/smshelper/smshelper-tests.ts @@ -0,0 +1,7 @@ +import * as smshelper from 'smshelper'; + +const charCount = smshelper.count('MY_RANDOM_MESSAGE'); + +const encoding = smshelper.detectEncoding('MY_RANDOM_MESSAGE'); + +const smsCount = smshelper.parts('MY_RANDOM_MESSAGE'); diff --git a/types/smshelper/tsconfig.json b/types/smshelper/tsconfig.json new file mode 100644 index 0000000000..63edc92d66 --- /dev/null +++ b/types/smshelper/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "smshelper-tests.ts" + ] +} diff --git a/types/smshelper/tslint.json b/types/smshelper/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/smshelper/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }