mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 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:
7
types/browser-lang/browser-lang-tests.ts
Normal file
7
types/browser-lang/browser-lang-tests.ts
Normal 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
13
types/browser-lang/index.d.ts
vendored
Normal 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;
|
||||
21
types/browser-lang/tsconfig.json
Normal file
21
types/browser-lang/tsconfig.json
Normal 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": [
|
||||
"../"
|
||||
]
|
||||
}
|
||||
}
|
||||
3
types/browser-lang/tslint.json
Normal file
3
types/browser-lang/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user