blockString.d.ts 758 B

1234567891011121314151617181920212223
  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. export function dedentBlockStringValue(rawString: string): string;
  8. /**
  9. * @internal
  10. */
  11. export function getBlockStringIndentation(body: string): number;
  12. /**
  13. * Print a block string in the indented block form by adding a leading and
  14. * trailing blank line. However, if a block string starts with whitespace and is
  15. * a single-line, adding a leading blank line would strip that whitespace.
  16. */
  17. export function printBlockString(
  18. value: string,
  19. indentation?: string,
  20. preferMultipleLines?: boolean,
  21. ): string;