mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add types for langmap (#37262)
* Add types for langmap * Fixed export * Lint
This commit is contained in:
parent
6e53923406
commit
22b8545455
11
types/langmap/index.d.ts
vendored
Normal file
11
types/langmap/index.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Type definitions for langmap 0.0
|
||||
// Project: https://github.com/mozilla/language-mapping-list
|
||||
// Definitions by: Gábor Balogh <https://github.com/grabofus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
import { LanguageMappingList } from './types';
|
||||
|
||||
declare const langmap: LanguageMappingList;
|
||||
|
||||
export = langmap;
|
||||
13
types/langmap/langmap-tests.ts
Normal file
13
types/langmap/langmap-tests.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// tslint:disable:no-duplicate-imports
|
||||
|
||||
import langmap1 from 'langmap';
|
||||
import * as langmap2 from 'langmap';
|
||||
|
||||
const val1 = langmap1['en-US']; // { nativeName: string, englishName: string }
|
||||
const val2 = langmap2['en-US']; // { nativeName: string, englishName: string }
|
||||
|
||||
val1.englishName;
|
||||
val1.nativeName;
|
||||
|
||||
val2.englishName;
|
||||
val2.nativeName;
|
||||
25
types/langmap/tsconfig.json
Normal file
25
types/langmap/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"langmap-tests.ts",
|
||||
"types.d.ts"
|
||||
]
|
||||
}
|
||||
1
types/langmap/tslint.json
Normal file
1
types/langmap/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
8
types/langmap/types.d.ts
vendored
Normal file
8
types/langmap/types.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
export interface Language {
|
||||
englishName: string;
|
||||
nativeName: string;
|
||||
}
|
||||
|
||||
export interface LanguageMappingList {
|
||||
[language: string]: Language;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user