@atomist/automation-client
Version:
Atomist API for software low-level client
34 lines • 999 B
TypeScript
import { TreeNode } from "@atomist/tree-path";
import { File } from "../../../project/File";
import { FileParser } from "../FileParser";
/**
* Parameters to RegexFileParser
*/
export interface RegexOptions {
/**
* Name of the root element within a document
*/
readonly rootName: string;
/**
* Path element name for each match
*/
readonly matchName: string;
/**
* Regex. May contain capture groups: If so name them with captureGroupNames.
*/
readonly regex: RegExp;
/**
* Names of the capture groups, if any. This is used to populate the tree structure.
*/
readonly captureGroupNames?: string[];
}
/**
* Allow path expressions against results from a regex with capture groups
*/
export declare class RegexFileParser implements FileParser {
readonly opts: RegexOptions;
constructor(opts: RegexOptions);
get rootName(): string;
toAst(f: File): Promise<TreeNode>;
}
//# sourceMappingURL=RegexFileParser.d.ts.map