UNPKG

1.64 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/align-text`
3
4# Summary
5This package contains type definitions for align-text (https://github.com/jonschlinkert/align-text).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/align-text.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/align-text/index.d.ts)
10````ts
11interface TransformResult {
12 /**
13 * the amount of indentation to use. Default is 0 when an object is returned.
14 */
15 indent: number;
16 /**
17 * the character to use for indentation. Default is '' (empty string) when an object is returned.
18 */
19 character: string;
20 /**
21 * leading characters to use at the beginning of each line. '' (empty string) when an object is returned.
22 */
23 prefix: string;
24}
25
26interface Callback {
27 /**
28 * @param len the length of the "current" line
29 * @param longest the length of the longest line
30 * @param line the current line (string) being aligned
31 * @param lines the array of all lines
32 * @param idx the index of the current line
33 */
34 (len: number, longest: number, line: string, lines: string[], idx: number):
35 | number
36 | TransformResult;
37}
38
39declare function align_text(text: string, fn?: number | Callback): string;
40declare function align_text(text: any[], fn?: number | Callback): string[];
41
42export = align_text;
43
44````
45
46### Additional Details
47 * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
48 * Dependencies: none
49
50# Credits
51These definitions were written by [Claas Ahlrichs](https://github.com/claasahl).
52
\No newline at end of file