dxf-json 0.4.0 → 0.5.0

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.
Files changed (64) hide show
  1. package/dist/bundle.cjs +2 -2
  2. package/dist/bundle.mjs +2 -2
  3. package/dist/index.d.ts +1 -1
  4. package/dist/parser/DxfArrayScanner.d.ts +8 -7
  5. package/dist/parser/ParseHelpers.d.ts +3 -8
  6. package/dist/parser/entities/arc/index.d.ts +1 -1
  7. package/dist/parser/entities/attdef/index.d.ts +1 -1
  8. package/dist/parser/entities/attribute/index.d.ts +1 -1
  9. package/dist/parser/entities/attribute/parser.d.ts +1 -1
  10. package/dist/parser/entities/circle/index.d.ts +1 -1
  11. package/dist/parser/entities/dimension/common.d.ts +2 -1
  12. package/dist/parser/entities/dimension/index.d.ts +2 -6
  13. package/dist/parser/entities/dimension/parser.d.ts +7 -0
  14. package/dist/parser/entities/dimension/types.d.ts +1 -1
  15. package/dist/parser/entities/ellipse/index.d.ts +1 -1
  16. package/dist/parser/entities/ellipse/parser.d.ts +3 -2
  17. package/dist/parser/entities/hatch/boundaryPathData/polyline.d.ts +1 -1
  18. package/dist/parser/entities/hatch/index.d.ts +1 -1
  19. package/dist/parser/entities/hatch/types/boundaryPath.d.ts +1 -1
  20. package/dist/parser/entities/hatch/types/definitionLine.d.ts +1 -1
  21. package/dist/parser/entities/image/index.d.ts +1 -1
  22. package/dist/parser/entities/insert/index.d.ts +1 -1
  23. package/dist/parser/entities/leader/index.d.ts +1 -1
  24. package/dist/parser/entities/line/index.d.ts +1 -1
  25. package/dist/parser/entities/lwpolyline/index.d.ts +1 -1
  26. package/dist/parser/entities/mtext/index.d.ts +1 -1
  27. package/dist/parser/entities/multileader/index.d.ts +2 -0
  28. package/dist/parser/entities/multileader/parser.d.ts +8 -0
  29. package/dist/parser/entities/multileader/types.d.ts +34 -0
  30. package/dist/parser/entities/point/index.d.ts +1 -1
  31. package/dist/parser/entities/point/parser.d.ts +2 -1
  32. package/dist/parser/entities/point/types.d.ts +1 -1
  33. package/dist/parser/entities/polyline/index.d.ts +1 -1
  34. package/dist/parser/entities/polyline/types.d.ts +2 -2
  35. package/dist/parser/entities/ray/index.d.ts +1 -1
  36. package/dist/parser/entities/section/index.d.ts +1 -1
  37. package/dist/parser/entities/shared.d.ts +8 -5
  38. package/dist/parser/entities/solid/index.d.ts +1 -1
  39. package/dist/parser/entities/solid/types.d.ts +1 -1
  40. package/dist/parser/entities/spline/index.d.ts +1 -1
  41. package/dist/parser/entities/text/index.d.ts +1 -1
  42. package/dist/parser/entities/text/parser.d.ts +1 -1
  43. package/dist/parser/entities/text/types.d.ts +1 -1
  44. package/dist/parser/entities/types.d.ts +19 -19
  45. package/dist/parser/entities/vertex/index.d.ts +1 -1
  46. package/dist/parser/entities/vertex/parser.d.ts +1 -1
  47. package/dist/parser/entities/vertex/types.d.ts +3 -3
  48. package/dist/parser/entities/viewport/index.d.ts +2 -5
  49. package/dist/parser/entities/viewport/parser.d.ts +5 -0
  50. package/dist/parser/getAcadColor.d.ts +7 -0
  51. package/dist/parser/index.d.ts +1 -0
  52. package/dist/parser/shared/extensions/parser.d.ts +3 -0
  53. package/dist/parser/shared/xdata/index.d.ts +1 -1
  54. package/dist/parser/tables/blockRecord/index.d.ts +1 -1
  55. package/dist/parser/tables/dimStyle/index.d.ts +1 -1
  56. package/dist/parser/tables/index.d.ts +1 -1
  57. package/dist/parser/tables/layer/index.d.ts +1 -1
  58. package/dist/parser/tables/ltype/index.d.ts +1 -1
  59. package/dist/parser/tables/parser.d.ts +2 -1
  60. package/dist/parser/tables/style/index.d.ts +1 -1
  61. package/dist/parser/tables/vport/index.d.ts +1 -1
  62. package/dist/parser/types.d.ts +7 -7
  63. package/dist/types/index.d.ts +2 -2
  64. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Point3D } from '../../../types';
1
+ import type { Point3D } from '../../../types';
2
2
  import type { CommonDxfEntity } from '../shared';
