mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
trim-newlines: Add type definitions.
This commit is contained in:
Vendored
+13
@@ -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");
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user