From 3b226ddd594cc028a06fd5d7e29170a34cadaadf Mon Sep 17 00:00:00 2001 From: Claas Ahlrichs Date: Mon, 25 Mar 2019 23:19:06 +0100 Subject: [PATCH] new package: right-align (#34202) * npx dts-gen -m right-align --dt * drafted types for right-align * npx prettier --write .\types\right-align\** * fixed linting issues --- types/right-align/index.d.ts | 10 ++++++++++ types/right-align/right-align-tests.ts | 15 +++++++++++++++ types/right-align/tsconfig.json | 17 +++++++++++++++++ types/right-align/tslint.json | 1 + 4 files changed, 43 insertions(+) create mode 100644 types/right-align/index.d.ts create mode 100644 types/right-align/right-align-tests.ts create mode 100644 types/right-align/tsconfig.json create mode 100644 types/right-align/tslint.json 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" }