import type { ASTNode, Location } from 'graphql'; import { ProjectSource } from '../../project/source.js'; export declare class SourcePosition { readonly offset: number; readonly line: number; readonly column: number; /** * @param {number} offset the zero-based character offset within the source * @param {number} line the one-based line number * @param {number} column the one-based column number */ constructor(offset: number, line: number, column: number); } export type LocationLike = MessageLocation | Location | ASTNode; export declare class MessageLocation { readonly _start: SourcePosition | number; readonly _end: SourcePosition | number; readonly sourceName: string; readonly source: ProjectSource; constructor(source: string | ProjectSource, _start: SourcePosition | number, _end: SourcePosition | number); static from(location: LocationLike | undefined): MessageLocation | undefined; static fromGraphQLLocation(loc: Location): MessageLocation; get start(): SourcePosition; get end(): SourcePosition; toString(): string; } export declare function isASTNode(obj: LocationLike): obj is ASTNode; /** * Gets the location of a part of a string value, e.g. of a segment in a field path * * Works with GraphQL string values (including block strings), and with the locations of JSON and * YAML values in a pathLocationMap (quoted or not, and including the key for YAML map entries). If * the offsets can't be mapped to the source (e.g. because of escape sequences), the location of * the whole string is returned. * * @param node the string value * @param offset the offset of the part within the value * @param length the length of the part */ export declare function locationWithinStringArgument(node: LocationLike, offset: number, length: number): MessageLocation | undefined;