ducsvg 3.9.0 → 4.0.1

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.
@@ -1,8 +1,13 @@
1
1
  import { type ConversionOptions } from "ducpdf";
2
+ import type { ExportedDataState } from "ducjs";
2
3
  import { type SvgDocument } from "./pdf2svg";
3
4
  export type { SvgDocument };
5
+ export interface DucDocumentSource {
6
+ readDocumentState(): ExportedDataState | Promise<ExportedDataState>;
7
+ }
8
+ export type DucSvgSource = ExportedDataState | DucDocumentSource;
4
9
  /**
5
- * Convert DUC data to SVG pages.
10
+ * Convert a DUC document state/source to SVG pages.
6
11
  * Uses ducpdf to convert DUC to PDF, then pdf2svg to convert PDF to SVG.
7
12
  */
8
- export declare const ducToSvg: (ducData: Uint8Array, options?: ConversionOptions) => Promise<SvgDocument>;
13
+ export declare const ducToSvg: (source: DucSvgSource, options?: ConversionOptions) => Promise<SvgDocument>;
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ducsvg",
3
- "version": "3.9.0",
3
+ "version": "4.0.1",
4
4
  "description": "Adapter for converting duc CAD documents to SVG. Built on top of ducjs.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -29,19 +29,22 @@
29
29
  "copy:wasm-to-dist": "mkdir -p dist && cp pkg/pdf2svg_bg.wasm dist/ && cp pkg/pdf2svg.js dist/pdf2svg-wasm.js && cp pkg/pdf2svg.d.ts dist/pdf2svg-wasm.d.ts && cp pkg/pdf2svg_bg.wasm.d.ts dist/",
30
30
  "clean": "rm -rf dist pkg",
31
31
  "check-types": "tsc --noEmit",
32
+ "gen:docs": "bunx typedoc",
33
+ "dev:docs": "bun run gen:docs && python3 -m http.server 8244 --directory docs",
32
34
  "test": "bun test",
33
35
  "semantic-release": "semantic-release"
34
36
  },
35
37
  "author": "Ducflair",
36
38
  "license": "MIT",
37
39
  "dependencies": {
38
- "ducjs": "^3.5.0",
39
- "ducpdf": "^3.9.0"
40
+ "ducjs": "^4.0.0",
41
+ "ducpdf": "^4.0.1"
40
42
  },
41
43
  "devDependencies": {
42
44
  "@xmldom/xmldom": "^0.8.11",
43
45
  "happy-dom": "^20.0.5",
44
46
  "semantic-release": "^24.1.2",
47
+ "typedoc": "^0.27.9",
45
48
  "typescript": "^5.8.3",
46
49
  "vite": "^6.0.0",
47
50
  "vite-plugin-compression": "^0.5.1",