Adjust the type-definition according to dtslint

This commit is contained in:
Manuel Thalmann
2018-11-03 16:34:32 +01:00
parent a9bbb1299d
commit ee0b2edbee
3 changed files with 19 additions and 4 deletions

View File

@@ -1,4 +1,11 @@
// Type definitions for inquirer-npm-name 3.0
// Project: https://github.com/SBoudrias/inquirer-npm-name
// Definitions by: manuth <https://github.com/manuth>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Inquirer, Answers, Question } from "inquirer";
declare function askName(name: string | Question, inquirer: Inquirer): Promise<{ [key: string]: string }>;
export = askName;
export = askName;

View File

@@ -1,6 +1,13 @@
import inquirer = require("inquirer");
import askName = require("inquirer-npm-name");
(async () => {
(await askName("name", inquirer)).name.toUpperCase();
})();
// $ExpectType Promise<{ [key: string]: string; }>
askName("moduleName", inquirer);
// $ExpectType Promise<{ [key: string]: string; }>
askName(
{
name: "moduleName",
message: "Whar's the name of your module?"
},
inquirer);

View File

@@ -7,6 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"