UNPKG

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