Added typedefs for pretty

This commit is contained in:
Adam A. Zerella 2019-02-20 12:12:13 +11:00
parent 419d4edf69
commit 2411a2b6dc
No known key found for this signature in database
GPG Key ID: 69912DBD32172144
4 changed files with 44 additions and 0 deletions

11
types/pretty/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// Type definitions for pretty 2.0
// Project: https://github.com/jonschlinkert/pretty
// Definitions by: Adam Zerella <https://github.com/adamzerella>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.3
export interface PrettyOptions {
ocd: boolean;
}
export function pretty(str: string, options?: PrettyOptions): string;

View File

@ -0,0 +1,5 @@
import { pretty } from "pretty";
pretty(`<h1>nice</h1>`);
pretty(`<h1>nice</h1>`, {ocd: true});

View File

@ -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"
]
}

3
types/pretty/tslint.json Normal file
View File

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