@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
20 lines (19 loc) • 1.22 kB
TypeScript
import type { FlowrSearchElement, FlowrSearchInput } from '../flowr-search';
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
import type { Enrichment } from './search-enrichers';
import type { MergeableRecord } from '../../util/objects';
import type { Pipeline } from '../../core/steps/pipeline/pipeline';
export declare enum Mapper {
Enrichment = "enrichment"
}
export interface MapperData<Arguments extends string | MergeableRecord> {
mapper: (e: FlowrSearchElement<ParentInformation>, data: FlowrSearchInput<Pipeline>, args: Arguments) => FlowrSearchElement<ParentInformation>[];
}
export type MapperArguments<M extends Mapper> = typeof Mappers[M] extends MapperData<infer Arguments> ? Arguments : never;
declare const Mappers: {
readonly enrichment: {
mapper: (e: FlowrSearchElement<ParentInformation>, _data: FlowrSearchInput<Pipeline>, enrichment: Enrichment) => FlowrSearchElement<ParentInformation>[];
};
};
export declare function map<Element extends FlowrSearchElement<ParentInformation>, MapperType extends Mapper>(e: Element, data: FlowrSearchInput<Pipeline>, mapper: MapperType, args: MapperArguments<MapperType>): Element[];
export {};