Skip to content

Commit

Permalink
chore(typing): fix dependency typings
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed May 31, 2021
1 parent a676447 commit fae72a8
Showing 1 changed file with 57 additions and 19 deletions.
76 changes: 57 additions & 19 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,47 +104,85 @@ interface BannerOptions {

export type Banner = string | BannerOptions;

/**
* Dependency Repository Description.
*/
interface DependencyRepository {
/**
* Repository URL.
*/
readonly url: string;

/**
* Repository Type (git, svn, etc.).
*/
readonly type: string;
}

/**
* Dependency information is derived from the package.json file
*/
export interface Dependency {
readonly name: string,
readonly maintainers: string[],
readonly version: string,
readonly description: string,
readonly repository: {
readonly url: string,
readonly type: string,
},
/**
* Dependency Name.
*/
readonly name: string | null;

/**
* Dependency Maintainers list.
*/
readonly maintainers: string[];

readonly homepage: string,
/**
* Dependency Version.
*/
readonly version: string | null;

/**
* Dependency Description.
*/
readonly description: string | null;

/**
* Dependency Repository Location.
*/
readonly repository: string | DependencyRepository | null;

/**
* If dependency is private
* Repository Public Homepage.
*/
readonly private: boolean,
readonly homepage: string | null;

/**
* SPDX License short ID
* If dependency is private.
*/
readonly license: string,
readonly private: boolean;

/**
* Full License file text
* SPDX License short ID.
*/
readonly licenseText: string,
readonly license: string | null;

/**
* Author information
* Full License file text.
*/
readonly author: Person,
readonly contributors: Person[],
readonly licenseText: string | null;

/**
* Author information.
*/
readonly author: Person | null;

/**
* Dependency Contributes list.
*/
readonly contributors: Person[];

/**
* Turns the dependency into a formatted string
* @returns formatted dependency license info
*/
text: () => string,
text: () => string;
}

export type ThirdPartyOutput = string | ((dependencies: Dependency[]) => void) | {
Expand Down

0 comments on commit fae72a8

Please sign in to comment.