Update types for indent-string to v3.2

This commit is contained in:
Dimitri Benin 2018-12-10 23:53:11 +01:00
parent fda699244c
commit 884193e6c7
2 changed files with 20 additions and 3 deletions

View File

@ -1,5 +1,7 @@
import indentString = require('indent-string');
// $ExpectType string
indentString('Unicorns\nRainbows');
indentString('Unicorns\nRainbows', 4);
// => ' Unicorns'
// => ' Rainbows'
@ -7,3 +9,5 @@ indentString('Unicorns\nRainbows', 4);
indentString('Unicorns\nRainbows', 4, '♥');
// => '♥♥♥♥Unicorns'
// => '♥♥♥♥Rainbows'
indentString('Unicorns\nRainbows', 4, { indent: '♥' });
indentString('Unicorns\nRainbows', 4, { includeEmptyLines: true });

View File

@ -1,7 +1,20 @@
// Type definitions for indent-string 3.0
// Type definitions for indent-string 3.2
// Project: https://github.com/sindresorhus/indent-string#readme
// Definitions by: Mohamed Hegazy <https://github.com/mhegazy>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = indent_string;
declare function indent_string(str: string, count: number, indent?: string): string;
export = indentString;
declare function indentString(
str: string,
count?: number,
indent?: string | indentString.Options
): string;
declare namespace indentString {
interface Options {
indent?: string;
includeEmptyLines?: boolean;
}
}