gherkin-ast
Version:
JS model for Gherkin feature files
33 lines (32 loc) • 1.46 kB
TypeScript
import { GherkinComment, GherkinLocation, GherkinTag } from "./gherkinObject";
import { Comment } from "./ast/comment";
export declare const safeString: (s?: string) => string;
export declare const normalizeString: (s?: string) => string;
export declare const prefixString: (s?: string, prefix?: string, delimiter?: string) => string;
export declare const replaceAll: (s: string, key: RegExp | string, value: string) => string;
interface Clonable<T> {
clone(): T;
}
export declare const cloneArray: <T extends Clonable<T>>(array: T[]) => T[];
interface Replacable {
replace(key: RegExp | string, value: string): void;
}
export declare const replaceArray: <T extends Replacable>(array: T[], key: RegExp | string, value: string) => void;
export declare class GherkinCommentHandler {
comments: GherkinComment[];
firstLine: number;
lastLine: number;
private debug;
constructor(comments: GherkinComment[]);
private storeLine;
findCommentIndexBefore(location: GherkinLocation): number;
popFromIndex(i: number): GherkinComment;
popCommentsRightBefore(location: GherkinLocation): GherkinComment[];
parseComment(location: GherkinLocation, from?: GherkinLocation): Comment;
parseTagComment(tags: GherkinTag[]): Comment;
parseCommentBetween(locA: GherkinLocation, locB: GherkinLocation): Comment;
parseStartingComment(): Comment;
parseEndingComment(): Comment;
private parseMultiLineComment;
}
export {};