diff --git a/types/right-align/index.d.ts b/types/right-align/index.d.ts new file mode 100644 index 0000000000..26a7a716ed --- /dev/null +++ b/types/right-align/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for right-align 0.1 +// Project: https://github.com/jonschlinkert/right-align +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare function right_align(val: string): string; +declare function right_align(val: string[]): string[]; + +export = right_align; diff --git a/types/right-align/right-align-tests.ts b/types/right-align/right-align-tests.ts new file mode 100644 index 0000000000..df565cfb13 --- /dev/null +++ b/types/right-align/right-align-tests.ts @@ -0,0 +1,15 @@ +import rightAlign from "right-align"; + +// multi-line sample +const lines = [ + "Lorem ipsum dolor sit amet,", + "consectetur adipiscing", + "elit, sed do eiusmod tempor incididunt", + "ut labore et dolore", + "magna aliqua. Ut enim ad minim", + "veniam, quis" +]; +rightAlign(lines); + +// single-line sample +rightAlign("single line"); diff --git a/types/right-align/tsconfig.json b/types/right-align/tsconfig.json new file mode 100644 index 0000000000..7cd98608d7 --- /dev/null +++ b/types/right-align/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": ["index.d.ts", "right-align-tests.ts"] +} diff --git a/types/right-align/tslint.json b/types/right-align/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/right-align/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }