@embedpdf/pdfium 1.0.0-alpha.1 → 1.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.
package/dist/pdfium.wasm CHANGED
Binary file
@@ -0,0 +1,17 @@
1
+ export interface WasmExports {
2
+ malloc: (size: number) => number;
3
+ free: (ptr: number) => void;
4
+ }
5
+ export interface PdfiumRuntimeMethods {
6
+ wasmExports: WasmExports;
7
+ cwrap: typeof cwrap;
8
+ addFunction: typeof addFunction;
9
+ removeFunction: typeof removeFunction;
10
+ ccall: typeof ccall;
11
+ setValue: typeof setValue;
12
+ getValue: typeof getValue;
13
+ UTF8ToString: typeof UTF8ToString;
14
+ UTF16ToString: typeof UTF16ToString;
15
+ stringToUTF8: typeof stringToUTF8;
16
+ stringToUTF16: typeof stringToUTF16;
17
+ }
package/package.json CHANGED
@@ -1,17 +1,26 @@
1
1
  {
2
2
  "name": "@embedpdf/pdfium",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.1",
4
4
  "private": false,
5
5
  "description": "PDFium WebAssembly for the web platform. This package provides a powerful JavaScript interface to PDFium, enabling high-quality PDF rendering and manipulation directly in web applications.",
6
6
  "type": "module",
7
- "main": "./dist/index.js",
8
- "module": "./dist/index.cjs",
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.cjs"
12
+ "browser": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.browser.js"
15
+ },
16
+ "import": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.cts",
22
+ "default": "./dist/index.cjs"
23
+ }
15
24
  },
16
25
  "./pdfium.wasm": "./dist/pdfium.wasm"
17
26
  },
@@ -39,24 +48,31 @@
39
48
  "author": "Bob Singor, Ji Chang",
40
49
  "license": "MIT",
41
50
  "devDependencies": {
42
- "tsup": "^8.0.0",
43
- "typescript": "^5.0.0",
51
+ "@rollup/plugin-commonjs": "^25.0.8",
52
+ "@rollup/plugin-node-resolve": "^15.2.1",
53
+ "@rollup/plugin-replace": "^5.0.2",
54
+ "@rollup/plugin-typescript": "^11.1.2",
44
55
  "@types/emscripten": "^1.39.13",
45
- "cpy-cli": "^5.0.0"
56
+ "cpy-cli": "^5.0.0",
57
+ "magic-string": "^0.30.17",
58
+ "rollup": "^3.28.0",
59
+ "rollup-plugin-copy": "^3.4.0",
60
+ "rollup-plugin-dts": "^6.2.1",
61
+ "typescript": "^5.0.0"
46
62
  },
47
63
  "publishConfig": {
48
64
  "access": "public"
49
65
  },
50
66
  "scripts": {
51
- "build": "PROJECT_CWD=$(pwd) pnpm -w p:build",
52
- "build:watch": "PROJECT_CWD=$(pwd) pnpm -w p:build:watch",
67
+ "build": "rollup -c",
68
+ "build:watch": "rollup -c -w",
53
69
  "clean": "PROJECT_CWD=$(pwd) pnpm -w p:clean",
54
70
  "lint": "PROJECT_CWD=$(pwd) pnpm -w p:lint",
55
71
  "lint:fix": "PROJECT_CWD=$(pwd) pnpm -w p:lint:fix",
56
72
  "typecheck": "PROJECT_CWD=$(pwd) pnpm -w p:typecheck",
57
73
  "prewasm": "node ./scripts/generate-exported-functions.js && node ./scripts/generate-exported-runtime-methods.js",
58
74
  "wasm": "make build && pnpm run wasm:copy",
59
- "wasm:copy": "cpy ./docker/dist/pdfium.js ./src --flat && cpy ./docker/dist/pdfium.wasm ./src --flat",
75
+ "wasm:copy": "cpy ./docker/dist/pdfium.cjs ./src/vendor --flat && cpy ./docker/dist/pdfium.wasm ./src/vendor --flat && cpy ./docker/dist/pdfium.js ./src/vendor --flat",
60
76
  "build:all": "pnpm run wasm && pnpm run build"
61
77
  }
62
78
  }