Interface EnrichmentData<ElementContent, ElementArguments, SearchContent, SearchArguments>

interface EnrichmentData<
    ElementContent extends MergeableRecord,
    ElementArguments = undefined,
    SearchContent extends MergeableRecord = never,
    SearchArguments = ElementArguments,
> {
    enrichElement?: (
        element: FlowrSearchElement<ParentInformation>,
        search: FlowrSearchElements<ParentInformation>,
        data: {
            cfg: ControlFlowInformation;
            dataflow: DataflowInformation;
            normalize: NormalizedAst;
        },
        args: undefined | ElementArguments,
        previousValue: undefined | ElementContent,
    ) => AsyncOrSync<ElementContent>;
    enrichSearch?: (
        search: FlowrSearchElements<ParentInformation>,
        data: FlowrAnalysisProvider,
        args: undefined | SearchArguments,
        previousValue: undefined | SearchContent,
    ) => AsyncOrSync<SearchContent>;
    mapper?: (
        content: ElementContent,
    ) => FlowrSearchElement<ParentInformation>[];
}

Type Parameters

Properties

enrichElement?: (
    element: FlowrSearchElement<ParentInformation>,
    search: FlowrSearchElements<ParentInformation>,
    data: {
        cfg: ControlFlowInformation;
        dataflow: DataflowInformation;
        normalize: NormalizedAst;
    },
    args: undefined | ElementArguments,
    previousValue: undefined | ElementContent,
) => AsyncOrSync<ElementContent>

A function that is applied to each element of the search to enrich it with additional data.

enrichSearch?: (
    search: FlowrSearchElements<ParentInformation>,
    data: FlowrAnalysisProvider,
    args: undefined | SearchArguments,
    previousValue: undefined | SearchContent,
) => AsyncOrSync<SearchContent>

The mapping function used by the Mapper.Enrichment mapper.