From 2411a2b6dcd1e2b7488e54f37104f71f3d2e0b23 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Wed, 20 Feb 2019 12:12:13 +1100 Subject: [PATCH 1/3] Added typedefs for pretty --- types/pretty/index.d.ts | 11 +++++++++++ types/pretty/pretty-tests.ts | 5 +++++ types/pretty/tsconfig.json | 25 +++++++++++++++++++++++++ types/pretty/tslint.json | 3 +++ 4 files changed, 44 insertions(+) create mode 100644 types/pretty/index.d.ts create mode 100644 types/pretty/pretty-tests.ts create mode 100644 types/pretty/tsconfig.json create mode 100644 types/pretty/tslint.json diff --git a/types/pretty/index.d.ts b/types/pretty/index.d.ts new file mode 100644 index 0000000000..01dadcf609 --- /dev/null +++ b/types/pretty/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for pretty 2.0 +// Project: https://github.com/jonschlinkert/pretty +// Definitions by: Adam Zerella +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.3 + +export interface PrettyOptions { + ocd: boolean; +} + +export function pretty(str: string, options?: PrettyOptions): string; diff --git a/types/pretty/pretty-tests.ts b/types/pretty/pretty-tests.ts new file mode 100644 index 0000000000..00b7ebd7fc --- /dev/null +++ b/types/pretty/pretty-tests.ts @@ -0,0 +1,5 @@ +import { pretty } from "pretty"; + +pretty(`

nice

`); + +pretty(`

nice

`, {ocd: true}); diff --git a/types/pretty/tsconfig.json b/types/pretty/tsconfig.json new file mode 100644 index 0000000000..b46d610e45 --- /dev/null +++ b/types/pretty/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pretty-tests.ts" + ] +} diff --git a/types/pretty/tslint.json b/types/pretty/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/pretty/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file From 1b4845ad912c4c32771f9fc53a56cd80ff234b8d Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Thu, 21 Feb 2019 11:15:41 +1100 Subject: [PATCH 2/3] Updated typedefs for pretty --- types/pretty/index.d.ts | 6 ++++-- types/pretty/pretty-tests.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/pretty/index.d.ts b/types/pretty/index.d.ts index 01dadcf609..65d24fa395 100644 --- a/types/pretty/index.d.ts +++ b/types/pretty/index.d.ts @@ -4,8 +4,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 -export interface PrettyOptions { +interface PrettyOptions { ocd: boolean; } -export function pretty(str: string, options?: PrettyOptions): string; +declare function pretty(str: string, options?: PrettyOptions): string; + +export = pretty; diff --git a/types/pretty/pretty-tests.ts b/types/pretty/pretty-tests.ts index 00b7ebd7fc..0fe99519b4 100644 --- a/types/pretty/pretty-tests.ts +++ b/types/pretty/pretty-tests.ts @@ -1,4 +1,4 @@ -import { pretty } from "pretty"; +import pretty = require("pretty"); pretty(`

nice

`); From 6f84f2c1c174d749e763f7d5056dbadfe847175b Mon Sep 17 00:00:00 2001 From: Adam Zerella Date: Thu, 21 Feb 2019 11:17:45 +1100 Subject: [PATCH 3/3] Removed specific typescript version --- types/pretty/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/pretty/index.d.ts b/types/pretty/index.d.ts index 65d24fa395..a1bdfcb5a7 100644 --- a/types/pretty/index.d.ts +++ b/types/pretty/index.d.ts @@ -2,7 +2,6 @@ // Project: https://github.com/jonschlinkert/pretty // Definitions by: Adam Zerella // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.3 interface PrettyOptions { ocd: boolean;