index.d.ts 644 B

12345678910111213141516171819202122232425262728
  1. import {Options as IndentStringOptions} from 'indent-string';
  2. declare namespace redent {
  3. type Options = IndentStringOptions;
  4. }
  5. /**
  6. [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string).
  7. @param string - The string to normalize indentation.
  8. @param count - How many times you want `options.indent` repeated. Default: `0`.
  9. @example
  10. ```
  11. import redent = require('redent');
  12. redent('\n foo\n bar\n', 1);
  13. //=> '\n foo\n bar\n'
  14. ```
  15. */
  16. declare function redent(
  17. string: string,
  18. count?: number,
  19. options?: redent.Options
  20. ): string;
  21. export = redent;