From 0cc4244b448a2eaa54d51da09b502e103b5c2aaa Mon Sep 17 00:00:00 2001 From: imprevo Date: Tue, 2 Apr 2019 00:19:45 +0700 Subject: [PATCH] Add types for rtl-detect --- types/rtl-detect/index.d.ts | 7 +++++++ types/rtl-detect/rtl-detect-tests.ts | 4 ++++ types/rtl-detect/tsconfig.json | 22 ++++++++++++++++++++++ types/rtl-detect/tslint.json | 1 + 4 files changed, 34 insertions(+) create mode 100644 types/rtl-detect/index.d.ts create mode 100644 types/rtl-detect/rtl-detect-tests.ts create mode 100644 types/rtl-detect/tsconfig.json create mode 100644 types/rtl-detect/tslint.json diff --git a/types/rtl-detect/index.d.ts b/types/rtl-detect/index.d.ts new file mode 100644 index 0000000000..9166325182 --- /dev/null +++ b/types/rtl-detect/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for rtl-detect 1.0 +// Project: https://github.com/shadiabuhilal/rtl-detect +// Definitions by: imprevo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function getLangDir(strLocale: string): 'ltr' | 'rtl'; +export function isRtlLang(strLocale: string): boolean | undefined; diff --git a/types/rtl-detect/rtl-detect-tests.ts b/types/rtl-detect/rtl-detect-tests.ts new file mode 100644 index 0000000000..81e08c226d --- /dev/null +++ b/types/rtl-detect/rtl-detect-tests.ts @@ -0,0 +1,4 @@ +import * as rtlDetect from 'rtl-detect'; + +rtlDetect.getLangDir(''); +rtlDetect.isRtlLang(''); diff --git a/types/rtl-detect/tsconfig.json b/types/rtl-detect/tsconfig.json new file mode 100644 index 0000000000..b0b27b65f9 --- /dev/null +++ b/types/rtl-detect/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "rtl-detect-tests.ts" + ] +} diff --git a/types/rtl-detect/tslint.json b/types/rtl-detect/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rtl-detect/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }