Add definitions for smshelper (#42061)

This commit is contained in:
André Matthies 2020-02-06 00:15:30 +01:00 committed by GitHub
parent f47104d0f0
commit fb3f0de44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 0 deletions

10
types/smshelper/index.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
// Type definitions for smshelper 0.1
// Project: https://github.com/jaygel179/smshelper.js#readme
// Definitions by: André Matthies <https://github.com/matthiez>
// 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;

View File

@ -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');

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }