/** * On-demand extraction functions for classifications, materials, documents, * georeferencing, relationships, and type properties. * * These functions parse data lazily from the IFC source buffer when accessed, * rather than pre-building all data upfront during initial parse. */ import type { IfcEntity } from './types.js'; import { EntityExtractor } from './entity-extractor.js'; import type { PropertyValue } from '@ifc-lite/data'; import type { IfcDataStore } from './columnar-parser.js'; import { type GeoreferenceInfo } from './georef-extractor.js'; export { extractClassificationsOnDemand } from './classification-resolver.js'; export type { ClassificationInfo } from './classification-resolver.js'; export { extractMaterialsOnDemand } from './material-resolver.js'; export type { MaterialInfo, MaterialLayerInfo, MaterialProfileInfo, MaterialConstituentInfo } from './material-resolver.js'; export { resolveMaterialDefId, collectMaterialLeaves, buildMaterialUsageIndex, getMaterialDisplay, } from './material-resolver.js'; export type { MaterialLeaf, MaterialUsage } from './material-resolver.js'; /** * Result of type-level property extraction. */ export interface TypePropertyInfo { typeName: string; typeId: number; properties: Array<{ name: string; globalId?: string; properties: Array<{ name: string; type: number; value: PropertyValue; values?: string[]; dataType?: string; }>; }>; } /** * Structured document info from IFC document references. */ export interface DocumentInfo { name?: string; description?: string; location?: string; identification?: string; purpose?: string; intendedUse?: string; revision?: string; confidentiality?: string; } /** * Structured relationship info for an entity. */ export interface EntityRelationships { voids: Array<{ id: number; name?: string; type: string; }>; fills: Array<{ id: number; name?: string; type: string; }>; /** Groups this entity is assigned to (IfcZone, IfcGroup, IfcSystem, …) via * IfcRelAssignsToGroup. `type` distinguishes IfcZone from a plain IfcGroup. */ groups: Array<{ id: number; name?: string; type: string; }>; connections: Array<{ id: number; name?: string; type: string; }>; } export type { GeoreferenceInfo as GeorefInfo }; /** * Property sets attached to a material via IfcMaterialProperties (e.g. * Pset_MaterialConcrete). Grouped per underlying IfcMaterial so the UI can * show which material each set belongs to. See {@link extractMaterialPropertiesOnDemand}. */ export interface MaterialPsetGroup { materialId: number; materialName: string; psets: Array<{ name: string; properties: Array<{ name: string; type: number; value: PropertyValue; values?: string[]; dataType?: string; }>; }>; } /** * Parse a property entity's value based on its IFC type. * Handles all 6 IfcProperty subtypes: * - IfcPropertySingleValue: direct value * - IfcPropertyEnumeratedValue: list of enum values → joined string * - IfcPropertyBoundedValue: upper/lower bounds → "value [min – max]" * - IfcPropertyListValue: list of values → joined string * - IfcPropertyTableValue: defining/defined value pairs → "Table(N rows)" * - IfcPropertyReferenceValue: entity reference → "Reference #ID" */ export declare function parsePropertyValue(propEntity: IfcEntity): { type: number; value: PropertyValue; values?: string[]; dataType?: string; }; /** Extract a numeric value from a possibly typed STEP value. */ export declare function extractNumericValue(attr: unknown): number | null; /** * Extract property sets from a list of pset IDs using the entity index. * Shared logic between instance-level and type-level property extraction. */ export declare function extractPsetsFromIds(store: IfcDataStore, extractor: EntityExtractor, psetIds: number[]): Array<{ name: string; globalId?: string; properties: Array<{ name: string; type: number; value: PropertyValue; values?: string[]; dataType?: string; }>; }>; /** * Extract type-level properties for a single entity ON-DEMAND. * Finds the element's type via IfcRelDefinesByType, then extracts property sets from: * 1. The type entity's HasPropertySets attribute (IFC2X3/IFC4: index 5 on IfcTypeObject) * 2. The onDemandPropertyMap for the type entity (IFC4 IFCRELDEFINESBYPROPERTIES → type) * Returns null if no type relationship exists. */ export declare function extractTypePropertiesOnDemand(store: IfcDataStore, entityId: number): TypePropertyInfo | null; /** * Extract properties from a type entity's own HasPropertySets attribute. * Used when the type entity itself is selected (e.g., via "By Type" tree). * Returns the type's own property sets from attribute index 5 + any via IfcRelDefinesByProperties. */ export declare function extractTypeEntityOwnProperties(store: IfcDataStore, typeEntityId: number): Array<{ name: string; globalId?: string; properties: Array<{ name: string; type: number; value: PropertyValue; values?: string[]; }>; }>; /** * Extract documents for a single entity ON-DEMAND. * Uses the onDemandDocumentMap built during parsing. * Falls back to relationship graph when on-demand map is not available. * Also checks type-level documents via IfcRelDefinesByType. * Returns an array of document info objects. */ export declare function extractDocumentsOnDemand(store: IfcDataStore, entityId: number): DocumentInfo[]; /** * Extract structural relationships for a single entity ON-DEMAND. * Finds openings (VoidsElement), fills (FillsElement), groups (AssignsToGroup), * and path connections (ConnectsPathElements). */ export declare function extractRelationshipsOnDemand(store: IfcDataStore, entityId: number): EntityRelationships; /** A member object of an IfcZone / IfcGroup (the RelatedObjects of its * IfcRelAssignsToGroup). */ export interface GroupMember { id: number; name?: string; type: string; } /** * Enumerate the member objects of a group/zone ON-DEMAND — the inverse of the * `groups` field in {@link extractRelationshipsOnDemand}. Resolves the * RelatedObjects of the group's IfcRelAssignsToGroup (forward direction: * group → members). For an IfcZone this returns the IfcSpace / IfcSpatialZone * members so the UI can select/isolate everything in a dwelling, house number, * fire compartment, etc. (#1075). */ export declare function extractGroupMembersOnDemand(store: IfcDataStore, groupId: number): GroupMember[]; /** * Extract georeferencing info from on-demand store (source buffer + entityIndex). * Bridges to the entity-based georef extractor by resolving entities lazily. */ export declare function extractGeoreferencingOnDemand(store: IfcDataStore): GeoreferenceInfo | null; /** * Material property sets associated with a selected element, resolved through * its material association. Fans out a layer/profile/constituent set to its * member IfcMaterials (where Pset_Material* typically lives) and also checks * the set definition itself. Returns one group per material that has psets. */ export declare function extractMaterialPropertiesOnDemand(store: IfcDataStore, entityId: number): MaterialPsetGroup[]; /** * Material property sets for a directly-selected material entity (the Materials * hierarchy tab). Includes the material's own psets plus, when it is a set * definition, those of its member materials. */ export declare function extractMaterialPropertiesForMaterialId(store: IfcDataStore, materialId: number): MaterialPsetGroup[]; //# sourceMappingURL=on-demand-extractors.d.ts.map