@eagleoutice/flowr - v2.15.8
    Preparing search index...

    Read-only interface to the FlowrAnalyzerDependenciesContext for inspecting dependencies without modifying them.

    interface ReadOnlyFlowrAnalyzerDependenciesContext {
        availableSignatureDatabases(): readonly string[];
        declaredPackageNames(): readonly string[];
        functionsContext: ReadOnlyFlowrAnalyzerFunctionsContext;
        getDependencies(): readonly Readonly<Package>[];
        getDependency(
            name: string,
            version?: string | Range,
        ): Readonly<Package> | undefined;
        hasSignatureDatabase(): boolean;
        inferredRange(name: string): Range | undefined;
        loadedSignatureDatabases(): SigDbLoadedInfo[];
        name: string;
        packagesExporting(name: string): readonly string[];
        signatureOf(id: Identifier, version?: string): DecodedFunction | undefined;
        signatures(): SignatureDb;
        signatureSources(): readonly PackageSignatureSource[];
    }

    Implemented by

    Index

    The functions context associated with this dependencies-context.

    name: string

    The name of this context.

    • The identifying names (scopes, e.g. base/current/history) of the signature databases currently available, deduplicated. A simple view over loadedSignatureDatabases for checking what a project can resolve against; empty when the signature database is disabled or none is loaded.

      Returns readonly string[]

    • Every package name the project declares (Depends/Imports/Suggests/LinkingTo/Enhances), whether or not it became a loadable dependency here. Suggests do not, yet they still name packages the project may install.

      Returns readonly string[]

    • 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. Pass version to pin the resolution to a constraint (an exact version string, or a Range; uncached; versionOverrides config still wins, base-R stays tied to the assumed R version); otherwise the version comes from the declared constraints.

      Parameters

      • name: string

        The name of the dependency to get.

      • Optionalversion: string | Range

        Optional version constraint to pin the resolution to (exact version string or a Range).

      Returns Readonly<Package> | undefined

      The dependency with the given name, or undefined if it does not exist.

    • The versions a dependency can possibly have: its derived range, but only once some version can satisfy it. undefined if the dependency is unknown, if nothing constrains it, or if the sources contradict each other, since then no version is possible at all.

      For why it is what it is (the individual constraints, or the version the database resolved to), take the Package from getDependency.

      Parameters

      • name: string

        The name of the dependency.

      Returns Range | undefined

    • The names of known packages that export name (from the version plugins' signature databases). Used to hint which library()/:: might be missing for an otherwise-undefined symbol. Empty if no database is available or the signature database is disabled.

      Parameters

      • name: string

      Returns readonly string[]

    • The way to reach the signature database programmatically.

      Everything the database can answer is on the returned SignatureDb, and it answers for the version this project assumes for each package, which is the one solver.sigdb.versionOverrides, solver.sigdb.versionSelection and solver.sigdb.assumedRVersion produced. A bare PackageSignatureSource would instead answer for whatever it happens to hold as newest.

      Returns SignatureDb

      const db = analyzer.inspectContext().deps.signatures();
      db.versionOf('dplyr'); // the version the analysis assumes
      db.functionOf(Identifier.make('lead', 'dplyr')); // its database entry
      db.parametersOf(Identifier.make('lead', 'dplyr')); // its formals, ready for FunctionSemantics.call.match.toNames