import CycloneDxSbom from "./cyclone_dx_sbom.js"; export default class Sbom { #private; sbomModel: CycloneDxSbom; constructor(); /** * @param {PackageURL} root - add main/root component for sbom * @param {string|Array} [licenses] - optional license(s) for the root component * @return Sbom */ addRoot(root: PackageURL, licenses?: string | any[]): CycloneDxSbom; /** * @return {{{"bom-ref": string, name, purl: string, type, version}}} root component of sbom. */ getRoot(): {}; /** * This method gets an array of dependencies to be ignored, and remove all of them from sbom * @param {Array} dependencies to be removed from sbom * @return {Sbom} without ignored dependencies */ filterIgnoredDeps(deps: any): Sbom; /** * This method gets an array of dependencies with versions( purl string format) to be ignored, and remove all of them from CycloneDx Sbom * @param {Array} dependencies to be removed from sbom * @return {CycloneDxSbom} without ignored dependencies */ filterIgnoredDepsIncludingVersion(deps: any): CycloneDxSbom; /** * @param {component} sourceRef current source Component ( Starting from root component by clients) * @param {PackageURL} targetRef current dependency to add to Dependencies list of component sourceRef * @param {string} [scope] - Scope of the dependency * @param {Array<{alg: string, content: string}>} [targetHashes] - Optional hashes for the target component * @return Sbom */ addDependency(sourceRef: component, targetRef: PackageURL, scope?: string, targetHashes?: Array<{ alg: string; content: string; }>): CycloneDxSbom; /** * Attach hashes to existing components by matching their PURL. Post-processing * step used by ecosystem-specific providers (e.g. Maven) to enrich the SBOM * with artifact hashes without leaking their concern into the shared parser. * @param {Map>} hashMap - PURL→hashes map * @return {Sbom} */ attachHashes(hashMap: Map>): Sbom; /** * @return String sbom json in a string format */ getAsJsonString(opts?: {}): string; /** * This method gets a PackageUrl, and returns a Component of Sbom * @param purl {PackageURL} * @return component */ purlToComponent(purl: PackageURL): { "bom-ref": string; name: any; purl: string; type: any; version: any; scope: any; licenses?: any; hashes?: any; }; /** This method gets a component object, and a string name, and checks if the name is a substring of the component' purl. * @param {} component to search in its dependencies * @param {String} name to be checked. * * @return {boolean} */ checkIfPackageInsideDependsOnList(component: any, name: string): boolean; /** * Checks if any entry in the dependsOn list of sourceRef starts with the given purl prefix. * @param {PackageURL} sourceRef - The source component to check * @param {string} purlPrefix - The purl prefix to match (e.g. "pkg:npm/minimist@") * @return {boolean} */ checkDependsOnByPurlPrefix(sourceRef: PackageURL, purlPrefix: string): boolean; /** Removes the root component from the sbom */ removeRootComponent(): void; }