Add definitions for trim (#12292)

* Add definitions for trim

* comments from PR
This commit is contained in:
Steve 2016-11-08 13:58:24 +00:00 committed by Masahiro Wakame
parent fd7d42b3f1
commit 374978e36a
3 changed files with 40 additions and 0 deletions

12
trim/index.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
// Type definitions for trim 0.01
// Project: https://www.npmjs.com/package/trim
// Definitions by: Steve Jenkins <https://github.com/skysteve>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function Trim(str: string): string;
declare namespace Trim {
function left(str: string): string;
function right(str: string): string;
}
export = Trim;

9
trim/trim-tests.ts Normal file
View File

@ -0,0 +1,9 @@
import trim = require("trim");
var original: string = " padded string ";
trim(original);
trim.left(original);
trim.right(original);

19
trim/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"trim-tests.ts"
]
}