@mlightcad/libredwg-web 0.7.6 → 0.7.8

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 (50) hide show
  1. package/dist/libredwg-web.js +217 -5
  2. package/dist/libredwg-web.umd.cjs +217 -5
  3. package/lib/converter/converter.d.ts +3 -0
  4. package/lib/converter/converter.js +76 -1
  5. package/lib/converter/entityConverter.d.ts +2 -0
  6. package/lib/converter/entityConverter.js +79 -5
  7. package/lib/converter/mleaderColorCodec.d.ts +9 -0
  8. package/lib/converter/mleaderColorCodec.js +52 -0
  9. package/lib/converter/stringConverter.d.ts +3 -0
  10. package/lib/converter/stringConverter.js +7 -0
  11. package/lib/converter/utils.d.ts +21 -0
  12. package/lib/converter/utils.js +27 -0
  13. package/lib/database/database.d.ts +4 -1
  14. package/lib/database/entities/dimension.d.ts +1 -1
  15. package/lib/database/entities/index.d.ts +1 -0
  16. package/lib/database/entities/index.js +1 -0
  17. package/lib/database/entities/solid3d.d.ts +32 -0
  18. package/lib/database/entities/solid3d.js +2 -0
  19. package/lib/database/entities/unknown.d.ts +7 -0
  20. package/lib/database/entities/unknown.js +2 -0
  21. package/lib/database/objects/index.d.ts +3 -0
  22. package/lib/database/objects/index.js +3 -0
  23. package/lib/database/objects/layerFilter.d.ts +12 -0
  24. package/lib/database/objects/layerFilter.js +2 -0
  25. package/lib/database/objects/layerIndex.d.ts +18 -0
  26. package/lib/database/objects/layerIndex.js +2 -0
  27. package/lib/database/objects/unknown.d.ts +7 -0
  28. package/lib/database/objects/unknown.js +2 -0
  29. package/lib/database/objects/xrecord.d.ts +30 -0
  30. package/lib/database/objects/xrecord.js +2 -0
  31. package/lib/debug.d.ts +13 -0
  32. package/lib/debug.js +48 -0
  33. package/lib/libredwg-core.d.ts +740 -0
  34. package/lib/libredwg-core.js +1121 -0
  35. package/lib/libredwg-web.d.ts +3 -0
  36. package/lib/libredwg-web.js +2318 -0
  37. package/lib/libredwg.d.ts +30 -1
  38. package/lib/libredwg.js +44 -0
  39. package/lib/memory64/index.d.ts +4 -0
  40. package/lib/memory64/index.js +4 -0
  41. package/lib/memory64/libredwg.d.ts +13 -0
  42. package/lib/memory64/libredwg.js +23 -0
  43. package/lib/types/common.d.ts +2 -0
  44. package/lib/utils/common.d.ts +4 -0
  45. package/lib/utils/common.js +12 -0
  46. package/lib/utils/index.d.ts +2 -0
  47. package/lib/utils/index.js +2 -0
  48. package/package.json +2 -2
  49. package/wasm/libredwg-web.d.ts +548 -544
  50. package/wasm/libredwg-web.wasm +0 -0
