mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Add types for get-certain
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import getCertain = require('get-certain');
|
||||
|
||||
const map = new Map<string, number>();
|
||||
|
||||
map.set('foo', 1);
|
||||
|
||||
// $ExpectType number
|
||||
getCertain(map, 'foo');
|
||||
getCertain(map, 'bar', 'This map is barless.');
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for get-certain 1.0
|
||||
// Project: https://github.com/wtgtybhertgeghgtwtg/get-certain#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = getCertain;
|
||||
|
||||
declare function getCertain<TKey, TValue>(
|
||||
map: Map<TKey, TValue>,
|
||||
key: TKey,
|
||||
message?: string
|
||||
): TValue;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"get-certain-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user