jsii-docgen
Version:
generates api docs for jsii modules
26 lines (25 loc) • 1.2 kB
TypeScript
export interface AssemblyInfo {
readonly name: string;
readonly version: string;
readonly path: string;
}
export type AssemblyLookup = Record<string, AssemblyInfo>;
/**
* Given an AssemblyLookup map and an assembly name + version constraint,
* returns the best possible match.
*
* This is not a strict semver implementation, instead the following algorithm is used:
* 1. the highest (latest) version matching the semver constraint
* 2. a matching major version, even if constraint doesn't match (this will use the lowest major version of the constraint)
* 3. the highest available version of the dependency regardless of constraint
*
* @param assemblies a map of assembly identifier to name, version and path
* @param constraint the assembly name and version to match
*
* @returns the best matching assembly info or undefined if no match was found
*/
export declare function bestAssemblyMatch(assemblies: AssemblyLookup, constraint: string): AssemblyInfo | undefined;
/**
* Search a directory for jsii assemblies and return a map of assembly identifier to name, version and path.
*/
export declare function discoverAssemblies(searchDir: string): AssemblyLookup;