Add types for the stringify-author package (#45835)

This commit is contained in:
Manuel Thalmann 2020-07-06 22:59:33 +02:00 committed by GitHub
parent 28ff829fd7
commit 4620e42e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 0 deletions

19
types/stringify-author/index.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
// Type definitions for stringify-author 0.1
// Project: https://github.com/jonschlinkert/stringify-author
// Definitions by: Manuel Thalmann <https://github.com/manuth>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Author } from "parse-author";
/**
* Converts an `author` to a human-readable string.
*
* @param author
* The author to stringify.
*
* @returns
* A string representing the `author`.
*/
declare function stringify(author: Author): string;
export = stringify;

View File

@ -0,0 +1,7 @@
import stringify = require("stringify-author");
stringify({});
stringify({ name: "", email: "", url: "" });
// $ExpectType string
stringify({});

View 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",
"stringify-author-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }