import { AcCmColor, AcCmEventManager, AcCmTransparency } from '@mlightcad/common'; import { AcDbObject, AcDbObjectId } from '../base/AcDbObject'; import { AcDbConverterType } from './AcDbDatabaseConverterManager'; import { AcDbEntity } from '../entity'; import { AcDbFormatter } from '../misc'; import { AcDbDictionary } from '../object/AcDbDictionary'; import { AcDbMLeaderStyle } from '../object/AcDbMLeaderStyle'; import { AcDbMlineStyle } from '../object/AcDbMlineStyle'; import { AcDbRasterImageDef } from '../object/AcDbRasterImageDef'; import { AcDbXrecord } from '../object/AcDbXrecord'; import { AcDbBlockTable } from './AcDbBlockTable'; import { AcDbConversionStage, AcDbStageStatus } from './AcDbDatabaseConverter'; import { AcDbDimStyleTable } from './AcDbDimStyleTable'; import { AcDbLayerTable } from './AcDbLayerTable'; import { AcDbLayerTableRecord, AcDbLayerTableRecordAttrs } from './AcDbLayerTableRecord'; import { AcDbLinetypeTable } from './AcDbLinetypeTable'; import { AcDbTextStyleTable } from './AcDbTextStyleTable'; import { AcDbViewTable } from './AcDbViewTable'; import { AcDbViewportTable } from './AcDbViewportTable'; import { AcGeBox3d, AcGePoint3d, AcGePoint3dLike } from '@mlightcad/geometry-engine'; import { AcDbDwgVersion } from './AcDbDwgVersion'; import { AcGiLineWeight } from '@mlightcad/graphic-interface'; import { AcDbRegAppTable } from './AcDbRegAppTable'; import { AcDbLayoutDictionary } from '../object/layout/AcDbLayoutDictionary'; /** * Event arguments for object events in the dictionary. */ export interface AcDbDictObjectEventArgs { /** The database that triggered the event */ database: AcDbDatabase; /** The object (or objects) involved in the event */ object: AcDbObject | AcDbObject[]; /** The key name of the object */ key: string; } /** * Event arguments for entity-related events. */ export interface AcDbEntityEventArgs { /** The database that triggered the event */ database: AcDbDatabase; /** The entity (or entities) involved in the event */ entity: AcDbEntity | AcDbEntity[]; } /** * Event arguments for layer-related events. */ export interface AcDbLayerEventArgs { /** The database that triggered the event */ database: AcDbDatabase; /** The layer involved in the event */ layer: AcDbLayerTableRecord; } /** * Event arguments for layer modification events. */ export interface AcDbLayerModifiedEventArgs extends AcDbLayerEventArgs { /** The changes made to the layer */ changes: Partial; } /** * The stage of opening one drawing file */ export type AcDbOpenFileStage = 'FETCH_FILE' | 'CONVERSION'; /** * Event arguments for progress events during database operations. */ export interface AcDbProgressdEventArgs { /** The database that triggered the event */ database: AcDbDatabase; /** The progress percentage (0-100) */ percentage: number; /** The current stage of opening one drawing file */ stage: AcDbOpenFileStage; /** The current sub stage */ subStage?: AcDbConversionStage; /** The status of the current sub stage */ subStageStatus: AcDbStageStatus; /** * Store data associated with the current sub stage. Its meaning of different sub stages * are as follows. * - 'PARSE' stage: statistics of parsing task * - 'FONT' stage: fonts needed by this drawing * * Note: For now, 'PARSE' and 'FONT' sub stages use this field only. */ data?: unknown; } /** * Font information structure. * * Contains information about a font including its name, file path, * type, and URL for loading. */ export interface AcDbFontInfo { /** Array of font names/aliases */ name: string[]; /** Font file name */ file: string; /** Font type (mesh or shx) */ type: 'mesh' | 'shx'; /** URL for loading the font */ url: string; } /** * Interface for loading fonts when opening a document. * * Applications should implement this interface to provide font loading * functionality when opening drawing databases that contain text entities. */ export interface AcDbFontLoader { /** * Loads the specified fonts. * * @param fontNames - Array of font names to load * @returns Promise that resolves when fonts are loaded * * @example * ```typescript * const fontLoader: AcDbFontLoader = { * async load(fontNames: string[]) { * // Load fonts implementation * }, * async getAvaiableFonts() { * return []; * } * }; * ``` */ load(fontNames: string[]): Promise; /** * Gets all available fonts. * * @returns Promise that resolves to an array of available font information * * @example * ```typescript * const fonts = await fontLoader.getAvaiableFonts(); * console.log('Available fonts:', fonts); * ``` */ getAvaiableFonts(): Promise; } /** * Options for reading a drawing database. * * These options control how a drawing database is opened and processed. */ export interface AcDbOpenDatabaseOptions { /** * Opens the drawing database in read-only mode. * * When true, the database will be opened in read-only mode, preventing * any modifications to the database content. */ readOnly?: boolean; /** * Loader used to load fonts used in the drawing database. * * This loader will be used to load any fonts referenced by text entities * in the drawing database. */ fontLoader?: AcDbFontLoader; /** * The minimum number of items in one chunk. * * If this value is greater than the total number of entities in the * drawing database, the total number is used. This controls how the * database processing is broken into chunks for better performance. */ minimumChunkSize?: number; /** * Timeout for web worker parsing in milliseconds. * * This option is used only when the selected converter parses the drawing * file in a web worker. If omitted, the converter-level timeout is used. */ timeout?: number; /** * System variables to override in the database. * * This allows overriding system variable values when opening a database. * For example, to disable line weight display regardless of the database's * stored value, set { 'lwdisplay': false }. * * The keys are system variable names (case-insensitive), and values can be * number, boolean, or string types. */ sysVars?: Record; } /** * Interface defining the tables available in a drawing database. * * This interface provides access to all the symbol tables in the database, * including block table, dimension style table, linetype table, text style table, * layer table, and viewport table. */ export interface AcDbTables { /** Registered application name table */ readonly appIdTable: AcDbRegAppTable; /** Block table containing block definitions */ readonly blockTable: AcDbBlockTable; /** Dimension style table containing dimension style definitions */ readonly dimStyleTable: AcDbDimStyleTable; /** Linetype table containing linetype definitions */ readonly linetypeTable: AcDbLinetypeTable; /** Text style table containing text style definitions */ readonly textStyleTable: AcDbTextStyleTable; /** View table containing named view definitions */ readonly viewTable: AcDbViewTable; /** Layer table containing layer definitions */ readonly layerTable: AcDbLayerTable; /** Viewport table containing viewport definitions */ readonly viewportTable: AcDbViewportTable; } /** * Options used to specify default data to create */ export interface AcDbCreateDefaultDataOptions { layer?: boolean; lineType?: boolean; textStyle?: boolean; dimStyle?: boolean; layout?: boolean; } /** * The AcDbDatabase class represents an AutoCAD drawing file. * * Each AcDbDatabase object contains the various header variables, symbol tables, * table records, entities, and objects that make up the drawing. The AcDbDatabase * class has member functions to allow access to all the symbol tables, to read * and write to DWG files, to get or set database defaults, to execute various * database-level operations, and to get or set all header variables. * * @example * ```typescript * const database = new AcDbDatabase(); * await database.read(dxfData, { readOnly: true }); * const entities = database.tables.blockTable.modelSpace.entities; * ``` */ export declare class AcDbDatabase extends AcDbObject { /** Version of the database */ private _version; /** Angle base for the database */ private _angbase; /** Angle direction for the database */ private _angdir; /** Angle units for the database */ private _aunits; /** Angular display precision (AUPREC), used with {@link AcDbDatabase.aunits | AUNITS}. */ private _auprec; /** Linear unit display format (LUNITS) for coordinates and distances. */ private _lunits; /** Linear display precision (LUPREC), used with {@link lunits}. */ private _luprec; /** Current entity color */ private _cecolor; /** Current entity linetype scale */ private _celtscale; /** Current entity linetype name */ private _celtype; /** Current entity line weight value */ private _celweight; /** Current entity transparency level */ private _cetransparency; /** Current layer for the database */ private _clayer; /** Current multiline style for newly created MLINE entities */ private _cmlstyle; /** Current multiline scale for newly created MLINE entities */ private _cmlscale; /** Current multileader style for newly created MLEADER entities */ private _cmleaderstyle; /** Default background color for newly created hatch patterns */ private _hpbackgroundcolor; /** Default color for newly created hatches */ private _hpcolor; /** Default layer for newly created hatches and fills */ private _hplayer; /** Default transparency for newly created hatches and fills */ private _hptransparency; /** Current text style name for the database */ private _textstyle; /** The extents of current Model Space */ private _extents; /** Insertion units for the database */ private _insunits; /** Feet-inch / fractional delimiter style (UNITMODE) */ private _unitmode; /** Legacy metric vs imperial flag (MEASUREMENT) */ private _measurement; /** Global linetype scale */ private _ltscale; /** The flag whether to display line weight */ private _lwdisplay; /** Point display mode */ private _pdmode; /** Point display size */ private _pdsize; /** Running object snap mode bitmask */ private _osmode; /** Tables in the database */ private _tables; /** Nongraphical objects in the database */ private _objects; /** Current space (model space or paper space) */ private _currentSpace?; /** The maximum handle value in the database, used for generating unique object IDs */ private _maxHandle; /** Lazily created formatter for lengths, angles, and coordinates */ private _formatter?; /** * Events that can be triggered by the database. * * These events allow applications to respond to various database operations * such as entity modifications, layer changes, and progress updates. */ readonly events: { /** Fired when an object is set to the dictionary */ dictObjetSet: AcCmEventManager; /** Fired when an object in the dictionary is removed */ dictObjectErased: AcCmEventManager; /** Fired when an entity is appended to the database */ entityAppended: AcCmEventManager; /** Fired when an entity is modified in the database */ entityModified: AcCmEventManager; /** Fired when an entity is erased from the database */ entityErased: AcCmEventManager; /** Fired when a layer is appended to the database */ layerAppended: AcCmEventManager; /** Fired when a layer is modified in the database */ layerModified: AcCmEventManager; /** Fired when a layer is erased from the database */ layerErased: AcCmEventManager; /** Fired during database opening operations to report progress */ openProgress: AcCmEventManager; }; /** * Creates a new AcDbDatabase instance. */ constructor(); /** * Gets all tables in this drawing database. * * @returns Object containing all the symbol tables in the database * * @example * ```typescript * const tables = database.tables; * const layers = tables.layerTable; * const blocks = tables.blockTable; * ``` */ get tables(): AcDbTables; /** * Gets all nongraphical objects in this drawing database. * * @returns Object containing all nongraphical objects in the database * * @example * ```typescript * const objects = database.objects; * const layout = objects.layout; * ``` */ get objects(): { readonly dictionary: AcDbDictionary; readonly imageDefinition: AcDbDictionary; readonly layout: AcDbLayoutDictionary; readonly mleaderStyle: AcDbDictionary; readonly mlineStyle: AcDbDictionary; readonly xrecord: AcDbDictionary; }; /** * Formatter for linear distances, point coordinates, and angles using this database's * **LUNITS**, **AUNITS**, and related system variables. * * @example * ```typescript * database.formatter.formatLength(12.3456); * database.formatter.formatPoint3d(point); * database.formatter.formatAngle(angleRadians, { showUnits: true }); * ``` */ get formatter(): AcDbFormatter; /** * Generates a new unique object ID (handle) for the database. * The handle is a hexadecimal string that increments from the current max handle. * * @returns A new unique object ID as a hexadecimal string * * @example * ```typescript * const newHandle = database.generateHandle(); * console.log(`New handle: ${newHandle}`); * ``` */ generateHandle(): AcDbObjectId; /** * Updates the maximum handle value if the provided handle is greater. * This is called when setting an object's objectId from external sources (e.g., reading DXF/DWG). * * @param handle - The handle to check and potentially update maxHandle with * * @example * ```typescript * database.updateMaxHandle('1A2B'); * ``` */ updateMaxHandle(handle: string): void; /** * Commits an object's handle into the database. * * Generates a new handle when the object doesn't have one, when it is temporary, * or when a duplicate id exists in the target collection. * * @internal */ commitObjectHandle(object: AcDbObject, hasId?: (id: AcDbObjectId) => boolean): void; /** * Gets the object ID of the AcDbBlockTableRecord of the current space. * * The current space can be either model space or paper space. * * @returns The object ID of the current space * * @example * ```typescript * const currentSpaceId = database.currentSpaceId; * ``` */ get currentSpaceId(): AcDbObjectId; /** * Sets the current space by object ID. * * @param value - The object ID of the block table record to set as current space * @throws {Error} When the specified block table record ID doesn't exist * * @example * ```typescript * database.currentSpaceId = 'some-block-record-id'; * ``` */ set currentSpaceId(value: AcDbObjectId); /** * Angular unit **display and entry** format for the drawing (AutoCAD system variable **AUNITS**). * * This does not change how angles are stored internally (radians in geometry); it controls how * angles are formatted in the UI and how numeric angle input is interpreted, together with * {@link angbase} (**ANGBASE**) and {@link angdir} (**ANGDIR**). * * @returns Integer code matching {@link AcDbAngleUnits}: * * | Value | Meaning | * |------:|---------| * | `0` | **Decimal degrees** — e.g. `45.5` | * | `1` | **Degrees/minutes/seconds** — e.g. `45d30'15"` | * | `2` | **Gradians** — e.g. `50g` (400 grads = full circle) | * | `3` | **Radians** — e.g. `0.785398...` | * | `4` | **Surveyor's units** — quadrant bearing notation (e.g. `N 45d30'15" E`) | * * @remarks * Prefer assigning {@link AcDbAngleUnits} enum members for readability instead of raw integers. * * @see {@link AcDbAngleUnits} for the canonical enum used by this codebase. * @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?caas=caas/documentation/ACD/2014/ENU/files/GUID-C7C0F6A5-7982-43DB-97F9-5B9B0044E9FA-htm.html | AutoCAD Help: AUNITS} * * @example * ```typescript * const angleUnits = database.aunits; * ``` */ get aunits(): number; /** * Sets **AUNITS** — the angular unit display format (see {@link aunits} getter for value meanings). * * @param value - Integer `0`–`4` per {@link AcDbAngleUnits}, or `undefined`/`null` coerced to `0` by the setter chain. * * @example * ```typescript * database.aunits = AcDbAngleUnits.DecimalDegrees; * ``` */ set aunits(value: number); /** * Angular display precision for the drawing (**AUPREC**): how many decimal places (or equivalent) * are used when showing angles, in conjunction with {@link aunits}. * * AutoCAD typically uses integers in the range **0–8**; behavior for other values is * implementation-defined in this library (stored as-is). * * @see {@link https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-EE1ED20C-1096-4299-820F-83F1BC9B96F3 | AutoCAD Help: AUPREC} */ get auprec(): number; /** * Sets **AUPREC** — angular display precision (see {@link auprec} getter). */ set auprec(value: number); /** * Linear unit **display and entry** format for coordinates and lengths (**LUNITS**). * * This does not set real-world drawing units for inserts (see {@link insunits}); it controls how * linear distances are shown and parsed (scientific, decimal, engineering, and so on). * * @returns Integer code matching {@link AcDbLinearUnits}: * * | Value | Meaning | * |------:|---------| * | `1` | **Scientific** | * | `2` | **Decimal** | * | `3` | **Engineering** (feet + decimal inches) | * | `4` | **Architectural** (feet + fractional inches) | * | `5` | **Fractional** | * | `6` | **Windows desktop** (processing / computational format) | * * @remarks * Prefer assigning {@link AcDbLinearUnits} enum members instead of raw integers. * * @see {@link AcDbLinearUnits} * @see {@link https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-D7C80D1F-B1C0-44A9-898E-B3100FF391CB | AutoCAD Help: LUNITS} */ get lunits(): number; /** * Sets **LUNITS** — linear display format (see {@link lunits} getter). * * @param value - Integer per {@link AcDbLinearUnits}, or coerced default {@link AcDbLinearUnits.Decimal} when `undefined`/`null`. */ set lunits(value: number); /** * Linear display precision for the drawing (**LUPREC**): number of decimal places (or equivalent) * used when showing linear distances, together with {@link lunits}. * * AutoCAD typically uses integers in the range **0–8**; initial value is commonly **4**. * Values outside that range are stored as-is by this library. * * @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?guid=GUID-5FFF39D6-EFC7-49F5-B56A-6023EB5C0DE7 | AutoCAD Help: LUPREC} */ get luprec(): number; /** * Sets **LUPREC** — linear display precision (see {@link luprec} getter). */ set luprec(value: number); /** * Gets the version of the database. * * @returns The version of the database * */ get version(): AcDbDwgVersion; /** * Sets the version of the database. * * @param value - The version value of the database */ set version(value: string | number); /** * Gets the drawing-units value for automatic scaling of blocks, images, or xrefs. * * This is the current INSUNITS value for the database. * * @returns The insertion units value * * @example * ```typescript * const insertionUnits = database.insunits; * ``` */ get insunits(): number; /** * Sets the drawing-units value for automatic scaling. * * @param value - The new insertion units value * * @example * ```typescript * database.insunits = AcDbUnitsValue.Millimeters; * ``` */ set insunits(value: number); /** * Controls how feet-inch and fractional linear values are delimited (**UNITMODE**). * * - `0`: Report format (for example `1'-3 1/2"`) * - `1`: Input format (for example `1'-3-1/2"`, fewer spaces) * * @see {@link https://help.autodesk.com/view/ACD/2027/ENU/?guid=GUID-C52134E8-10EB-4AE7-A0C0-8F798C68F823 | AutoCAD Help: UNITMODE} */ get unitmode(): number; set unitmode(value: number); /** * Legacy drawing measurement system (**MEASUREMENT**): `0` = English, `1` = metric. * * When **INSUNITS** is unitless, this selects the default real-world unit family for labels. */ get measurement(): number; set measurement(value: number); /** * Gets the line type scale factor. * * @returns The line type scale factor * * @example * ```typescript * const lineTypeScale = database.ltscale; * ``` */ get ltscale(): number; /** * Sets the line type scale factor. * * @param value - The new line type scale factor * * @example * ```typescript * database.ltscale = 2.0; * ``` */ set ltscale(value: number); /** * Gets the flag whether to display line weight. * * @returns The flag whether to display line weight. * * @example * ```typescript * const lineTypeScale = database.ltscale; * ``` */ get lwdisplay(): boolean; /** * Sets the flag whether to display line weight. * * @param value - The flag whether to display line weight. * * @example * ```typescript * database.lwdisplay = true; * ``` */ set lwdisplay(value: boolean); /** * Gets the color of new objects as they are created. * * @returns The current entity color * * @example * ```typescript * const currentColor = database.cecolor; * ``` */ get cecolor(): AcCmColor; /** * Sets the color of new objects as they are created. * * @param value - The new current entity color * * @example * ```typescript * database.cecolor = new AcCmColor(0xFF0000); * ``` */ set cecolor(value: AcCmColor); /** * The line type scaling for new objects relative to the ltscale setting. A line created with * celtscale = 2 in a drawing with ltscale set to 0.5 would appear the same as a line created * with celtscale = 1 in a drawing with ltscale = 1. */ get celtscale(): number; set celtscale(value: number); /** * The linetype of new objects as they are created. */ get celtype(): string; set celtype(value: string); /** * The layer of new objects as they are created. */ get celweight(): AcGiLineWeight; set celweight(value: AcGiLineWeight); /** * The transparency level of new objects as they are created. * * Can be ByLayer, ByBlock, or a value from 0 to 90 (percentage). */ get cetransparency(): AcCmTransparency; set cetransparency(value: AcCmTransparency); /** * The layer of new objects as they are created. */ get clayer(): string; set clayer(value: string); /** * The multiline style name used for newly created MLINE entities. */ get cmlstyle(): string; set cmlstyle(value: string); /** * The multiline scale used for newly created MLINE entities. */ get cmlscale(): number; set cmlscale(value: number); /** * The multileader style name used for newly created MLEADER entities. */ get cmleaderstyle(): string; set cmleaderstyle(value: string); /** * The default hatch background color string. */ get hpbackgroundcolor(): AcCmColor; set hpbackgroundcolor(value: AcCmColor); /** * The default color string used for newly created hatches. */ get hpcolor(): AcCmColor; set hpcolor(value: AcCmColor); /** * The default layer used for newly created hatches and fills. */ get hplayer(): string; set hplayer(value: string); /** * The default transparency string used for newly created hatches and fills. */ get hptransparency(): AcCmTransparency; set hptransparency(value: AcCmTransparency); /** * The text style name for new text objects. */ get textstyle(): string; set textstyle(value: string); /** * The zero (0) base angle with respect to the current UCS in radians. */ get angbase(): number; set angbase(value: number); /** * The direction of positive angles. * - 0: Counterclockwise * - 1: Clockwise */ get angdir(): number; set angdir(value: number); /** * The current Model Space EXTMAX value */ get extmax(): AcGePoint3d; set extmax(value: AcGePoint3dLike); /** * The current Model Space EXTMIN value */ get extmin(): AcGePoint3d; set extmin(value: AcGePoint3dLike); /** * The extents of current Model Space */ get extents(): AcGeBox3d; /** * Point display mode. Please get more details on value of this property from [this page](https://help.autodesk.com/view/ACDLT/2022/ENU/?guid=GUID-82F9BB52-D026-4D6A-ABA6-BF29641F459B). */ get pdmode(): number; set pdmode(value: number); /** * Point display size. * - 0: Creates a point at 5 percent of the drawing area height * - > 0: Specifies an absolute size * - < 0: Specifies a percentage of the viewport size */ get pdsize(): number; set pdsize(value: number); /** * Running Object Snap (OSNAP) mode bitmask. */ get osmode(): number; set osmode(value: number); /** * Reads drawing data from a string or ArrayBuffer. * * This method parses the provided data and populates the database with * the resulting entities, tables, and objects. The method supports * both DXF and DWG file formats. * * @param data - The drawing data as a string or ArrayBuffer * - For DXF files: Pass a string containing the DXF content * - For DWG files: Pass an ArrayBuffer instance containing the binary DWG data * @param options - Options for reading the database * @param fileType - The type of file being read (defaults to DXF) * * @example * ```typescript * // Reading a DXF file (string) * const database = new AcDbDatabase(); * await database.read(dxfString, { readOnly: true }, AcDbFileType.DXF); * * // Reading a DWG file (ArrayBuffer) * const database = new AcDbDatabase(); * await database.read(dwgArrayBuffer, { readOnly: true }, AcDbFileType.DWG); * ``` */ read(data: ArrayBuffer, options: AcDbOpenDatabaseOptions, fileType?: AcDbConverterType): Promise; /** * Read AutoCAD DXF or DWG drawing specified by the URL into the database object. * The method automatically detects the file type based on the URL extension: * - .dxf files are read as text using readAsText() * - .dwg files are read as binary data using readAsArrayBuffer() * @param url Input the URL linked to one AutoCAD DXF or DWG file * @param options Input options to read drawing data */ openUri(url: string, options: AcDbOpenDatabaseOptions): Promise; /** * Exports the current database into an ASCII DXF string. * * The `fileName` parameter is kept for ObjectARX API parity. In this web * implementation the method returns the DXF payload instead of writing the * filesystem directly. * * This is the top-level DXF export entry point. It emits the sectioned * structure in the canonical order: HEADER, TABLES, BLOCKS, ENTITIES, * OBJECTS, and EOF. * * @param _fileName - Kept for ObjectARX parity. Ignored in this implementation. * @param precision - Numeric precision used by the DXF filer. * @param version - Target DXF/DWG version name or value. * @param _saveThumbnailImage - Kept for ObjectARX parity. Ignored here. * @returns The serialized DXF contents. */ dxfOut(_fileName?: string, precision?: number, version?: AcDbDwgVersion | string | number, _saveThumbnailImage?: boolean): string; /** * Triggers xxxAppended events with data in the database to redraw the associated viewer. */ regen(): Promise; /** * Create default layer, line type, dimension type, text style and layout. * @param - Options to specify data to create */ createDefaultData(options?: AcDbCreateDefaultDataOptions): void; /** * Ensures style dictionaries contain defaults required by one entity type. * * This is primarily used during entity append so newly created entities can * immediately resolve their style references. * * @internal */ ensureEntityStyleDefaults(entity: AcDbEntity): void; /** * Ensures the default text style exists in the text style table. * * This is invoked while converting STYLE records and again after a drawing * is fully opened so TEXT/MTEXT entities can resolve a style during * progressive rendering. */ ensureTextStyleDefaults(): void; private hasDefaultTextStyle; /** * Ensures required default database data exists. * * This is used after opening a file (or before exporting) to fill in any * missing defaults such as layers, linetypes, text styles, dim styles, * viewports, layouts, and registered application IDs. */ private ensureDatabaseDefaults; /** * Ensures one MLINE style exists for the provided style name. */ private ensureMLineStyle; /** * Ensures one MLEADER style exists for the provided style name. */ private ensureMLeaderStyle; /** * Writes the HEADER section for the DXF export. * * @param filer - DXF output writer. */ private writeDxfHeaderSection; /** * Writes the TABLES section for the DXF export. * * @param filer - DXF output writer. * @param version - Target DXF/DWG version, used for conditional tables. */ private writeDxfTablesSection; /** * Writes the BLOCKS section for the DXF export. * * @param filer - DXF output writer. */ private writeDxfBlocksSection; /** * Writes the ENTITIES section for the DXF export. * * @param filer - DXF output writer. */ private writeDxfEntitiesSection; /** * Writes the OBJECTS section for the DXF export. * * @param filer - DXF output writer. */ private writeDxfObjectsSection; /** * Writes a single TABLE and its records into the TABLES section. * * @param filer - DXF output writer. * @param tableName - DXF table name (e.g. LAYER, LTYPE). * @param table - The symbol table instance. * @param records - Records to serialize. * @param recordType - DXF record type name for each table record. */ private writeDxfTable; /** * Writes a single entity record into the DXF stream. * * The entity is responsible for emitting any additional records (such as * VERTEX/SEQEND for polylines or ATTRIB/SEQEND for block references) inside * its own `dxfOut` override. * * @param filer - DXF output writer. * @param entity - Entity to serialize. */ private writeDxfEntity; /** * Clears all data from the database. * * This method removes all entities, tables, and objects from the database, * effectively resetting it to an empty state. * * @example * ```typescript * database.clear(); * ``` */ private clear; /** * Updates a sysvar value and dispatches the change event only when the value changed. */ private updateSysVar; /** * Determines whether two sysvar values are different. */ private hasSysVarValueChanged; /** * Normalizes special linetype aliases to the internal canonical names. */ private normalizeLinetypeName; /** * Triggers a system variable changed event with old/new values. */ private triggerSysVarChangedEvent; /** * Extracts the file name from a URI. * * @param uri - The URI to extract the file name from * @returns The extracted file name, or empty string if extraction fails * @private */ private getFileNameFromUri; } //# sourceMappingURL=AcDbDatabase.d.ts.map