blockString.d.ts 766 B

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