[latest-version] Add types

This commit is contained in:
Dimitri Benin
2019-01-13 23:16:01 +01:00
parent 3a69de74e2
commit 5c466224e2
4 changed files with 42 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for latest-version 4.0
// Project: https://github.com/sindresorhus/latest-version#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = latestVersion;
declare function latestVersion(name: string, options?: latestVersion.Options): Promise<string>;
declare namespace latestVersion {
interface Options {
version?: string;
}
}
@@ -0,0 +1,4 @@
import latestVersion = require('latest-version');
latestVersion('ava'); // $ExpectType Promise<string>
latestVersion('npm', { version: 'latest-5' }); // $ExpectType Promise<string>
+23
View File
@@ -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",
"latest-version-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }