trim-newlines: Add type definitions.

This commit is contained in:
Daniel Cassidy
2019-03-07 15:51:39 +00:00
parent ea11da4453
commit 282744882d
4 changed files with 47 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for trim-newlines 2.0
// Project: https://github.com/sindresorhus/trim-newlines#readme
// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
// 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;
@@ -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");
+23
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",
"trim-newlines-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }