blockString.d.ts 822 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * Produces the value of a block string from its parsed raw value, similar to
  3. * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
  4. *
  5. * This implements the GraphQL spec's BlockStringValue() static algorithm.
  6. *
  7. * @internal
  8. */
  9. export declare function dedentBlockStringLines(
  10. lines: ReadonlyArray<string>,
  11. ): Array<string>;
  12. /**
  13. * @internal
  14. */
  15. export declare function isPrintableAsBlockString(value: string): boolean;
  16. /**
  17. * Print a block string in the indented block form by adding a leading and
  18. * trailing blank line. However, if a block string starts with whitespace and is
  19. * a single-line, adding a leading blank line would strip that whitespace.
  20. *
  21. * @internal
  22. */
  23. export declare function printBlockString(
  24. value: string,
  25. options?: {
  26. minimize?: boolean;
  27. },
  28. ): string;