/** * Pure STEP format serialization utilities. * * All functions in this module are pure (no side-effects, no external state) * and deal exclusively with converting data to ISO 10303-21 STEP format strings. */ import { type IfcAttributeValue } from '@ifc-lite/parser'; import { PropertyValueType, QuantityType } from '@ifc-lite/data'; /** * Escape a string for STEP format (backslash and single-quote escaping). * * Control characters (CR/LF and other C0 codes) are collapsed to a single * space so every generated STEP entity stays on one physical line and * round-trips through the line-oriented merge/convert paths. */ export declare function escapeStepString(str: string): string; /** * Convert a number to a valid STEP REAL literal. * Handles NaN/Infinity (-> 0.) and ensures a decimal point is present. */ export declare function toStepReal(v: number): string; /** * Map QuantityType enum to IFC STEP entity type name. */ export declare function quantityTypeToIfcType(type: QuantityType): string; /** * Serialize a property value to STEP format (e.g. IFCLABEL, IFCREAL, etc.). */ export declare function serializePropertyValue(value: unknown, type: PropertyValueType): string; /** * Serialize a root attribute value for STEP, inferring the format from the * existing token (enum, boolean, number, string, etc.). */ export declare function serializeAttributeValue(value: string, currentToken: string): string; /** * Serialize a single STEP attribute value to its on-disk token. * * - `null` / `undefined` → `$` * - booleans → `.T.` / `.F.` * - numbers → STEP integer or REAL literal * - strings starting with `#`, `.ENUM.`, `$`, `*` pass through unchanged * (callers tag references as the string `"#42"` or via `entityRef(42)`) * - other strings are emitted as quoted STEP strings * - arrays are emitted as STEP lists `(a,b,c)`, recursing on each element */ export declare function serializeStepValue(value: IfcAttributeValue): string; /** * Serialize an attribute list to a STEP entity body. * Example: `[1, '.AREA.', null]` → `1,.AREA.,$` */ export declare function serializeStepArgs(values: IfcAttributeValue[]): string; /** Tag a number as a STEP entity reference (`#N`) for `serializeStepValue`. */ export declare function entityRef(expressId: number): string; /** * Split a STEP argument list on top-level commas, respecting nested * parentheses and quoted strings. Used by `applyAttributeMutations`. */ export declare function splitTopLevelArgs(text: string): string[]; /** * Split a STEP argument list on top-level commas while preserving nested syntax. * Similar to `splitTopLevelArgs` but uses a slightly different accumulation style * suited for the `replaceEntityAttribute` call-site. */ export declare function splitTopLevelStepArguments(input: string): string[]; /** * Assemble a STEP file from header and entity lines as a Uint8Array. * Encodes each entity individually to avoid hitting V8's ~256 MB string * length limit on large models. Shared by the STEP and merged exporters * (was duplicated byte-for-byte in both — alignment audit). */ export declare function assembleStepBytes(header: string, entities: string[]): Uint8Array; //# sourceMappingURL=step-serialization.d.ts.map