Manager for registering and managing database converters by file type.

This class provides a centralized way to register database converters for different file types (DXF, DWG, etc.) and retrieve the appropriate converter for a given file type. It implements the singleton pattern and provides event notifications when converters are registered or unregistered.

const manager = AcDbDatabaseConverterManager.instance;
const converter = manager.get(AcDbFileType.DXF);
if (converter) {
await converter.read(dxfData, database, 100);
}

Properties

Events that can be triggered by the converter manager.

These events allow applications to respond to converter registration and unregistration.

Type declaration

Accessors

  • get fileTypes(): IterableIterator<string>
  • Gets all registered file types.

    Returns IterableIterator<string>

    An iterator of all registered file types

    const fileTypes = manager.fileTypes;
    for (const fileType of fileTypes) {
    console.log('Supported file type:', fileType);
    }

Methods

  • Gets the database converter associated with the specified file type.

    Parameters

    • fileType: string

      The file type to get the converter for

    Returns undefined | AcDbDatabaseConverter<unknown>

    The database converter associated with the specified file type, or undefined if not found

    const converter = manager.get(AcDbFileType.DXF);
    if (converter) {
    await converter.read(dxfData, database, 100);
    }
  • Unregisters the database converter for the specified file type.

    Parameters

    • fileType: string

      The file type to unregister the converter for

    Returns void

    manager.unregister(AcDbFileType.DWG);