@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
45 lines (44 loc) • 2.35 kB
TypeScript
/** https://r-pkgs.org/description.html#sec-description-authors-at-r */
export declare enum AuthorRole {
/** the creator or maintainer, the person you should bother if you have problems. Despite being short for “creator”, this is the correct role to use for the current maintainer, even if they are not the initial creator of the package. */
Creator = "cre",
/** authors, those who have made significant contributions to the package. */
Author = "aut",
/** contributors, those who have made smaller contributions, like patches. */
Contributor = "ctb",
/** copyright holder. This is used to list additional copyright holders who are not authors, typically companies, like an employer of one or more of the authors. */
CopyrightHolder = "cph",
/** funder, the people or organizations that have provided financial support for the development of the package. */
Funder = "fnd"
}
/**
* Information about an author.
* See {@link parseRAuthorString} for parsing R `Authors@R` strings, and {@link rAuthorInfoToReadable} for printing them.
*/
export interface RAuthorInfo {
/** The name (components) of the author. */
readonly name: string[];
/** The email of the author, if available. */
readonly email?: string;
/** The roles of the author in the project. */
readonly roles: AuthorRole[];
/** The ORCID of the author, if available. */
readonly orcid?: string;
/** Any additional comments about the author. */
readonly comment?: string[];
}
/**
* Convert structured R author information into an R `Authors@R` string.
*/
export declare function rAuthorInfoToReadable(author: RAuthorInfo): string;
/**
* Parse an R `Authors@R` string into structured author information.
* These are mostly found in `R` DESCRIPTION files and are a vector of `person()` calls.
* For now, this works *without* the full dataflow engine, so complex cases may not be parsed correctly.
*/
export declare function parseRAuthorString(authorString: string): RAuthorInfo[];
/**
* In contrast to `parseRAuthorString`, this function parses simple textual author strings,
* like `First Middle Last <email> [roles] (comment)...`. It does not support the full R `person()` syntax.
*/
export declare function parseTextualAuthorString(authorString: string, addRoles?: AuthorRole[]): RAuthorInfo[];