@mlightcad/libredwg-converter 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__vite-browser-external-l0sNRNKZ.js +1 -0
- package/dist/libredwg-converter.js +7099 -0
- package/dist/libredwg-converter.umd.cjs +39 -0
- package/dist/libredwg-parser-worker.js +15411 -0
- package/lib/AcDbEntitiyConverter.d.ts +37 -0
- package/lib/AcDbEntitiyConverter.d.ts.map +1 -0
- package/lib/AcDbEntitiyConverter.js +541 -0
- package/lib/AcDbEntitiyConverter.js.map +1 -0
- package/lib/AcDbLibreDwgConverter.d.ts +56 -0
- package/lib/AcDbLibreDwgConverter.d.ts.map +1 -0
- package/lib/AcDbLibreDwgConverter.js +653 -0
- package/lib/AcDbLibreDwgConverter.js.map +1 -0
- package/lib/AcDbLibreDwgConverterUtil.d.ts +7 -0
- package/lib/AcDbLibreDwgConverterUtil.d.ts.map +1 -0
- package/lib/AcDbLibreDwgConverterUtil.js +60 -0
- package/lib/AcDbLibreDwgConverterUtil.js.map +1 -0
- package/lib/AcDbLibreDwgParserWorker.d.ts +2 -0
- package/lib/AcDbLibreDwgParserWorker.d.ts.map +1 -0
- package/lib/AcDbLibreDwgParserWorker.js +83 -0
- package/lib/AcDbLibreDwgParserWorker.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AcDbConversionProgressCallback, AcDbDatabase, AcDbDatabaseConverter, AcDbDatabaseConverterConfig, AcDbParsingTaskResult } from '@mlightcad/data-model';
|
|
2
|
+
import { DwgDatabase } from '@mlightcad/libredwg-web';
|
|
3
|
+
/**
|
|
4
|
+
* Database converter for DWG files based on [libredwg-web](https://github.com/mlight-lee/libredwg-web).
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcDbLibreDwgConverter extends AcDbDatabaseConverter<DwgDatabase> {
|
|
7
|
+
constructor(config?: AcDbDatabaseConverterConfig);
|
|
8
|
+
protected parse(data: ArrayBuffer): Promise<AcDbParsingTaskResult<DwgDatabase>>;
|
|
9
|
+
/**
|
|
10
|
+
* Gets all of fonts used by entities in model space and paper space
|
|
11
|
+
* @param dwg dwg database model
|
|
12
|
+
* @returns Returns all of fonts used by entities in model space and paper space
|
|
13
|
+
*/
|
|
14
|
+
protected getFonts(dwg: DwgDatabase): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Iterate entities in model space to get fonts used by text, mtext and insert entities
|
|
17
|
+
*/
|
|
18
|
+
private getFontsInBlock;
|
|
19
|
+
protected processLineTypes(model: DwgDatabase, db: AcDbDatabase): void;
|
|
20
|
+
protected processTextStyles(model: DwgDatabase, db: AcDbDatabase): void;
|
|
21
|
+
protected processDimStyles(model: DwgDatabase, db: AcDbDatabase): void;
|
|
22
|
+
protected processLayers(model: DwgDatabase, db: AcDbDatabase): void;
|
|
23
|
+
protected processViewports(model: DwgDatabase, db: AcDbDatabase): void;
|
|
24
|
+
protected processBlockTables(model: DwgDatabase, db: AcDbDatabase): void;
|
|
25
|
+
protected processBlocks(_model: DwgDatabase, _db: AcDbDatabase): void;
|
|
26
|
+
private processEntitiesInBlock;
|
|
27
|
+
/**
|
|
28
|
+
* Breaks up the work into smaller chunks that are executed asynchronously. This is often referred to
|
|
29
|
+
* as "batch processing" or "cooperative multitasking," where the time-consuming task is broken into
|
|
30
|
+
* smaller pieces and executed in small intervals to allow the UI to remain responsive.
|
|
31
|
+
*/
|
|
32
|
+
protected processEntities(model: DwgDatabase, db: AcDbDatabase, minimumChunkSize: number, startPercentage: {
|
|
33
|
+
value: number;
|
|
34
|
+
}, progress?: AcDbConversionProgressCallback): Promise<void>;
|
|
35
|
+
protected processHeader(model: DwgDatabase, db: AcDbDatabase): void;
|
|
36
|
+
private processCommonTableEntryAttrs;
|
|
37
|
+
protected processObjects(model: DwgDatabase, db: AcDbDatabase): void;
|
|
38
|
+
private processLayouts;
|
|
39
|
+
private processImageDefs;
|
|
40
|
+
private processCommonObjectAttrs;
|
|
41
|
+
/**
|
|
42
|
+
* Groups entities by their `type` property and flattens the result into a single array.
|
|
43
|
+
*
|
|
44
|
+
* The order of `type` groups follows the order in which they first appear in the input array.
|
|
45
|
+
* Items within each group preserve their original order.
|
|
46
|
+
*
|
|
47
|
+
* This runs in O(n) time, which is generally faster than sorting when you
|
|
48
|
+
* don't care about alphabetical order of types.
|
|
49
|
+
*
|
|
50
|
+
* @param entities - The array of entities to group and flatten.
|
|
51
|
+
*
|
|
52
|
+
* @returns A new array of entities grouped by their `type` property.
|
|
53
|
+
*/
|
|
54
|
+
private groupAndFlattenByType;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=AcDbLibreDwgConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcDbLibreDwgConverter.d.ts","sourceRoot":"","sources":["../src/AcDbLibreDwgConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,2BAA2B,EAa3B,qBAAqB,EAUtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAIL,WAAW,EAKZ,MAAM,yBAAyB,CAAA;AAIhC;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,qBAAqB,CAAC,WAAW,CAAC;gBAC/D,MAAM,GAAE,2BAAgC;cAQpC,KAAK,CAAC,IAAI,EAAE,WAAW;IAmBvC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW;IAiCnC;;OAEG;IACH,OAAO,CAAC,eAAe;IA4BvB,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY;IAiB/D,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY;IAShE,SAAS,CAAC,gBAAgB,C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