UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

40 lines (39 loc) 2.27 kB
import { type LintingResult, LintingResultCertainty } from '../linter-format'; import type { FlowrSearchElement, FlowrSearchElements } from '../../search/flowr-search'; import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { MergeableRecord } from '../../util/objects'; import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info'; import { Identifier } from '../../dataflow/environments/identifier'; import { Ternary } from '../../util/logic'; import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer'; import type { AsyncOrSync } from 'ts-essentials'; export interface FunctionsResult extends LintingResult { function: string; } export interface FunctionsMetadata extends MergeableRecord { totalCalls: number; totalFunctionDefinitions: number; } export interface FunctionsToDetectConfig extends MergeableRecord { /** * The list of function names that should be marked in the given context. */ fns: readonly Identifier[]; } /** * This helper object collects utility functions used to create linting rules that search for specific functions. */ export declare const functionFinderUtil: { createSearch: (functions: readonly Identifier[]) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter", "with", "filter"], ParentInformation, Promise<FlowrSearchElements<ParentInformation, [] | FlowrSearchElement<ParentInformation>[]>>>; processSearchResult<T extends FlowrSearchElement<ParentInformation>[]>(this: void, elements: FlowrSearchElements<ParentInformation, T>, _config: unknown, _data: unknown, refineSearch?: (elements: T) => AsyncOrSync<(T[number] & { certainty?: LintingResultCertainty; })[]>): Promise<{ results: FunctionsResult[]; '.meta': FunctionsMetadata; }>; prettyPrint: (functionType: string) => { query: (result: FunctionsResult) => string; full: (result: FunctionsResult) => string; }; requireArgumentValue(element: FlowrSearchElement<ParentInformation>, pool: ReadonlyMap<string, FunctionInfo>, analyzer: ReadonlyFlowrAnalysisProvider, requireValue: RegExp | string | undefined): Promise<Ternary>; };