diff --git a/trim/index.d.ts b/trim/index.d.ts new file mode 100644 index 0000000000..4d9981052e --- /dev/null +++ b/trim/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for trim 0.01 +// Project: https://www.npmjs.com/package/trim +// Definitions by: Steve Jenkins +// 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; \ No newline at end of file diff --git a/trim/trim-tests.ts b/trim/trim-tests.ts new file mode 100644 index 0000000000..906d2a7b03 --- /dev/null +++ b/trim/trim-tests.ts @@ -0,0 +1,9 @@ +import trim = require("trim"); + +var original: string = " padded string "; + +trim(original); + +trim.left(original); + +trim.right(original); diff --git a/trim/tsconfig.json b/trim/tsconfig.json new file mode 100644 index 0000000000..b063e69e5f --- /dev/null +++ b/trim/tsconfig.json @@ -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" + ] +} \ No newline at end of file