@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
30 lines (29 loc) • 2.04 kB
TypeScript
import { type MetaStatistics } from './meta-statistics';
import type { RParseRequestFromFile, RParseRequestFromText } from '../r-bridge/retriever';
import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
import { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
import type { RShell } from '../r-bridge/shell';
import { type FeatureSelection, type FeatureStatistics } from './features/feature';
import type { FlowrConfig } from '../config';
/**
* By default, {@link extractUsageStatistics} requires a generator, but sometimes you already know all the files
* that you want to process. This function simply reps your requests as a generator.
*/
export declare function staticRequests(...requests: (RParseRequestFromText | RParseRequestFromFile)[]): AsyncGenerator<RParseRequestFromText | RParseRequestFromFile>;
type DataflowResult = PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>;
/**
* Extract all wanted statistic information from a set of requests using the presented R session.
* @param shell - The R session to use
* @param config - The flowr config
* @param onRequest - A callback that is called at the beginning of each request, this may be used to debug the requests.
* @param features - The features to extract (see {@link allFeatureNames}).
* @param requests - The requests to extract the features from. May generate them on demand (e.g., by traversing a folder).
* If your request is statically known, you can use {@link staticRequests} to create this generator.
* @param rootPath - The root path to the project, this is used to relativize the file paths in the statistics.
*/
export declare function extractUsageStatistics<T extends RParseRequestFromText | RParseRequestFromFile>(shell: RShell, config: FlowrConfig, onRequest: (request: T) => void, features: FeatureSelection, requests: AsyncGenerator<T>, rootPath?: string): Promise<{
features: FeatureStatistics;
meta: MetaStatistics;
outputs: Map<T, DataflowResult>;
}>;
export {};