UNPKG

760 BTypeScriptView Raw
1export interface IndentStringOptions {
2 /**
3 The string to use for the indent.
4 @default ' '
5 */
6 readonly indent?: string;
7 /**
8 Also indent empty lines.
9 @default false
10 */
11 readonly includeEmptyLines?: boolean;
12}
13/**
14Indent each line in a string.
15@param string - The string to indent.
16@param count - How many times you want `options.indent` repeated. Default: `1`.
17@example
18```
19import indentString from 'indent-string';
20indentString('Unicorns\nRainbows', 4);
21//=> ' Unicorns\n Rainbows'
22indentString('Unicorns\nRainbows', 4, {indent: '♥'});
23//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows'
24```
25*/
26export declare function indentString(string: string, count?: number, options?: IndentStringOptions): string;