export type GoAstNode = {
  kind: string;
  children: GoAstNode[];
  text?: string;
  operator?: string;
  from: number;
  to: number;
};

export type GoParseResult = {
  accepts: boolean;
  errors: ReadonlyArray<{
    from: number;
    to: number;
    message: string;
  }>;
  tree: GoAstNode;
};

export type GoParser = {
  parse(query: string): Promise<GoParseResult>;
};

export declare function init(): Promise<GoParser>;
export declare function parse(query: string): Promise<GoParseResult>;
