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
This commit is contained in:
Claas Ahlrichs 2019-03-25 23:19:58 +01:00 committed by Ron Buckton
parent 3b226ddd59
commit 964c481dfd
4 changed files with 45 additions and 0 deletions

View File

@ -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 '

10
types/center-align/index.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
// Type definitions for center-align 1.0
// Project: https://github.com/jonschlinkert/center-align
// Definitions by: Claas Ahlrichs <https://github.com/claasahl>
// 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;

View File

@ -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"]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }