UNPKG

766 BTypeScriptView Raw
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 */
7export function dedentBlockStringValue(rawString: string): string;
8
9// @internal
10export function getBlockStringIndentation(lines: ReadonlyArray<string>): number;
11
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 */
17export function printBlockString(
18 value: string,
19 indentation?: string,
20 preferMultipleLines?: boolean,
21): string;