UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

30 lines (29 loc) 1.42 kB
/** * What a reader most likely meant when typing a name: a well-used package first, base R ahead of CRAN, and * the things one rarely reaches for last, which are S3 methods, `%operators%` and names starting with a dot. * * The signature browser and the playground's completion both offer names out of the same database, so they * order them with the same {@link rankName}, and what one of them learns the other one knows. */ export interface NameRankInput { /** the name being offered */ readonly name: string; /** what was typed, empty when nothing was */ readonly needle: string; /** how far down the fuzzy match sits, `0` being the closest; `0` when nothing was typed */ readonly rank?: number; /** how often the owning package was downloaded, `0` when unknown */ readonly downloads?: number; /** the owning package ships with R */ readonly baseR?: boolean; /** the owning package is `base` itself */ readonly base?: boolean; /** flowR carries a definition of its own for the name, so it is one people actually call */ readonly known?: boolean; /** the name is an S3 method, like `print.foo` */ readonly s3?: boolean; /** the name holds a value rather than a function */ readonly variable?: boolean; } /** The points {@link NameRankInput} earns, higher being offered first. */ export declare function rankName(of: NameRankInput): number;