UNPKG

@cyclonedx/cyclonedx-library

Version:

Core functionality of CycloneDX for JavaScript (Node.js or WebBrowser).

100 lines (96 loc) 3.77 kB
/*! This file is part of CycloneDX JavaScript Library. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 Copyright (c) OWASP Foundation. All Rights Reserved. */ import type { PackageURL } from 'packageurl-js'; import type { Comparable } from '../_helpers/sortable'; import { SortableComparables } from '../_helpers/sortable'; import { treeIteratorSymbol } from '../_helpers/tree'; import type { ComponentScope, ComponentType } from '../enums'; import type { CPE } from '../types/cpe'; import { BomRef, BomRefRepository } from './bomRef'; import type { Copyright } from './copyright'; import { CopyrightRepository } from './copyright'; import { ExternalReferenceRepository } from './externalReference'; import { HashDictionary } from './hash'; import { LicenseRepository } from './license'; import type { OrganizationalEntity } from './organizationalEntity'; import { PropertyRepository } from './property'; import type { SWID } from './swid'; export interface OptionalComponentProperties { bomRef?: BomRef['value']; author?: Component['author']; copyright?: Component['copyright']; description?: Component['description']; externalReferences?: Component['externalReferences']; group?: Component['group']; hashes?: Component['hashes']; licenses?: Component['licenses']; publisher?: Component['publisher']; purl?: Component['purl']; scope?: Component['scope']; supplier?: Component['supplier']; swid?: Component['swid']; version?: Component['version']; components?: Component['components']; cpe?: Component['cpe']; properties?: Component['properties']; evidence?: Component['evidence']; dependencies?: Component['dependencies']; } export declare class Component implements Comparable<Component> { #private; type: ComponentType; name: string; author?: string; copyright?: Copyright; description?: string; externalReferences: ExternalReferenceRepository; group?: string; hashes: HashDictionary; licenses: LicenseRepository; publisher?: string; purl?: PackageURL; scope?: ComponentScope; supplier?: OrganizationalEntity; swid?: SWID; version?: string; components: ComponentRepository; properties: PropertyRepository; evidence?: ComponentEvidence; dependencies: BomRefRepository; /** * @throws {@link TypeError} if `op.cpe` is neither {@link CPE} nor `undefined` */ constructor(type: Component['type'], name: Component['name'], op?: OptionalComponentProperties); get bomRef(): BomRef; get cpe(): CPE | undefined; /** * @throws {@link TypeError} if value is neither {@link CPE} nor `undefined` */ set cpe(value: CPE | undefined); compare(other: Component): number; } export declare class ComponentRepository extends SortableComparables<Component> { [treeIteratorSymbol](): Generator<Component>; } export interface OptionalComponentEvidenceProperties { licenses?: ComponentEvidence['licenses']; copyright?: ComponentEvidence['copyright']; } export declare class ComponentEvidence { licenses: LicenseRepository; copyright: CopyrightRepository; constructor(op?: OptionalComponentEvidenceProperties); } //# sourceMappingURL=component.d.ts.map