@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
44 lines (43 loc) • 3.31 kB
TypeScript
import type { BasicQueryData } from '../../base-query-format';
import type { SignatureQuery, SignatureQueryResult, SignaturePackageView, SignatureFunctionView } from './signature-query-format';
import { type PackageSignatureSource } from '../../../project/sigdb/reader';
import type { REnvironmentInformation } from '../../../dataflow/environments/environment';
import type { CommandCompletions } from '../../../cli/repl/core';
/** the CRAN package landing page (only meaningful for CRAN packages, not base R) */
export declare function cranPageUrl(pkg: string): string;
/** deep-link a definition into the CRAN mirror at the package's version tag (falling back to `HEAD`) */
export declare function cranMirrorSourceUrl(pkg: string, version: string | undefined, file: string, line?: number): string;
/**
* The mirror ref holding an R version. The mirror carries no tags, only a `R-<major>-<minor>-branch` per release
* series, so a link is exact to the minor release and points at its latest patch; `trunk` stands in when the version
* is unknown.
*/
export declare function rSourceRef(version: string | undefined): string;
/** deep-link a base-R definition into the R sources mirror at the release series of `version` */
export declare function rSourceUrl(pkg: string, version: string | undefined, file: string, line?: number): string;
/** best-effort rdrr.io documentation link: `/r/<pkg>/<fn>` for base R, `/cran/<pkg>/man/<fn>` for CRAN */
export declare function rdrrDocUrl(pkg: string, fn: string, opts: {
base: boolean;
cran: boolean;
}): string | undefined;
/**
* The detailed view of a single function within a package: its signature (parameters, forced/optional,
* defaults), properties, definition location, call graph, and for a CRAN package a deep link into the
* read-only CRAN GitHub mirror. `version` defaults to the source's latest; `undefined` when the source does
* not carry that function.
*/
export declare function signatureFunctionInfo(src: PackageSignatureSource, pkg: string, fnName: string, version?: string, env?: REnvironmentInformation): SignatureFunctionView | undefined;
/** the full view of a package: version, kind, export breakdown, dependencies, and every function's view */
export declare function signaturePackageInfo(src: PackageSignatureSource, pkg: string, resolved?: string): SignaturePackageView | undefined;
/**
* Tab-completer for `:query \@signature` / `:signature query`: package names in the first position, a package's
* function names in the second (and after `pkg::`). Version specs and flags are left alone. Enumerating functions
* decompresses the package's shard once (then cached); enumerating packages reads only the manifest.
*/
export declare function signatureQueryCompleter(line: readonly string[], startingNewArg: boolean): CommandCompletions;
/**
* Executes the signature query. With no `package` it summarizes the loaded databases. A glob in `package`/`function`
* or a multi-version `version` triggers a wildcard search (matching packages or functions). Otherwise a single
* exact package (optionally at an exact `version`) yields its full view, or the detailed function view.
*/
export declare function executeSignatureQuery({ analyzer }: BasicQueryData, queries: readonly SignatureQuery[]): Promise<SignatureQueryResult>;