@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
49 lines (48 loc) • 2.6 kB
TypeScript
import { AbstractFlowrAnalyzerContext } from './abstract-flowr-analyzer-context';
import { FlowrAnalyzerPackageVersionsPlugin } from '../plugins/package-version-plugins/flowr-analyzer-package-versions-plugin';
import type { Package } from '../plugins/package-version-plugins/package';
import type { FlowrAnalyzerFunctionsContext, ReadOnlyFlowrAnalyzerFunctionsContext } from './flowr-analyzer-functions-context';
/**
* This is a read-only interface to the {@link FlowrAnalyzerDependenciesContext}.
* It prevents you from modifying the dependencies, but allows you to inspect them (which is probably what you want when using the {@link FlowrAnalyzer}).
* If you are a {@link FlowrAnalyzerPackageVersionsPlugin} and want to modify the dependencies, you can use the {@link FlowrAnalyzerDependenciesContext} directly.
*/
export interface ReadOnlyFlowrAnalyzerDependenciesContext {
/**
* The name of this context.
*/
readonly name: string;
/**
* The functions context associated with this dependencies-context.
*/
readonly functionsContext: ReadOnlyFlowrAnalyzerFunctionsContext;
/**
* Get the dependency with the given name, if it exists.
*
* If the static dependencies have not yet been loaded, this may trigger a resolution step.
* @param name - The name of the dependency to get.
* @returns The dependency with the given name, or undefined if it does not exist.
*/
getDependency(name: string): Readonly<Package> | undefined;
/**
* Get all dependencies known to this context.
*/
getDependencies(): readonly Readonly<Package>[];
}
/**
* This context is responsible for managing the dependencies of the project, including their versions and interplays with {@link FlowrAnalyzerPackageVersionsPlugin}s.
*
* If you are interested in inspecting these dependencies, refer to {@link ReadOnlyFlowrAnalyzerDependenciesContext}.
*/
export declare class FlowrAnalyzerDependenciesContext extends AbstractFlowrAnalyzerContext<undefined, void, FlowrAnalyzerPackageVersionsPlugin> implements ReadOnlyFlowrAnalyzerDependenciesContext {
readonly name = "flowr-analyzer-dependencies-context";
readonly functionsContext: FlowrAnalyzerFunctionsContext;
private dependencies;
private staticsLoaded;
reset(): void;
constructor(functionsContext: FlowrAnalyzerFunctionsContext, plugins?: readonly FlowrAnalyzerPackageVersionsPlugin[]);
resolveStaticDependencies(): void;
addDependency(pkg: Package): void;
getDependency(name: string): Package | undefined;
getDependencies(): Package[];
}