@@ -0,0 +1,740 @@
1
+ import { DwgCodePage, DwgDatabase, DwgGradientColor, DwgPoint2D, DwgPoint3D, DwgPoint4D, DwgVersion, DwgXData } from './database';
2
+ import { Dwg_Array_Ptr, Dwg_Class, Dwg_Color, Dwg_Data_Ptr, Dwg_Entity_BLOCK, Dwg_Entity_IMAGE_Ptr, Dwg_Entity_LWPOLYLINE_Ptr, Dwg_Entity_MTEXT_Ptr, Dwg_Entity_POLYLINE_2D_Ptr, Dwg_Entity_POLYLINE_3D_Ptr, Dwg_Entity_PROXY_ENTITY_Ptr, Dwg_Entity_TEXT_Ptr, Dwg_Entity_VERTEX_2D, Dwg_Entity_VERTEX_3D, Dwg_Field_Value, Dwg_Handle, Dwg_HATCH_DefLine, Dwg_HATCH_Path, Dwg_LTYPE_Dash, Dwg_MLINE_Vertex, Dwg_Object_BLOCK_HEADER_Ptr, Dwg_Object_BLOCK_Ptr, Dwg_Object_DIMSTYLE_Ptr, Dwg_Object_Entity_Ptr, Dwg_Object_Entity_TIO_Ptr, Dwg_Object_Generic_Ptr, Dwg_Object_IMAGEDEF_Ptr, Dwg_Object_LAYER_Ptr, Dwg_Object_LTYPE_Ptr, Dwg_Object_Object_Ptr, Dwg_Object_Object_TIO_Ptr, Dwg_Object_Ptr, Dwg_Object_Ref, Dwg_Object_Ref_Ptr, Dwg_Object_STYLE_Ptr, Dwg_Object_Type, Dwg_Object_VERTEX_2D_Ptr, Dwg_Object_VERTEX_3D_Ptr, Dwg_Object_VPORT_Ptr, Dwg_TABLE_Cell } from './types';
3
+ export declare enum DwgThumbnailImageType {
4
+ BMP = 2,
5
+ WMF = 3,
6
+ PNG = 6
7
+ }
8
+ export interface DwgThumbnail {
9
+ data: Uint8Array;
10
+ type: DwgThumbnailImageType;
11
+ }
12
+ /** Loose typing for internal use (converter); accepts wasm32 and wasm64 pointers. */
13
+ export type LibreDwgWasm = LibreDwgCore & {
14
+ [key: string]: any;
15
+ };
16
+ export declare class LibreDwgCore {
17
+ protected wasmInstance: any;
18
+ private decoder?;
19
+ protected constructor(wasmInstance: any);
20
+ dwg_read_data(fileContent: string | ArrayBuffer, fileType: number): import("./types").WasmPtr | undefined;
21
+ /**
22
+ * Converts DWG file content to DXF file content.
23
+ * @param fileContent DWG file content.
24
+ * @returns Returns DXF file content if conversion succeeds. Otherwise returns null.
25
+ */
26
+ dwg_write_dxf(fileContent: string | ArrayBuffer): Uint8Array | null;
27
+ /**
28
+ * Gets the version of the dwg.
29
+ * @param data Pointer to Dwg_Data instance.
30
+ * @returns Return the version of the dwg
31
+ */
32
+ dwg_get_version_type(data: Dwg_Data_Ptr): DwgVersion;
33
+ /**
34
+ * Gets code page of the dwg.
35
+ * @param data Pointer to Dwg_Data instance.
36
+ * @returns Return code page of the dwg
37
+ */
38
+ dwg_get_codepage(data: Dwg_Data_Ptr): DwgCodePage;
39
+ /**
40
+ * Extracts thumbnail image from dwg.
41
+ * @param data Pointer to Dwg_Data instance.
42
+ * @returns Return thumbnail image data
43
+ */
44
+ dwg_bmp(data: Dwg_Data_Ptr): DwgThumbnail | null;
45
+ /**
46
+ * Returns the number of classes in dwg file.
47
+ * @param data Pointer to Dwg_Data instance.
48
+ * @returns Returns the number of classes in dwg file.
49
+ */
50
+ dwg_get_num_classes(data: Dwg_Data_Ptr): number;
51
+ /**
52
+ * Returns the nth class in dwg file.
53
+ * @param data Pointer to Dwg_Data instance.
54
+ * @param index Index of the class
55
+ * @returns Returns the nth class in dwg file.
56
+ */
57
+ dwg_get_class(data: Dwg_Data_Ptr, index: number): Dwg_Class;
58
+ /**
59
+ * Converts Dwg_Data instance to DwgDatabase instance. DwgDatabase instance doesn't depend on
60
+ * Dwg_Data instance any more after conversion. So you can call function dwg_free to free memory
61
+ * occupied by Dwg_Data.
62
+ * @param data Pointer to Dwg_Data instance.
63
+ * @returns Returns the converted DwgDatabase.
64
+ */
65
+ convert(data: Dwg_Data_Ptr): DwgDatabase;
66
+ /**
67
+ * Converts Dwg_Data instance to DwgDatabase instance and returns conversion statistics.
68
+ * DwgDatabase instance doesn't depend on Dwg_Data instance any more after conversion.
69
+ * So you can call function dwg_free to free memory occupied by Dwg_Data.
70
+ * @param data Pointer to Dwg_Data instance.
71
+ * @returns Returns the converted DwgDatabase and conversion statistics.
72
+ */
73
+ convertEx(data: Dwg_Data_Ptr): {
74
+ database: DwgDatabase;
75
+ stats: {
76
+ unknownEntityCount: number;
77
+ };
78
+ };
79
+ /**
80
+ * Converts DwgDatabase instance to svg string.
81
+ * @param data DwgDatabase instance.
82
+ * @returns Returns the converted svg string.
83
+ */
84
+ dwg_to_svg(data: DwgDatabase): string;
85
+ /**
86
+ * Frees the whole DWG. all tables, sections, objects, ...
87
+ * @param data Pointer to Dwg_Data instance.
88
+ */
89
+ dwg_free(data: Dwg_Data_Ptr): void;
90
+ /**
91
+ * Frees the object (all three structs and its fields)
92
+ * @group Dwg_Object Methods
93
+ * @param ptr Pointer to one Dwg_Object instance.
94
+ */
95
+ dwg_free_object(obj_ptr: Dwg_Object_Ptr): void;
96
+ /**
97
+ * Gets an object by its handle.
98
+ * @group Handle Conversion Methods
99
+ * @param data Pointer to Dwg_Data instance.
100
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
101
+ * @returns Returns the object whose handle is equal to the given handle.
102
+ */
103
+ dwg_ref_object(data: Dwg_Data_Ptr, ref_ptr: Dwg_Object_Ref_Ptr): Dwg_Object_Ptr;
104
+ /**
105
+ * Gets an object by its handle without warning message.
106
+ * @group Handle Conversion Methods
107
+ * @param data Pointer to Dwg_Data instance.
108
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
109
+ * @returns Returns the object whose handle is equal to the given handle.
110
+ */
111
+ dwg_ref_object_silent(data: Dwg_Data_Ptr, ref_ptr: Dwg_Object_Ref_Ptr): Dwg_Object_Ptr;
112
+ /**
113
+ * Gets an object given its handle and relative base object.
114
+ * @group Handle Conversion Methods
115
+ * @param data Pointer to Dwg_Data instance.
116
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
117
+ * @param obj_ptr Pointer to the relative base object (Dwg_Object instance).
118
+ * @returns Returns the object given its handle and relative base object.
119
+ */
120
+ dwg_ref_object_relative(data: Dwg_Data_Ptr, ref_ptr: Dwg_Object_Ref_Ptr, obj_ptr: Dwg_Object_Ptr): Dwg_Object_Ptr;
121
+ /**
122
+ * Resolves handle absref value to Dwg_Object instance.
123
+ * @group Handle Conversion Methods
124
+ * @param data Pointer to Dwg_Data instance.
125
+ * @param absref Handle absref value.
126
+ * @returns Returns the object with the given handle absref value.
127
+ */
128
+ dwg_resolve_handle(data: Dwg_Data_Ptr, absref: bigint): Dwg_Object_Ptr;
129
+ /**
130
+ * Resolves handle absref value to Dwg_Object instance without warning message.
131
+ * @group Handle Conversion Methods
132
+ * @param data Pointer to Dwg_Data instance.
133
+ * @param absref Handle absref value.
134
+ * @returns Returns the object with the given handle absref value.
135
+ */
136
+ dwg_resolve_handle_silent(data: Dwg_Data_Ptr, absref: bigint): Dwg_Object_Ptr;
137
+ /**
138
+ * Sets ref->absolute_ref from the specified obj for a subsequent dwg_resolve_handle
139
+ * @group Handle Conversion Methods
140
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
141
+ * @param obj_ptr Pointer to Dwg_Object instance.
142
+ * @returns Returns 1 if set absref value correctly. Otherwise, return 0.
143
+ */
144
+ dwg_resolve_handleref(ref_ptr: Dwg_Object_Ref_Ptr, obj_ptr: Dwg_Object_Ptr): number;
145
+ /**
146
+ * Returns object (such as line type, layer name, dimension style, and etc.) name by its handle.
147
+ * @group Handle Conversion Methods
148
+ * @param ref_ptr Pointer to Dwg_Object_Ref instance.
149
+ * @returns Returns object name by its handle.
150
+ */
151
+ dwg_ref_get_object_name(ref_ptr: Dwg_Object_Ref_Ptr): string;
152
+ /**
153
+ * Converts Dwg_Object_Object instance to Dwg_Object instance.
154
+ * @group Object Conversion Methods
155
+ * @param obj_ptr Pointer to Dwg_Object_Object instance.
156
+ * @returns Returns one pointer to Dwg_Object instance.
157
+ */
158
+ dwg_obj_obj_to_object(obj_obj_ptr: Dwg_Object_Object_Ptr): Dwg_Object_Ptr;
159
+ /**
160
+ * Converts Dwg_Object_* instance to Dwg_Object instance.
161
+ * @group Object Conversion Methods
162
+ * @param obj_generic_ptr Pointer to Dwg_Object_* instance.
163
+ * @returns Returns one pointer to Dwg_Object instance.
164
+ */
165
+ dwg_obj_generic_to_object(obj_generic_ptr: Dwg_Object_Generic_Ptr): Dwg_Object_Ptr;
166
+ /**
167
+ * Converts Dwg_Object instance to Dwg_Object_Object instance.
168
+ * @group Object Conversion Methods
169
+ * @param obj_ptr Pointer to Dwg_Object instance.
170
+ * @returns Returns one pointer to Dwg_Object_Object instance.
171
+ */
172
+ dwg_object_to_object(obj_ptr: Dwg_Object_Ptr): Dwg_Object_Object_Ptr;
173
+ /**
174
+ * Gets Dwg_Object_* instance (such as Dwg_Entity_LAYER, Dwg_Entity_STYLE, and etc.)
175
+ * from Dwg_Object instance.
176
+ * @group Object Conversion Methods
177
+ * @param obj_ptr Pointer to Dwg_Object instance.
178
+ * @returns Returns one pointer to Dwg_Object_Object_TIO_Ptr instance.
179
+ */
180
+ dwg_object_to_object_tio(obj_ptr: Dwg_Object_Ptr): Dwg_Object_Object_TIO_Ptr;
181
+ /**
182
+ * Converts Dwg_Object instance to Dwg_Object_Entity instance.
183
+ * @group Object Conversion Methods
184
+ * @param obj_ptr Pointer to Dwg_Object instance.
185
+ * @returns Returns one pointer to Dwg_Object_Entity instance.
186
+ */
187
+ dwg_object_to_entity(obj_ptr: Dwg_Object_Ptr): Dwg_Object_Entity_Ptr;
188
+ /**
189
+ * Gets Dwg_Entity_* instance (such as Dwg_Entity_LINE, Dwg_Entity_SPLINE, and etc.)
190
+ * from Dwg_Object instance.
191
+ * @group Object Conversion Methods
192
+ * @param obj_ptr Pointer to Dwg_Object instance.
193
+ * @returns Returns one pointer to Dwg_Object_Object_TIO_Ptr instance.
194
+ */
195
+ dwg_object_to_entity_tio(obj_ptr: Dwg_Object_Ptr): Dwg_Object_Object_TIO_Ptr;
196
+ /**
197
+ * Returns all of entities in the model space. Each item in returned array
198
+ * is one Dwg_Object pointer (Dwg_Object*).
199
+ * @group GetAll Methods
200
+ * @param data Pointer to Dwg_Data instance.
201
+ * @returns Returns all of entities in the model space.
202
+ */
203
+ dwg_getall_entities_in_model_space(data: Dwg_Data_Ptr): any[];
204
+ /**
205
+ * Returns all of objects in Dwg_Data instance with the specified type.
206
+ * @group GetAll Methods
207
+ * @param data Pointer to Dwg_Data instance.
208
+ * @param type Object type.
209
+ * @returns Returns all of objects with the specified type.
210
+ */
211
+ dwg_getall_object_by_type(data: Dwg_Data_Ptr, type: Dwg_Object_Type): Dwg_Object_Object_TIO_Ptr[];
212
+ /**
213
+ * Returns all of objects in Dwg_Data instance with the specified type.
214
+ * @group GetAll Methods
215
+ * @param data Pointer to Dwg_Data instance.
216
+ * @param type Object type.
217
+ * @returns Returns all of objects with the specified type.
218
+ */
219
+ dwg_getall_entity_by_type(data: Dwg_Data_Ptr, type: Dwg_Object_Type): Dwg_Object_Entity_TIO_Ptr[];
220
+ /**
221
+ * Returns all of layer objects in Dwg_Data instance.
222
+ * @group GetAll Methods
223
+ * @param data Pointer to Dwg_Data instance.
224
+ * @returns Returns all of layer objects in Dwg_Data instance.
225
+ */
226
+ dwg_getall_LAYER(data: Dwg_Data_Ptr): Dwg_Object_LAYER_Ptr[];
227
+ /**
228
+ * Returns all of line type objects in Dwg_Data instance.
229
+ * @group GetAll Methods
230
+ * @param data Pointer to Dwg_Data instance.
231
+ * @returns Returns all of line type objects in Dwg_Data instance.
232
+ */
233
+ dwg_getall_LTYPE(data: Dwg_Data_Ptr): Dwg_Object_LTYPE_Ptr[];
234
+ /**
235
+ * Returns all of text style objects in Dwg_Data instance.
236
+ * @group GetAll Methods
237
+ * @param data Pointer to Dwg_Data instance.
238
+ * @returns Returns all of text style objects in Dwg_Data instance.
239
+ */
240
+ dwg_getall_STYLE(data: Dwg_Data_Ptr): Dwg_Object_STYLE_Ptr[];
241
+ /**
242
+ * Returns all of dimension style objects in Dwg_Data instance.
243
+ * @group GetAll Methods
244
+ * @param data Pointer to Dwg_Data instance.
245
+ * @returns Returns all of dimension style objects in Dwg_Data instance.
246
+ */
247
+ dwg_getall_DIMSTYLE(data: Dwg_Data_Ptr): Dwg_Object_DIMSTYLE_Ptr[];
248
+ /**
249
+ * Returns all of viewport objects in Dwg_Data instance.
250
+ * @group GetAll Methods
251
+ * @param data Pointer to Dwg_Data instance.
252
+ * @returns Returns all of viewport objects in Dwg_Data instance.
253
+ */
254
+ dwg_getall_VPORT(data: Dwg_Data_Ptr): Dwg_Object_VPORT_Ptr[];
255
+ /**
256
+ * Returns all of layout objects in Dwg_Data instance.
257
+ * @group GetAll Methods
258
+ * @param data Pointer to Dwg_Data instance.
259
+ * @returns Returns all of layout objects in Dwg_Data instance.
260
+ */
261
+ dwg_getall_LAYOUT(data: Dwg_Data_Ptr): Dwg_Object_Ptr[];
262
+ /**
263
+ * Returns all of block objects in Dwg_Data instance.
264
+ * @group GetAll Methods
265
+ * @param data Pointer to Dwg_Data instance.
266
+ * @returns Returns all of block objects in Dwg_Data instance.
267
+ */
268
+ dwg_getall_BLOCK(data: Dwg_Data_Ptr): Dwg_Object_BLOCK_Ptr[];
269
+ /**
270
+ * Returns all of block header objects in Dwg_Data instance.
271
+ * @group GetAll Methods
272
+ * @param data Pointer to Dwg_Data instance.
273
+ * @returns Returns all of block header objects in Dwg_Data instance.
274
+ */
275
+ dwg_getall_BLOCK_HEADER(data: Dwg_Data_Ptr): Dwg_Object_BLOCK_HEADER_Ptr[];
276
+ /**
277
+ * Returns all of image definition objects in Dwg_Data instance.
278
+ * @group GetAll Methods
279
+ * @param data Pointer to Dwg_Data instance.
280
+ * @returns Returns all of image definition objects in Dwg_Data instance.
281
+ */
282
+ dwg_getall_IMAGEDEF(data: Dwg_Data_Ptr): Dwg_Object_IMAGEDEF_Ptr[];
283
+ /**
284
+ * Returns all of 2d vertex objects in Dwg_Data instance.
285
+ * @group GetAll Methods
286
+ * @param data Pointer to Dwg_Data instance.
287
+ * @returns Returns all of 2d vertex objects in Dwg_Data instance.
288
+ */
289
+ dwg_getall_VERTEX_2D(data: Dwg_Data_Ptr): Dwg_Object_VERTEX_2D_Ptr[];
290
+ /**
291
+ * Returns all of 3d vertex objects in Dwg_Data instance.
292
+ * @group GetAll Methods
293
+ * @param data Pointer to Dwg_Data instance.
294
+ * @returns Returns all of 3d vertex objects in Dwg_Data instance.
295
+ */
296
+ dwg_getall_VERTEX_3D(data: Dwg_Data_Ptr): Dwg_Object_VERTEX_3D_Ptr[];
297
+ /**
298
+ * Returns all of 2d polyline entities in Dwg_Data instance.
299
+ * @group GetAll Methods
300
+ * @param data Pointer to Dwg_Data instance.
301
+ * @returns Returns all of 2d polyline entities in Dwg_Data instance.
302
+ */
303
+ dwg_getall_POLYLINE_2D(data: Dwg_Data_Ptr): Dwg_Entity_POLYLINE_2D_Ptr[];
304
+ /**
305
+ * Returns all of 3d polyline entities in Dwg_Data instance.
306
+ * @group GetAll Methods
307
+ * @param data Pointer to Dwg_Data instance.
308
+ * @returns Returns all of 3d polyline entities in Dwg_Data instance.
309
+ */
310
+ dwg_getall_POLYLINE_3D(data: Dwg_Data_Ptr): Dwg_Entity_POLYLINE_3D_Ptr[];
311
+ /**
312
+ * Returns all of image entities in Dwg_Data instance.
313
+ * @group GetAll Methods
314
+ * @param data Pointer to Dwg_Data instance.
315
+ * @returns Returns all of image entities in Dwg_Data instance.
316
+ */
317
+ dwg_getall_IMAGE(data: Dwg_Data_Ptr): Dwg_Entity_IMAGE_Ptr[];
318
+ /**
319
+ * Returns all of lwpolyline entities in Dwg_Data instance.
320
+ * @group GetAll Methods
321
+ * @param data Pointer to Dwg_Data instance.
322
+ * @returns Returns all of lwpolyline entities in Dwg_Data instance.
323
+ */
324
+ dwg_getall_LWPOLYLINE(data: Dwg_Data_Ptr): Dwg_Entity_LWPOLYLINE_Ptr[];
325
+ /**
326
+ * Converts one C++ handle array to one JavaScript Dwg_Object_Ref array.
327
+ * @group Array Methods
328
+ * @param ptr Pointer to C++ handle array.
329
+ * @param size The size of C++ handle array.
330
+ * @returns Returns one JavaScript Dwg_Object_Ref array from the specified C++ handle array.
331
+ */
332
+ dwg_ptr_to_object_ref_array(ptr: Dwg_Array_Ptr, size: number): Dwg_Object_Ref[];
333
+ /**
334
+ * Converts one C++ handle array to one JavaScript Dwg_Object_Ref_Ptr array.
335
+ * @group Array Methods
336
+ * @param ptr Pointer to C++ handle array.
337
+ * @param size The size of C++ handle array.
338
+ * @returns Returns one JavaScript Dwg_Object_Ref_Ptr array from the specified C++ handle array.
339
+ */
340
+ dwg_ptr_to_object_ref_ptr_array(ptr: Dwg_Array_Ptr, size: number): Dwg_Object_Ref_Ptr[];
341
+ /**
342
+ * Converts one C++ wchar_t* array to one JavaScript string array.
343
+ * @group Array Methods
344
+ * @param ptr Pointer to C++ wchar_t* array.
345
+ * @param size The size of C++ wchar_t* array.
346
+ * @returns Returns one JavaScript string array from the specified C++ wchar_t* array.
347
+ */
348
+ dwg_ptr_to_wchar_string_array(ptr: Dwg_Array_Ptr, size: number): string[];
349
+ /**
350
+ * Converts one C++ unsigned char array to one JavaScript number array.
351
+ * @group Array Methods
352
+ * @param ptr Pointer to C++ unsigned char array.
353
+ * @param size The size of C++ unsigned char array.
354
+ * @returns Returns one JavaScript number array from the specified C++ unsigned char array.
355
+ */
356
+ dwg_ptr_to_unsigned_char_array(ptr: Dwg_Array_Ptr, size: number): number[];
357
+ /**
358
+ * Converts one C++ signed char array to one JavaScript number array.
359
+ * @group Array Methods
360
+ * @param ptr Pointer to C++ signed char array.
361
+ * @param size The size of C++ signed char array.
362
+ * @returns Returns one JavaScript number array from the specified C++ signed char array.
363
+ */
364
+ dwg_ptr_to_signed_char_array(ptr: Dwg_Array_Ptr, size: number): number[];
365
+ /**
366
+ * Converts one C++ unsigned int16 array to one JavaScript number array.
367
+ * @group Array Methods
368
+ * @param ptr Pointer to C++ unsigned int16 array.
369
+ * @param size The size of C++ unsigned int16 array.
370
+ * @returns Returns one JavaScript number array from the specified C++ unsigned int16 array.
371
+ */
372
+ dwg_ptr_to_uint16_t_array(ptr: Dwg_Array_Ptr, size: number): number[];
373
+ /**
374
+ * Converts one C++ int16 array to one JavaScript number array.
375
+ * @group Array Methods
376
+ * @param ptr Pointer to C++ int16 array.
377
+ * @param size The size of C++ int16 array.
378
+ * @returns Returns one JavaScript number array from the specified C++ int16 array.
379
+ */
380
+ dwg_ptr_to_int16_t_array(ptr: Dwg_Array_Ptr, size: number): number[];
381
+ /**
382
+ * Converts one C++ unsigned int32 array to one JavaScript number array.
383
+ * @group Array Methods
384
+ * @param ptr Pointer to C++ unsigned int32 array.
385
+ * @param size The size of C++ unsigned int32 array.
386
+ * @returns Returns one JavaScript number array from the specified C++ unsigned int32 array.
387
+ */
388
+ dwg_ptr_to_uint32_t_array(ptr: Dwg_Array_Ptr, size: number): number[];
389
+ /**
390
+ * Converts one C++ int32 array to one JavaScript number array.
391
+ * @group Array Methods
392
+ * @param ptr Pointer to C++ int32 array.
393
+ * @param size The size of C++ int32 array.
394
+ * @returns Returns one JavaScript number array from the specified C++ int32 array.
395
+ */
396
+ dwg_ptr_to_int32_t_array(ptr: Dwg_Array_Ptr, size: number): number[];
397
+ /**
398
+ * Converts one C++ unsigned int64 array to one JavaScript number array.
399
+ * @group Array Methods
400
+ * @param ptr Pointer to C++ unsigned int64 array.
401
+ * @param size The size of C++ unsigned int64 array.
402
+ * @returns Returns one JavaScript number array from the specified C++ unsigned int64 array.
403
+ */
404
+ dwg_ptr_to_uint64_t_array(ptr: Dwg_Array_Ptr, size: number): number[];
405
+ /**
406
+ * Converts one C++ int64 array to one JavaScript number array.
407
+ * @group Array Methods
408
+ * @param ptr Pointer to C++ int64 array.
409
+ * @param size The size of C++ int64 array.
410
+ * @returns Returns one JavaScript number array from the specified C++ int64 array.
411
+ */
412
+ dwg_ptr_to_int64_t_array(ptr: Dwg_Array_Ptr, size: number): number[];
413
+ /**
414
+ * Converts one C++ double array to one JavaScript number array.
415
+ * @group Array Methods
416
+ * @param ptr Pointer to C++ double array.
417
+ * @param size The size of C++ double array.
418
+ * @returns Returns one JavaScript number array from the specified C++ double array.
419
+ */
420
+ dwg_ptr_to_double_array(ptr: Dwg_Array_Ptr, size: number): number[];
421
+ /**
422
+ * Converts one C++ 2d point array to one JavaScript 2d point array.
423
+ * @group Array Methods
424
+ * @param ptr Pointer to C++ 2d point array.
425
+ * @param size The size of C++ 2 point array.
426
+ * @returns Returns one JavaScript 2d point array from the specified C++ 2d point array.
427
+ */
428
+ dwg_ptr_to_point2d_array(ptr: Dwg_Array_Ptr, size: number): DwgPoint2D[];
429
+ /**
430
+ * Converts one C++ 3d point array to one JavaScript 3d point array.
431
+ * @group Array Methods
432
+ * @param ptr Pointer to C++ 3d point array.
433
+ * @param size The size of C++ 3d point array.
434
+ * @returns Returns one JavaScript 3d point array from the specified C++ 3d point array.
435
+ */
436
+ dwg_ptr_to_point3d_array(ptr: Dwg_Array_Ptr, size: number): DwgPoint3D[];
437
+ /**
438
+ * Converts one C++ 4d point array to one JavaScript 4d point array.
439
+ * @group Array Methods
440
+ * @param ptr Pointer to C++ 4d point array.
441
+ * @param size The size of C++ 4d point array.
442
+ * @returns Returns one JavaScript 4d point array from the specified C++ 4d point array.
443
+ */
444
+ dwg_ptr_to_point4d_array(ptr: Dwg_Array_Ptr, size: number): DwgPoint4D[];
445
+ /**
446
+ * Converts one C++ line type array to one JavaScript line type array.
447
+ * @group Array Methods
448
+ * @param ptr Pointer to C++ line type array.
449
+ * @param size The size of C++ line type array.
450
+ * @returns Returns one JavaScript line type array from the specified C++ line type array.
451
+ */
452
+ dwg_ptr_to_ltype_dash_array(ptr: Dwg_Array_Ptr, size: number): Dwg_LTYPE_Dash[];
453
+ /**
454
+ * Converts one C++ table cell array to one JavaScript table cell array.
455
+ * @group Array Methods
456
+ * @group Dwg_Entity_TABLE Methods
457
+ * @param ptr Pointer to C++ table cell array.
458
+ * @param size The size of C++ table cell array.
459
+ * @returns Returns one JavaScript table cell array from the specified C++ table cell array.
460
+ */
461
+ dwg_ptr_to_table_cell_array(ptr: Dwg_Array_Ptr, size: number): Dwg_TABLE_Cell[];
462
+ /**
463
+ * Converts one C++ hatch definition line array to one JavaScript hatch definition line array.
464
+ * @group Array Methods
465
+ * @group Dwg_Entity_HATCH Methods
466
+ * @param ptr Pointer to C++ hatch definition line array.
467
+ * @param size The size of C++ hatch definition line array.
468
+ * @returns Returns one JavaScript hatch definition line array from the specified C++ hatch definition line array.
469
+ */
470
+ dwg_ptr_to_hatch_defline_array(ptr: Dwg_Array_Ptr, size: number): Dwg_HATCH_DefLine[];
471
+ /**
472
+ * Converts one C++ hatch path array to one JavaScript hatch path array.
473
+ * @group Array Methods
474
+ * @group Dwg_Entity_HATCH Methods
475
+ * @param ptr Pointer to C++ hatch path array.
476
+ * @param size The size of C++ hatch path array.
477
+ * @returns Returns one JavaScript hatch path array from the specified C++ hatch path array.
478
+ */
479
+ dwg_ptr_to_hatch_path_array(ptr: Dwg_Array_Ptr, size: number): Dwg_HATCH_Path[];
480
+ /**
481
+ * Converts one C++ hatch gradient color array to one JavaScript hatch gradient color array.
482
+ * @group Array Methods
483
+ * @group Dwg_Entity_HATCH Methods
484
+ * @param ptr Pointer to C++ hatch gradient color array.
485
+ * @param size The size of C++ hatch gradient color array.
486
+ * @returns Returns one JavaScript hatch gradient color array from the specified C++ hatch gradient color array.
487
+ */
488
+ dwg_ptr_to_hatch_gradient_color_array(ptr: Dwg_Array_Ptr, size: number): DwgGradientColor[];
489
+ /**
490
+ * Converts one C++ mline vertex array to one JavaScript mline vertex array.
491
+ * @group Array Methods
492
+ * @group Dwg_Entity_MLINE Methods
493
+ * @param ptr Pointer to C++ mline vertex array.
494
+ * @param size The size of C++ mline vertex array.
495
+ * @returns Returns one JavaScript mline vertex array from the specified C++ mline vertex array.
496
+ */
497
+ dwg_ptr_to_mline_vertex_array(ptr: Dwg_Array_Ptr, size: number): Dwg_MLINE_Vertex[];
498
+ /**
499
+ * Generic field value getter. Used to get the field value of one object or entity.
500
+ * @group Dynamic API Methods
501
+ * @param obj Pointer to one object or entity
502
+ * @param field Field name of one object or entity
503
+ * @returns Returns the field value of one object or entity.
504
+ */
505
+ dwg_dynapi_entity_value(obj: Dwg_Object_Object_TIO_Ptr | Dwg_Object_Entity_TIO_Ptr, field: string): Dwg_Field_Value;
506
+ /**
507
+ * Header field value getter. Used to get the field value of dwg/dxf header.
508
+ * @group Dynamic API Methods
509
+ * @param data Pointer to Dwg_Data instance.
510
+ * @param field Field name of header.
511
+ * @returns Returns the field value of dwg/dxf header.
512
+ */
513
+ dwg_dynapi_header_value(data: Dwg_Data_Ptr, field: string): Dwg_Field_Value;
514
+ /**
515
+ * The common field value getter. Used to get the value of object or entity common fields.
516
+ * @group Dynamic API Methods
517
+ * @param obj Pointer to one object or entity
518
+ * @param field The name of object or entity common fields.
519
+ * @returns Returns the value of object or entity common fields.
520
+ */
521
+ dwg_dynapi_common_value(obj: Dwg_Object_Object_TIO_Ptr | Dwg_Object_Entity_TIO_Ptr, field: string): Dwg_Field_Value;
522
+ /**
523
+ * The field of one object or entity may not be primitive type. It means one field may consist of
524
+ * multiple sub-fields. This method is used to get the sub-field value of those complex field.
525
+ * @group Dynamic API Methods
526
+ * @param obj Pointer to one object or entity.
527
+ * @param subclass The class name of the field with complex type.
528
+ * @param field The field name of one object or entit.
529
+ * @returns Returns the sub-field value of one complex field.
530
+ */
531
+ dwg_dynapi_subclass_value(obj: Dwg_Object_Object_TIO_Ptr | Dwg_Object_Entity_TIO_Ptr, subclass: string, field: string): Dwg_Field_Value;
532
+ /**
533
+ * Returns the handle of one Dwg_Object instance.
534
+ * @group Dwg_Object Methods
535
+ * @param ptr Pointer to one Dwg_Object instance.
536
+ * @returns Returns the handle of one Dwg_Object instance.
537
+ */
538
+ dwg_object_get_handle_object(ptr: Dwg_Object_Ptr): Dwg_Handle;
539
+ /**
540
+ * Returns the handle of one Dwg_Object_Object instance.
541
+ * @group Dwg_Object_Object Methods
542
+ * @param ptr Pointer to one Dwg_Object_Object instance.
543
+ * @returns Returns the handle of one Dwg_Object_Object instance.
544
+ */
545
+ dwg_object_object_get_handle_object(ptr: Dwg_Object_Object_Ptr): Dwg_Handle;
546
+ /**
547
+ * Returns the owner handle of one Dwg_Object_Object instance.
548
+ * @group Dwg_Object_Object Methods
549
+ * @param ptr Pointer to one Dwg_Object_Object instance.
550
+ * @returns Returns the owner handle of one Dwg_Object_Object instance.
551
+ */
552
+ dwg_object_object_get_ownerhandle_object(ptr: Dwg_Object_Object_Ptr): Dwg_Object_Ref;
553
+ /**
554
+ * Returns the handle of one Dwg_Object_Entity instance.
555
+ * @group Dwg_Object_Entity Methods
556
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
557
+ * @returns Returns the handle of one Dwg_Object_Entity instance.
558
+ */
559
+ dwg_object_entity_get_handle_object(ptr: Dwg_Object_Entity_Ptr): Dwg_Handle;
560
+ /**
561
+ * Returns the owner handle of one Dwg_Object_Entity instance.
562
+ * @group Dwg_Object_Entity Methods
563
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
564
+ * @returns Returns the owner handle of one Dwg_Object_Entity instance.
565
+ */
566
+ dwg_object_entity_get_ownerhandle_object(ptr: Dwg_Object_Entity_Ptr): Dwg_Object_Ref;
567
+ /**
568
+ * Returns hard-owner ID/handle to owner dictionary of one Dwg_Object_Entity instance.
569
+ * @group Dwg_Object_Entity Methods
570
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
571
+ * @returns Returns hard-owner ID/handle to owner dictionary of one Dwg_Object_Entity instance.
572
+ */
573
+ dwg_object_entity_get_xdicobjhandle_object(ptr: Dwg_Object_Entity_Ptr): Dwg_Object_Ref;
574
+ /**
575
+ * Returns the layer handle of one Dwg_Object_Entity instance.
576
+ * @group Dwg_Object_Entity Methods
577
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
578
+ * @returns Returns the layer handle of one Dwg_Object_Entity instance.
579
+ */
580
+ dwg_object_entity_get_layer_object_ref(ptr: Dwg_Object_Entity_Ptr): Dwg_Object_Ref;
581
+ /**
582
+ * Returns the line type handle of one Dwg_Object_Entity instance.
583
+ * @group Dwg_Object_Entity Methods
584
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
585
+ * @returns Returns the line type handle of one Dwg_Object_Entity instance.
586
+ */
587
+ dwg_object_entity_get_ltype_object_ref(ptr: Dwg_Object_Entity_Ptr): Dwg_Object_Ref;
588
+ /**
589
+ * Returns color value of one Dwg_Object_Entity instance.
590
+ * @group Dwg_Object_Entity Methods
591
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
592
+ * @returns Returns color value of one Dwg_Object_Entity instance.
593
+ */
594
+ dwg_object_entity_get_color_object(ptr: Dwg_Object_Entity_Ptr): Dwg_Color;
595
+ /**
596
+ * Returns xdata of one Dwg_Object_Entity instance.
597
+ * @group Dwg_Object_Entity Methods
598
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
599
+ * @returns Returns xdata of one Dwg_Object_Entity instance.
600
+ */
601
+ dwg_object_entity_get_xdata(ptr: Dwg_Object_Entity_Ptr): DwgXData;
602
+ /**
603
+ * Returns pointer to BLOCK_HEADER owner for generic entity from ent->ownerhandle.
604
+ * @group Dwg_Object_Entity Methods
605
+ * @param ptr Pointer to one Dwg_Object_Entity instance.
606
+ * @returns Returns pointer to BLOCK_HEADER owner.
607
+ */
608
+ dwg_entity_owner(ptr: Dwg_Object_Entity_TIO_Ptr): Dwg_Object_Entity_TIO_Ptr;
609
+ /**
610
+ * Returns block name of one Dwg_Entity_* instance with one block field. For example,
611
+ * dimension entities have one 'block' field which represents the block that contains
612
+ * the entities that make up the dimension picture.
613
+ * @group Dwg_Entity_* Methods
614
+ * @param ptr Pointer to one Dwg_Entity_* instance with one block field.
615
+ * @param field Field name of the block.
616
+ * @returns Returns block name of one Dwg_Entity_* instance.
617
+ */
618
+ dwg_entity_get_block_name(ptr: Dwg_Object_Entity_TIO_Ptr, field: string): string;
619
+ /**
620
+ * Returns dimension style name of one Dwg_Entity_* instance with one dimension style
621
+ * field.
622
+ * @group Dwg_Entity_* Methods
623
+ * @param ptr Pointer to one Dwg_Entity_* instance.
624
+ * @param field Field name of the dimension style.
625
+ * @returns Returns dimension style name of one Dwg_Entity_* instance.
626
+ */
627
+ dwg_entity_get_dimstyle_name(ptr: Dwg_Object_Entity_TIO_Ptr, field?: string): string;
628
+ /**
629
+ * Returns block entity pointed by the specified block header.
630
+ * @group Dwg_Entity_BLOCK_HEADER Methods
631
+ * @param ptr Pointer to one Dwg_Entity_BLOCK_HEADER instance.
632
+ * @returns Returns block entity pointed by the specified block header.
633
+ */
634
+ dwg_entity_block_header_get_block(ptr: Dwg_Object_BLOCK_HEADER_Ptr): Dwg_Entity_BLOCK;
635
+ /**
636
+ * Returns preview image of the block pointed by the specified block header.
637
+ * @group Dwg_Entity_BLOCK_HEADER Methods
638
+ * @param ptr Pointer to one Dwg_Entity_BLOCK_HEADER instance.
639
+ * @returns Returns preview image of the block pointed by the specified block header.
640
+ */
641
+ dwg_entity_block_header_get_preview(ptr: Dwg_Object_BLOCK_HEADER_Ptr): Uint8Array;
642
+ /**
643
+ * Returns preview binary data of one entity (common entity preview field).
644
+ * For PROXY_ENTITY this contains the proxy graphics data.
645
+ */
646
+ dwg_entity_get_preview(ptr: Dwg_Object_Ptr): Uint8Array | null;
647
+ /**
648
+ * Returns entity binary data of one Dwg_Entity_PROXY_ENTITY instance.
649
+ * @group Dwg_Entity_PROXY_ENTITY Methods
650
+ * @param ptr Pointer to one Dwg_Entity_PROXY_ENTITY instance.
651
+ * @returns Entity data bytes, or null when absent.
652
+ */
653
+ dwg_entity_proxy_entity_get_entity_data(ptr: Dwg_Entity_PROXY_ENTITY_Ptr): Uint8Array | null;
654
+ /**
655
+ * Returns the first entity owned by the block header or null
656
+ * @group Dwg_Entity_BLOCK_HEADER Methods
657
+ * @param ptr Pointer to the block header.
658
+ * @returns Returns the first entity owned by the block header or null
659
+ */
660
+ get_first_owned_entity(ptr: Dwg_Object_Ptr): Dwg_Object_Ptr;
661
+ /**
662
+ * Returns the next entity owned by the block header or null.
663
+ * @group Dwg_Entity_BLOCK_HEADER Methods
664
+ * @param ptr Pointer to the block header.
665
+ * @param current Pointer to the current entity in the block header.
666
+ * @returns Returns the next entity owned by the block header or null.
667
+ */
668
+ get_next_owned_entity(ptr: Dwg_Object_Ptr, current: Dwg_Object_Ptr): Dwg_Object_Ptr;
669
+ /**
670
+ * Returns text style name of one Dwg_Entity_MTEXT instance.
671
+ * @group Dwg_Entity_MTEXT Methods
672
+ * @param ptr Pointer to one Dwg_Entity_MTEXT instance.
673
+ * @returns Returns text style name of one Dwg_Entity_MTEXT instance.
674
+ */
675
+ dwg_entity_mtext_get_style_name(ptr: Dwg_Entity_MTEXT_Ptr): string;
676
+ /**
677
+ * Returns text style name of one Dwg_Entity_TEXT instance.
678
+ * @group Dwg_Entity_TEXT Methods
679
+ * @param ptr Pointer to one Dwg_Entity_TEXT instance.
680
+ * @returns Returns text style name of one Dwg_Entity_TEXT instance.
681
+ */
682
+ dwg_entity_text_get_style_name(ptr: Dwg_Entity_TEXT_Ptr): string;
683
+ /**
684
+ * Returns the number of points in Dwg_Entity_POLYLINE_2D.
685
+ * @group Dwg_Entity_POLYLINE_2D Methods
686
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_2D) instance.
687
+ * @returns Returns the number of points in one Dwg_Entity_POLYLINE_2D.
688
+ */
689
+ dwg_entity_polyline_2d_get_numpoints(ptr: Dwg_Object_Ptr): number;
690
+ /**
691
+ * Returns points in Dwg_Entity_POLYLINE_2D.
692
+ * @group Dwg_Entity_POLYLINE_2D Methods
693
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_2D) instance.
694
+ * @returns Returns points in one Dwg_Entity_POLYLINE_2D.
695
+ */
696
+ dwg_entity_polyline_2d_get_points(ptr: Dwg_Object_Ptr): DwgPoint2D[];
697
+ /**
698
+ * Returns vertices in Dwg_Entity_POLYLINE_2D.
699
+ * @group Dwg_Entity_POLYLINE_2D Methods
700
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_2D) instance.
701
+ * @returns Returns vertices in one Dwg_Entity_POLYLINE_2D.
702
+ */
703
+ dwg_entity_polyline_2d_get_vertices(ptr: Dwg_Object_Ptr): Dwg_Entity_VERTEX_2D[];
704
+ /**
705
+ * Returns the number of points in Dwg_Entity_POLYLINE_3D.
706
+ * @group Dwg_Entity_POLYLINE_3D Methods
707
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_3D) instance.
708
+ * @returns Returns the number of points in one Dwg_Entity_POLYLINE_3D.
709
+ */
710
+ dwg_entity_polyline_3d_get_numpoints(ptr: Dwg_Object_Ptr): number;
711
+ /**
712
+ * Returns points in Dwg_Entity_POLYLINE_3D.
713
+ * @group Dwg_Entity_POLYLINE_3D Methods
714
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_3D) instance.
715
+ * @returns Returns points in one Dwg_Entity_POLYLINE_3D.
716
+ */
717
+ dwg_entity_polyline_3d_get_points(ptr: Dwg_Object_Ptr): DwgPoint3D[];
718
+ /**
719
+ * Returns vertices in Dwg_Entity_POLYLINE_3D.
720
+ * @group Dwg_Entity_POLYLINE_3D Methods
721
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_POLYLINE_3D) instance.
722
+ * @returns Returns vertices in one Dwg_Entity_POLYLINE_3D.
723
+ */
724
+ dwg_entity_polyline_3d_get_vertices(ptr: Dwg_Object_Ptr): Dwg_Entity_VERTEX_3D[];
725
+ /**
726
+ * Returns attributes associated with INSERT entity.
727
+ * @group Dwg_Entity_INSERT Methods
728
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Entity_INSERT) instance.
729
+ * @returns Returns attributes associated with INSERT entity.
730
+ */
731
+ dwg_entity_insert_get_attribs(ptr: Dwg_Object_Ptr): number[];
732
+ /**
733
+ * Returns texts in Dwg_Object_DICTIONARY.
734
+ * @group Dwg_Object_DICTIONARY Methods
735
+ * @param ptr Pointer to one Dwg_Object (not Dwg_Object_DICTIONARY) instance.
736
+ * @returns Returns texts in one Dwg_Object_DICTIONARY.
737
+ */
738
+ dwg_object_dictionary_get_texts(ptr: Dwg_Object_Ptr): string[];
739
+ }
740
+ //# sourceMappingURL=libredwg-core.d.ts.map