3
3
  export interface PointEntity extends CommonDxfEntity {
4
4
  type: 'POINT';
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './consts';
3
3
  export * from './parser';
@@ -1,6 +1,6 @@
1
1
  import type { Point3D } from '../../../types';
2
- import { CommonDxfEntity } from '../shared';
3
- import { VertexEntity } from '../vertex/types';
2
+ import type { CommonDxfEntity } from '../shared';
3
+ import type { VertexEntity } from '../vertex/types';
4
4
  import type { SmoothType } from './consts';
5
5
  export interface PolylineEntity extends CommonDxfEntity {
6
6
  type: 'POLYLINE';
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,5 +1,5 @@
1
- import type { ColorIndex, ColorInstance } from '../../types';
2
- import DxfArrayScanner, { ScannerGroup } from '../DxfArrayScanner';
1
+ import type { ScannerGroup } from '@src/parser/DxfArrayScanner';
2
+ import type { ColorIndex, ColorInstance } from '@src/types';
3
3
  import { DXFParserSnippet } from '../shared/parserGenerator';
4
4
  import { XData } from '../shared/xdata';
5
5
  export interface CommonDxfEntity {
@@ -22,8 +22,12 @@ export interface CommonDxfEntity {
22
22
  plotStyleHardId?: string;
23
23
  shadowMode?: ShadowMode;
24
24
  xdata?: XData;
25
- ownerdictionaryHardId?: string | number | boolean;
26
- ownerDictionarySoftId?: string | number | boolean;
25
+ /**
26
+ * Application specific extension by their application-name.
27
+ * As it differs by application, you have to parse by your own.
28
+ * Note that group codes 102 for brackets are not included in the array.
29
+ * */
30
+ extensions?: Record<string, ScannerGroup[]>;
27
31
  }
28
32
  export declare enum ShadowMode {
29
33
  CAST_AND_RECEIVE = 0,
@@ -32,4 +36,3 @@ export declare enum ShadowMode {
32
36
  IGNORE = 3
33
37
  }
34
38
  export declare const CommonEntitySnippets: DXFParserSnippet[];
35
- export declare function skipApplicationGroups(curr: ScannerGroup, scanner: DxfArrayScanner): void;
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,4 +1,4 @@
1
- import { Point3D } from '../../../types';
1
+ import type { Point3D } from '../../../types';
2
2
  import type { CommonDxfEntity } from '../shared';
3
3
  export interface SolidEntity extends CommonDxfEntity {
4
4
  type: 'SOLID';
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './consts';
3
3
  export * from './parser';
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './consts';
3
3
  export * from './parser';
@@ -2,7 +2,7 @@ import type DxfArrayScanner from '../../DxfArrayScanner';
2
2
  import type { ScannerGroup } from '../../DxfArrayScanner';
3
3
  import { DXFParserSnippet } from '../../shared/parserGenerator';
4
4
  import { TextHorizontalAlign, TextVerticalAlign } from './consts';
5
- import { TextEntity } from './types';
5
+ import type { TextEntity } from './types';
6
6
  export declare const DefaultTextEntity: {
7
7
  thickness: number;
8
8
  rotation: number;
@@ -1,6 +1,6 @@
1
1
  import type { Point3D } from '../../../types';
2
2
  import type { CommonDxfEntity } from '../shared';
3
- import { TextHorizontalAlign, TextVerticalAlign } from './consts';
3
+ import type { TextHorizontalAlign, TextVerticalAlign } from './consts';
4
4
  export interface TextEntity extends CommonDxfEntity {
5
5
  type: 'TEXT';
6
6
  subclassMarker: 'AcDbText';
@@ -1,21 +1,21 @@
1
- export * from "./arc";
2
- export * from "./attdef";
3
- export * from "./circle";
4
- export * from "./dimension";
5
- export * from "./ellipse";
6
- export * from "./hatch";
1
+ export type * from "./arc";
2
+ export type * from "./attdef";
3
+ export type * from "./circle";
4
+ export type * from "./dimension";
5
+ export type * from "./ellipse";
6
+ export type * from "./hatch";
7
7
  export type * from './image';
8
- export * from "./insert";
9
- export * from "./leader";
10
- export * from "./line";
11
- export * from "./lwpolyline";
12
- export * from "./mtext";
13
- export * from "./point";
14
- export * from "./polyline";
8
+ export type * from "./insert";
9
+ export type * from "./leader";
10
+ export type * from "./line";
11
+ export type * from "./lwpolyline";
12
+ export type * from "./mtext";
13
+ export type * from "./point";
14
+ export type * from "./polyline";
15
15
  export type * from "./ray";
16
- export * from "./section";
17
- export * from "./solid";
18
- export * from "./spline";
19
- export * from "./text";
20
- export * from "./vertex";
21
- export * from "./viewport";
16
+ export type * from "./section";
17
+ export type * from "./solid";
18
+ export type * from "./spline";
19
+ export type * from "./text";
20
+ export type * from "./vertex";
21
+ export type * from "./viewport";
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './consts';
3
3
  export * from './parser';
@@ -1,6 +1,6 @@
1
1
  import type DxfArrayScanner from '../../DxfArrayScanner';
2
2
  import type { ScannerGroup } from '../../DxfArrayScanner';
3
- import { VertexEntity } from './types';
3
+ import type { VertexEntity } from './types';
4
4
  export declare class VertexParser {
5
5
  static ForEntityName: string;
6
6
  private parser;
@@ -1,6 +1,6 @@
1
- import { Point3D } from '../../../types';
2
- import { CommonDxfEntity } from '../shared';
3
- import { VertexFlag } from './consts';
1
+ import type { Point3D } from '../../../types';
2
+ import type { CommonDxfEntity } from '../shared';
3
+ import type { VertexFlag } from './consts';
4
4
  export interface VertexEntity extends CommonDxfEntity, Point3D {
5
5
  subclassMarker: 'AcDb2dVertex' | 'AcDb3dPolylineVertex';
6
6
  startWidth: number;
@@ -1,5 +1,2 @@
1
- import type { ViewportEntity } from './types';
2
- export default class ViewportParser {
3
- static ForEntityName: string;
4
- parseEntity(scanner: any, curr: any): ViewportEntity;
5
- }
1
+ export type * from './types';
2
+ export * from './parser';
@@ -0,0 +1,5 @@
1
+ import type { ViewportEntity } from './types';
2
+ export declare class ViewportParser {
3
+ static ForEntityName: string;
4
+ parseEntity(scanner: any, curr: any): ViewportEntity;
5
+ }
@@ -0,0 +1,7 @@
1
+ import type { ColorIndex, ColorInstance } from "../types/color";
2
+ /**
3
+ * Returns the truecolor value of the given AutoCad color index value
4
+ * @param index
5
+ * @return truecolor value as a number
6
+ */
7
+ export declare function getAcadColor(index: ColorIndex): ColorInstance;
@@ -6,3 +6,4 @@ export * from "./header";
6
6
  export * from "./objects";
7
7
  export * from "./shared";
8
8
  export * from "./tables";
9
+ export * from './getAcadColor';
@@ -0,0 +1,3 @@
1
+ import DxfArrayScanner, { ScannerGroup } from "@src/parser/DxfArrayScanner";
2
+ /** @internal */
3
+ export declare function parseExtensions(curr: ScannerGroup, scanner: DxfArrayScanner, entity: any): void;
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
3
3
  export * from './interpreter';
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './consts';
3
3
  export * from './parser';
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,3 +1,3 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './consts';
3
3
  export * from './parser';
@@ -1,2 +1,3 @@
1
- import DxfArrayScanner, { ScannerGroup } from '../DxfArrayScanner';
1
+ import type DxfArrayScanner from '../DxfArrayScanner';
2
+ import type { ScannerGroup } from '../DxfArrayScanner';
2
3
  export declare function parseTables(curr: ScannerGroup, scanner: DxfArrayScanner): any;
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -1,2 +1,2 @@
1
- export * from './types';
1
+ export type * from './types';
2
2
  export * from './parser';
@@ -3,13 +3,13 @@ import type { DxfBlock } from './blocks/types';
3
3
  import type { CommonDxfEntity } from './entities/shared';
4
4
  import type { CommonDXFObject } from './objects/common';
5
5
  import type { DxfObject } from './objects/types';
6
- import { BlockRecordTableEntry } from './tables/blockRecord';
7
- import { DimStylesTableEntry } from './tables/dimStyle';
8
- import { LayerTableEntry } from './tables/layer';
9
- import { LTypeTableEntry } from './tables/ltype';
10
- import { StyleTableEntry } from './tables/style';
11
- import { DxfTable } from './tables/types';
12
- import { VPortTableEntry } from './tables/vport';
6
+ import type { BlockRecordTableEntry } from './tables/blockRecord';
7
+ import type { DimStylesTableEntry } from './tables/dimStyle';
8
+ import type { LayerTableEntry } from './tables/layer';
9
+ import type { LTypeTableEntry } from './tables/ltype';
10
+ import type { StyleTableEntry } from './tables/style';
11
+ import type { DxfTable } from './tables/types';
12
+ import type { VPortTableEntry } from './tables/vport';
13
13
  export interface ParsedDxf {
14
14
  header: DxfHeader;
15
15
  blocks: Record<string, DxfBlock>;
@@ -1,5 +1,5 @@
1
- export * from './color';
2
- export * from './dxfHeader';
1
+ export type * from './color';
2
+ export type * from './dxfHeader';
3
3
  export interface Point2D {
4
4
  x: number;
5
5
  y: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dxf-json",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "perfect dxf parser",
5
5
  "type": "module",
6
6
  "main": "./dist/bundle.cjs",