index.d.ts 644 B

123456789101112131415161718192021222324252627
  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;