mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add types for bcp-47-match (#41196)
This commit is contained in:
committed by
Andrew Branch
parent
a7f75df583
commit
d7a5f44d73
17
types/bcp-47-match/bcp-47-match-tests.ts
Normal file
17
types/bcp-47-match/bcp-47-match-tests.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import bcp47Match = require('bcp-47-match');
|
||||
|
||||
const basic = bcp47Match.basicFilter;
|
||||
const extended = bcp47Match.extendedFilter;
|
||||
const lookup = bcp47Match.lookup;
|
||||
|
||||
const tags = ['en', 'es'];
|
||||
const ranges = ['en-US', 'es-US'];
|
||||
|
||||
const basicResult1: string[] = basic(tags, ranges);
|
||||
const basicResult2: string[] = basic(tags[0], ranges[0]);
|
||||
|
||||
const extendedResult1: string[] = extended(tags, ranges);
|
||||
const extendedResult2: string[] = extended(tags[0], ranges[0]);
|
||||
|
||||
const lookupResult1: string | undefined = lookup(tags, ranges);
|
||||
const lookupResult2: string | undefined = lookup(tags[0], ranges[0]);
|
||||
8
types/bcp-47-match/index.d.ts
vendored
Normal file
8
types/bcp-47-match/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for bcp-47-match 1.0
|
||||
// Project: https://github.com/wooorm/bcp-47-match#readme
|
||||
// Definitions by: Chris Barth <https://github.com/cjbarth>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function basicFilter(tags: string | string[], ranges: string | string[]): string[];
|
||||
export function extendedFilter(tags: string | string[], ranges: string | string[]): string[];
|
||||
export function lookup(tags: string | string[], ranges: string | string[]): string | undefined;
|
||||
23
types/bcp-47-match/tsconfig.json
Normal file
23
types/bcp-47-match/tsconfig.json
Normal 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",
|
||||
"bcp-47-match-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/bcp-47-match/tslint.json
Normal file
1
types/bcp-47-match/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user