From 964c481dfd987c1952a88cd91376383be54ce6a3 Mon Sep 17 00:00:00 2001 From: Claas Ahlrichs Date: Mon, 25 Mar 2019 23:19:58 +0100 Subject: [PATCH] new package: center-align (#34203) * npx dts-gen -m center-align --dt * drafted types for center-align * npx prettier --write .\types\center-align\** * fixed linting issues --- types/center-align/center-align-tests.ts | 17 +++++++++++++++++ types/center-align/index.d.ts | 10 ++++++++++ types/center-align/tsconfig.json | 17 +++++++++++++++++ types/center-align/tslint.json | 1 + 4 files changed, 45 insertions(+) create mode 100644 types/center-align/center-align-tests.ts create mode 100644 types/center-align/index.d.ts create mode 100644 types/center-align/tsconfig.json create mode 100644 types/center-align/tslint.json diff --git a/types/center-align/center-align-tests.ts b/types/center-align/center-align-tests.ts new file mode 100644 index 0000000000..c54c36ea44 --- /dev/null +++ b/types/center-align/center-align-tests.ts @@ -0,0 +1,17 @@ +import center from "center-align"; + +// multi-line sample +center([ + "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" +]); + +// single-line samples +center("foo"); // => 'foo' (does nothing) +center("foo", 12); // => ' foo ' +center("foo", 10); // => ' foo ' +center("foo", 8); // => ' foo ' diff --git a/types/center-align/index.d.ts b/types/center-align/index.d.ts new file mode 100644 index 0000000000..47ff64b101 --- /dev/null +++ b/types/center-align/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for center-align 1.0 +// Project: https://github.com/jonschlinkert/center-align +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare function center_align(val: string, width?: number): string; +declare function center_align(val: string[], width?: number): string[]; + +export = center_align; diff --git a/types/center-align/tsconfig.json b/types/center-align/tsconfig.json new file mode 100644 index 0000000000..538e2aa296 --- /dev/null +++ b/types/center-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", "center-align-tests.ts"] +} diff --git a/types/center-align/tslint.json b/types/center-align/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/center-align/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }