diff --git a/types/trim-newlines/index.d.ts b/types/trim-newlines/index.d.ts new file mode 100644 index 0000000000..7abe323fe2 --- /dev/null +++ b/types/trim-newlines/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for trim-newlines 2.0 +// Project: https://github.com/sindresorhus/trim-newlines#readme +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function trimNewlines(input: string): string; + +declare namespace trimNewlines { + function start(input: string): string; + function end(input: string): string; +} + +export = trimNewlines; diff --git a/types/trim-newlines/trim-newlines-tests.ts b/types/trim-newlines/trim-newlines-tests.ts new file mode 100644 index 0000000000..e3bc17661a --- /dev/null +++ b/types/trim-newlines/trim-newlines-tests.ts @@ -0,0 +1,10 @@ +import trimNewlines = require("trim-newlines"); + +// $ExpectType string +trimNewlines('\nunicorn\r\n'); + +// $ExpectType string +trimNewlines.start("\n\npony\n"); + +// $ExpectType string +trimNewlines.end("\ndonk\n\n"); diff --git a/types/trim-newlines/tsconfig.json b/types/trim-newlines/tsconfig.json new file mode 100644 index 0000000000..8dbcfef306 --- /dev/null +++ b/types/trim-newlines/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", + "trim-newlines-tests.ts" + ] +} diff --git a/types/trim-newlines/tslint.json b/types/trim-newlines/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/trim-newlines/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }