Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
783 bytes
|
Line | |
---|
1 | declare namespace indentString {
|
---|
2 | interface Options {
|
---|
3 | /**
|
---|
4 | The string to use for the indent.
|
---|
5 |
|
---|
6 | @default ' '
|
---|
7 | */
|
---|
8 | readonly indent?: string;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | Also indent empty lines.
|
---|
12 |
|
---|
13 | @default false
|
---|
14 | */
|
---|
15 | readonly includeEmptyLines?: boolean;
|
---|
16 | }
|
---|
17 | }
|
---|
18 |
|
---|
19 | /**
|
---|
20 | Indent each line in a string.
|
---|
21 |
|
---|
22 | @param string - The string to indent.
|
---|
23 | @param count - How many times you want `options.indent` repeated. Default: `1`.
|
---|
24 |
|
---|
25 | @example
|
---|
26 | ```
|
---|
27 | import indentString = require('indent-string');
|
---|
28 |
|
---|
29 | indentString('Unicorns\nRainbows', 4);
|
---|
30 | //=> ' Unicorns\n Rainbows'
|
---|
31 |
|
---|
32 | indentString('Unicorns\nRainbows', 4, {indent: '♥'});
|
---|
33 | //=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows'
|
---|
34 | ```
|
---|
35 | */
|
---|
36 | declare function indentString(
|
---|
37 | string: string,
|
---|
38 | count?: number,
|
---|
39 | options?: indentString.Options
|
---|
40 | ): string;
|
---|
41 |
|
---|
42 | export = indentString;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.