import { Token } from ".."; /** * This function can help you descend layer-by-layer down anything that can open and close itself. Examples of this include the parentheses in mathematical expressions and XML tags. * * For example, this function could be used to parse XML by finding the lowest nested values, parsing those, then parsing their parent and putting their parsed values into the parent. * @param tokens {Token[]} - is the input tokens that will be used. * @param startCheckCallback {RecursiveMapCheckCallback} - is a function that determines if a a given token starts what is being searched for. * @param endCheckCallback {RecursiveMapCheckCallback} - is a function that determines if a given token ends what is being searched for. * @param pushLowestLevelCallback {RecursiveMapPushLowestLevelCallback} - is a function that takes a token on the lowest depth and converts it to the specified type. * @param pushOtherCallback {RecursiveMapPushOtherCallback} - is an optional function that takes an output of a previous recursion and transforms it into the specified type. * @param returnCallback {RecursiveMapReturnCallback} - is an optional function that can be used to specify a custom output to this function. It's output will be returned and its input is the value that would have been returned otherwise. */ export declare const RecursiveMap: (tokens: Token[], startCheckCallback: RecursiveMapCheckCallback, endCheckCallback: RecursiveMapCheckCallback, pushLowestLevelCallback: RecursiveMapPushLowestLevelCallback, pushOtherCallback?: RecursiveMapPushOtherCallback, returnCallback?: RecursiveMapReturnCallback) => Type[]; /** * A function that determines if a a given token starts or ends what is being searched for. */ export declare type RecursiveMapCheckCallback = (token: Token) => boolean; /** * A function that takes a token on the lowest depth and converts it to the specified type. The output should match the type used in the RecursiveMap function. */ export declare type RecursiveMapPushLowestLevelCallback = (token: Token) => any; /** * An optional function that takes an output of a previous recursion and transforms it into the specified type. The input and output should match the type used in the RecursiveMap function. */ export declare type RecursiveMapPushOtherCallback = (tokens: any[], startToken: Token, endToken: Token) => any; /** * An optional function that can be used to specify a custom output to this function. It's output will be returned and its input is the value that would have been returned otherwise. The input and output should match the type used in the RecursiveMap function. */ export declare type RecursiveMapReturnCallback = (tokens: any[]) => any[];