From 4620e42e5ae2456f1019a0e84e6fd22982e09e74 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 6 Jul 2020 22:59:33 +0200 Subject: [PATCH] Add types for the `stringify-author` package (#45835) --- types/stringify-author/index.d.ts | 19 +++++++++++++++ .../stringify-author-tests.ts | 7 ++++++ types/stringify-author/tsconfig.json | 23 +++++++++++++++++++ types/stringify-author/tslint.json | 1 + 4 files changed, 50 insertions(+) create mode 100644 types/stringify-author/index.d.ts create mode 100644 types/stringify-author/stringify-author-tests.ts create mode 100644 types/stringify-author/tsconfig.json create mode 100644 types/stringify-author/tslint.json diff --git a/types/stringify-author/index.d.ts b/types/stringify-author/index.d.ts new file mode 100644 index 0000000000..1af0c2ebfd --- /dev/null +++ b/types/stringify-author/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for stringify-author 0.1 +// Project: https://github.com/jonschlinkert/stringify-author +// Definitions by: Manuel Thalmann +// 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; diff --git a/types/stringify-author/stringify-author-tests.ts b/types/stringify-author/stringify-author-tests.ts new file mode 100644 index 0000000000..ecf4d16c95 --- /dev/null +++ b/types/stringify-author/stringify-author-tests.ts @@ -0,0 +1,7 @@ +import stringify = require("stringify-author"); + +stringify({}); +stringify({ name: "", email: "", url: "" }); + +// $ExpectType string +stringify({}); diff --git a/types/stringify-author/tsconfig.json b/types/stringify-author/tsconfig.json new file mode 100644 index 0000000000..fd17bfa07f --- /dev/null +++ b/types/stringify-author/tsconfig.json @@ -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" + ] +} diff --git a/types/stringify-author/tslint.json b/types/stringify-author/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/stringify-author/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }