UNPKG

1.15 kBTypeScriptView Raw
1import { ASTNode, DefinitionNode, Location, NameNode, StringValueNode } from 'graphql';
2export type NamedDefinitionNode = DefinitionNode & {
3 name?: NameNode;
4};
5export declare function resetComments(): void;
6export declare function collectComment(node: NamedDefinitionNode): void;
7export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void;
8export declare function printComment(comment: string): string;
9/**
10 * Converts an AST into a string, using one set of reasonable
11 * formatting rules.
12 */
13export declare function printWithComments(ast: ASTNode): string;
14export declare function getDescription(node: {
15 description?: StringValueNode;
16 loc?: Location;
17}, options?: {
18 commentDescriptions?: boolean;
19}): string | undefined;
20export declare function getComment(node: {
21 loc?: Location;
22}): undefined | string;
23export declare function getLeadingCommentBlock(node: {
24 loc?: Location;
25}): void | string;
26export declare function dedentBlockStringValue(rawString: string): string;
27/**
28 * @internal
29 */
30export declare function getBlockStringIndentation(lines: ReadonlyArray<string>): number;