/** * Maintains a bidirectional mapping between product IDs and shape IDs. * * This class allows efficient querying of all shapes associated with a product, * all products associated with a shape, and iteration over all unique product-shape pairs. * * - Each product ID/product def can be associated with multiple shape IDs, and vice versa. * - It is expected that a product ID and product definition ID are map a singular product * to one or more product definitions, but that there is only a singular constnat product ID * for a given product definition ID. * - The mapping is idempotent: adding the same product-shape pair multiple times has no effect after the first addition. * - The total count reflects the number of unique product-shape pairs. */ export declare class AP214ProductShapeMap { private productsToProductDefs_; private productDefsToProducts_; private productDefsToShapes_; private shapesToProductDefs_; private _count; /** * Adds a product-shape pair. Idempotent: does not add duplicates. * * @param productId Product numerical id * @param shapeId Shape numerical id * * @return {boolean} True if the pair was added, false if it already existed. */ /** * Adds a mapping between a product and its product definition to a shape. * If the product def share pair does not already exist, it is added to both * the product-to-shapes and shape-to-products maps, and the internal count is incremented. * * @param productId - The local ID of the product. * @param productDefitionId - The local ID of the product definition. * @param shapeId - The local ID of the shape. * @return {true} if the pair was newly added; `false` if the pair already existed. */ addProductShapePair(productId: number, productDefitionId: number, shapeId: number): boolean; /** * Returns the number of unique product-shape pairs. * * @return {number} The count of unique product-shape pairs. */ get count(): number; /** * Gets the set of shape ids for a given product id. * * @param productId Product numerical id * * @return {Set | undefined} A set of shape ids associated with the product, or undefined if no shapes are associated. */ getShapesForProduct(productId: number): Set | undefined; /** * Gets the set of product ids for a given shape id. * * @param shapeId Shape numerical id * * @return {Set | undefined} A set of product ids associated with the shape, or undefined if no products are associated. */ getProductDefForShape(shapeId: number): Set | undefined; /** * Get the s for a shape, given the shape local ID. * * @param shapeId The local ID of the shape. * @return {Set< number > | undefined} The local IDs of the product definition associated with the * shape, or undefined if no product definition is associated with the shape. */ getProductDefForShapeId(shapeId: number): Set | undefined; /** * Get the ids of product defs mapped to their associated products. * * @yields {[number, Set]} Returns an iterator of [productId, Set] pairs. */ productsToProductDefs(): IterableIterator<[number, Set]>; /** * Get the ids of products mapped to their associated shapes. * * @yields {[number, Set]} Returns an iterator of [productId, Set] pairs. */ productDefsToShapes(): IterableIterator<[number, Set]>; /** * Returns an iterator of [shapeId, Set] pairs. * * @yields {[number, Set]} Returns an iterator of [shapeId, Set] pairs. */ shapesToProductsDefs(): IterableIterator<[number, Set]>; /** * Returns an iterator of all unique [productId productDefinitionId, shapeId] tuples. * * @yields {[number, number]} An iterator of unique product-shape tuples. */ tuples(): IterableIterator<[number, number, number]>; } //# sourceMappingURL=ap214_product_shape_map.d.ts.map