UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

23 lines (22 loc) 1.31 kB
import type { FlowrSearchElement } 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 { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer'; export declare enum Mapper { Enrichment = "enrichment" } export interface MapperData<Arguments extends string | MergeableRecord> { mapper: (e: FlowrSearchElement<ParentInformation>, data: ReadonlyFlowrAnalysisProvider, 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: ReadonlyFlowrAnalysisProvider, enrichment: Enrichment) => FlowrSearchElement<ParentInformation>[]; }; }; /** * Maps the given search element using the specified mapper and arguments. */ export declare function map<Element extends FlowrSearchElement<ParentInformation>, MapperType extends Mapper>(e: Element, data: ReadonlyFlowrAnalysisProvider, mapper: MapperType, args: MapperArguments<MapperType>): Element[]; export {};