🤖 Merge PR #53738 browser-lang v0.1 by @InJaEE

* type browser-lang

* add Comment

* update tsconfig

* edit tsconfig

* update tsconfig

* change test name

* update tsconfig

* update tsconfig

* solve dtslint

* fix version

* version
This commit is contained in:
InJaEE
2021-06-11 08:23:15 +09:00
committed by GitHub
parent 30c0cc2944
commit 99fc319504
4 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import browserLang from 'browser-lang';
const Lang = browserLang({ languages: ['en', 'ko', 'ja'], fallback: 'en' });
const SystemLang = browserLang();
console.log("Lang:", Lang);
console.log("SystemLang:", SystemLang);

13
types/browser-lang/index.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// Type definitions for browser-lang 0.1
// Project: https://github.com/InJaEE/DefinitelyTyped
// Definitions by: InJaEE <https://github.com/InJaEE>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface BrowserOption {
languages: string[];
fallback: string;
}
declare function browserLang(option?: BrowserOption): string;
export default browserLang;

View File

@@ -0,0 +1,21 @@
{
"files": [
"index.d.ts",
"browser-lang-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"types": [],
"baseUrl": "../",
"typeRoots": [
"../"
]
}
}

View File

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