@bonniepdf/previewer 0.0.0-stage → 2026.11.21

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.
@@ -0,0 +1,406 @@
1
+ /**
2
+ * A single previewable page: its `<svg>` markup plus its intrinsic size in PDF
3
+ * points. Hosts can pass `fontFaceCss` through `LoadOptions` once per document
4
+ * instead of inlining duplicate font CSS into every page SVG.
5
+ */
6
+ export interface PreviewPage {
7
+ /** `<svg>...</svg>` markup for the page. */
8
+ svg: string;
9
+ /** Page width in PDF points (the SVG's intrinsic width). */
10
+ width: number;
11
+ /** Page height in PDF points (the SVG's intrinsic height). */
12
+ height: number;
13
+ }
14
+ /** How the previewer fits pages into the available viewport space. */
15
+ export type FitMode = 'fit-page' | 'fit-width' | 'custom';
16
+ /** A semantic fit mode or an explicit scale selected by the user. */
17
+ export interface PreviewerZoomState {
18
+ mode: FitMode;
19
+ /** Scale factor used when `mode` is `custom` (1 = 100%). */
20
+ scale?: number;
21
+ }
22
+ /** One rectangle an element occupied on a page (top-left origin, PDF points). */
23
+ export interface SnapshotRect {
24
+ page: number;
25
+ x: number;
26
+ y: number;
27
+ width: number;
28
+ height: number;
29
+ }
30
+ /**
31
+ * Intrinsic accessibility facts for a node, mirroring `@bonniepdf/core`'s
32
+ * `NodeAccessibility`. Present only when the element declares a role.
33
+ */
34
+ export interface NodeAccessibility {
35
+ /** Resolved PDF structure tag, e.g. `'H1'`, `'P'`, `'Figure'`, `'TH'`. */
36
+ role: string;
37
+ /** True when the element contributes real content to the structure tree. */
38
+ tagged: boolean;
39
+ /** True when the element renders as an `/Artifact` (out of reading order). */
40
+ artifact: boolean;
41
+ /** `/Alt` alternate text, when supplied. */
42
+ alt?: string;
43
+ /** Author explicitly marked the element decorative. */
44
+ decorative?: boolean;
45
+ /** Heading level 1–6 for `H1`…`H6`. */
46
+ headingLevel?: number;
47
+ /** True for image-like elements (figure candidates). */
48
+ imageLike?: boolean;
49
+ }
50
+ /** One node in the layout tree. */
51
+ export interface SnapshotNode {
52
+ id: string;
53
+ type: string;
54
+ name?: string;
55
+ /** Opaque source id supplied by an instrumented editor preview build. */
56
+ sourceId?: string;
57
+ rects: SnapshotRect[];
58
+ /** Intrinsic accessibility facts, when the element declares a role. */
59
+ a11y?: NodeAccessibility;
60
+ children: SnapshotNode[];
61
+ }
62
+ /** Document-level accessibility/compliance context, mirroring core's `SnapshotMeta`. */
63
+ export interface SnapshotMeta {
64
+ accessibilityMode: number;
65
+ conformance: string;
66
+ language?: string;
67
+ title?: string;
68
+ }
69
+ /** The captured layout of a document, as consumed by inspector plugins. */
70
+ export interface LayoutSnapshot {
71
+ version: number;
72
+ pages: {
73
+ width: number;
74
+ height: number;
75
+ }[];
76
+ root: SnapshotNode;
77
+ /** Document-level accessibility/compliance context. */
78
+ meta?: SnapshotMeta;
79
+ }
80
+ /** Severity of a compliance finding. */
81
+ export type ComplianceSeverity = 'error' | 'warning' | 'info';
82
+ /** One reported accessibility/compliance issue. */
83
+ export interface ComplianceFinding {
84
+ code: string;
85
+ severity: ComplianceSeverity;
86
+ standard: string;
87
+ clause: string;
88
+ message: string;
89
+ fixHint?: string;
90
+ /** The node this finding anchors to; omitted for document-level findings. */
91
+ nodeId?: string;
92
+ role?: string;
93
+ page?: number;
94
+ }
95
+ /** The result of evaluating a snapshot for compliance. */
96
+ export interface ComplianceReport {
97
+ findings: ComplianceFinding[];
98
+ passed: boolean;
99
+ errorCount: number;
100
+ warningCount: number;
101
+ infoCount: number;
102
+ }
103
+ /**
104
+ * Capabilities the previewer host hands to a plugin. Everything here is a thin
105
+ * wrapper over machinery the previewer already owns (page elements, the scale
106
+ * factor, scroll-to-page); plugins never reach into the controller internals.
107
+ */
108
+ export interface PreviewerPluginContext {
109
+ /** The owning document, for creating elements. */
110
+ readonly ownerDocument: Document;
111
+ /** Host element used for composed integration events. */
112
+ readonly hostElement: HTMLElement;
113
+ /** Adds a control to the toolbar's trailing group. */
114
+ addToolbarItem(element: HTMLElement): void;
115
+ /**
116
+ * Registers a side panel in the body (beside the page scroll area). All
117
+ * registered panels share **one** collapsible region with a tab strip — only
118
+ * one panel is ever visible at a time, and a single toolbar button toggles the
119
+ * region. This keeps multiple inspector plugins (structure, compliance, …) from
120
+ * stacking as competing side-by-side panels.
121
+ *
122
+ * - `defaultOpen`: open the region on this panel when it registers (the first
123
+ * panel to request it wins; later panels become inactive tabs).
124
+ * - `onVisibilityChange`: called with `true` when this panel becomes the active,
125
+ * visible tab and `false` when it stops being (region closed or switched away).
126
+ * Plugins use it to paint/clear on-page overlays instead of tracking their own
127
+ * toolbar toggle.
128
+ *
129
+ * The returned handle drives the panel: `setVisible` activates/closes it, and
130
+ * `setBadge` shows a small count/severity badge on its tab (and contributes a
131
+ * dot to the shared toolbar toggle so issues are visible while collapsed).
132
+ */
133
+ addSidePanel(panel: {
134
+ id: string;
135
+ label: string;
136
+ element: HTMLElement;
137
+ defaultOpen?: boolean;
138
+ onVisibilityChange?: (visible: boolean) => void;
139
+ }): {
140
+ setVisible(visible: boolean): void;
141
+ setBadge(text: string | null, tone?: 'error' | 'warning' | 'info' | 'ok'): void;
142
+ };
143
+ /** The `.bpp-page` host element for a 0-based page index, or null. */
144
+ pageElement(index: number): HTMLElement | null;
145
+ /**
146
+ * The pointer-events:none overlay layer for a page, created on first use.
147
+ * Plugins paint absolutely-positioned children into it; it survives the
148
+ * windowed mount/unmount of the page's SVG.
149
+ */
150
+ overlayFor(index: number): HTMLElement | null;
151
+ /** Current scale factor mapping PDF points to CSS pixels. */
152
+ scale(): number;
153
+ /** Number of pages currently loaded. */
154
+ pageCount(): number;
155
+ /** Scrolls a 1-based page into view (mirrors the toolbar's navigation). */
156
+ scrollToPage(pageNumber: number): void;
157
+ }
158
+ /** Per-load context: the plugin context plus the document being shown. */
159
+ export interface PreviewerLoadContext extends PreviewerPluginContext {
160
+ pages: PreviewPage[];
161
+ /** The layout snapshot, when the host was given one via {@link LoadOptions.snapshot}. */
162
+ snapshot?: LayoutSnapshot;
163
+ /** The compliance report, when the host was given one via {@link LoadOptions.report}. */
164
+ report?: ComplianceReport;
165
+ }
166
+ /** State pushed to plugins whenever the viewport scale or current page changes. */
167
+ export interface PreviewerSyncContext {
168
+ scale: number;
169
+ currentPage: number;
170
+ }
171
+ /**
172
+ * A previewer plugin. Lifecycle: `setup` once when the previewer is built (may
173
+ * return a cleanup fn), `load` on every document load, `sync` on scale/page
174
+ * changes, `teardown` on dispose or when a load supersedes the previous one.
175
+ * With no plugins registered the previewer behaves exactly as before.
176
+ */
177
+ export interface PreviewerPlugin {
178
+ readonly name: string;
179
+ /**
180
+ * Set when the plugin reads the layout snapshot or compliance report. When any
181
+ * registered plugin sets it, `load(doc)` asks the document to capture its
182
+ * layout; otherwise it skips that work.
183
+ */
184
+ readonly needsLayout?: boolean;
185
+ setup?(ctx: PreviewerPluginContext): void | (() => void);
186
+ load?(ctx: PreviewerLoadContext): void;
187
+ sync?(ctx: PreviewerSyncContext): void;
188
+ /** Selects a snapshot node when the plugin owns node-selection UI. */
189
+ selectSnapshotNode?(nodeId: string): boolean;
190
+ teardown?(): void;
191
+ }
192
+ /**
193
+ * Controls which built-in toolbar groups render. Each flag defaults to `true`,
194
+ * so an omitted `toolbar` (or omitted flag) leaves the toolbar exactly as it was
195
+ * before this option existed. Hosts embedding the previewer in a context that
196
+ * owns its own chrome (e.g. an editor panel with native save/fullscreen) can
197
+ * drop the groups that don't apply. Note these gate the built-in groups only —
198
+ * plugin-contributed controls (via `addToolbarItem`) are unaffected.
199
+ */
200
+ export interface ToolbarConfig {
201
+ /** The thumbnail-rail toggle button. Defaults to `true`. */
202
+ thumbnails?: boolean;
203
+ /** The previous / page-indicator / next group. Defaults to `true`. */
204
+ pageNav?: boolean;
205
+ /** The zoom-out / zoom-select / zoom-in group. Defaults to `true`. */
206
+ zoom?: boolean;
207
+ /** The full-screen toggle button. Defaults to `true`. */
208
+ fullscreen?: boolean;
209
+ /** The download-PDF button. Defaults to `true`. */
210
+ download?: boolean;
211
+ }
212
+ /**
213
+ * The optional footer bar. Set {@link PreviewerOptions.footer} to render a slim
214
+ * bar below the page area: host-supplied text on the left, and conformance pills
215
+ * on the right derived from each loaded document's snapshot metadata (e.g.
216
+ * `PDF/A-2a`, `PDF/UA-1`). Omitting `footer` renders no bar at all — the
217
+ * previewer's layout is exactly as it was before this option existed.
218
+ */
219
+ export interface FooterConfig {
220
+ /**
221
+ * Left-aligned text. Defaults to `'Generated by @bonniepdf/previewer'`. Set an
222
+ * empty string to leave the left side blank (the pills still render).
223
+ */
224
+ text?: string;
225
+ /**
226
+ * Render conformance pills derived from the loaded document's
227
+ * `snapshot.meta`: its PDF/A conformance level and PDF/UA level. Defaults
228
+ * to `true`. Documents loaded without a snapshot simply show no pills.
229
+ */
230
+ conformance?: boolean;
231
+ }
232
+ /** Visibility state for the previewer's collapsible navigation panels. */
233
+ export interface PreviewerViewState {
234
+ showThumbnails: boolean;
235
+ showInspector: boolean;
236
+ zoom: PreviewerZoomState;
237
+ }
238
+ /** Configuration applied when a previewer is created (chrome / defaults). */
239
+ export interface PreviewerOptions {
240
+ /** Plugins extending the previewer (e.g. the accessibility inspector). Optional. */
241
+ plugins?: PreviewerPlugin[];
242
+ /**
243
+ * Which built-in toolbar groups to render. Every flag defaults to `true`, so
244
+ * omitting this leaves the full toolbar in place. See {@link ToolbarConfig}.
245
+ */
246
+ toolbar?: ToolbarConfig;
247
+ /** Show the thumbnail rail on first render. Defaults to `false`. */
248
+ showThumbnails?: boolean;
249
+ /**
250
+ * Show the shared inspector region on first render. When omitted, inspector
251
+ * plugins retain their own `openByDefault` behaviour.
252
+ */
253
+ showInspector?: boolean;
254
+ /** Restores a previously selected zoom. `fitMode` remains the fallback. */
255
+ initialZoom?: PreviewerZoomState;
256
+ /** Called whenever panel visibility or the user-selected zoom changes. */
257
+ onViewStateChange?: (state: PreviewerViewState) => void;
258
+ /** Initial fit mode. Defaults to `'fit-page'`. */
259
+ fitMode?: Exclude<FitMode, 'custom'>;
260
+ /** Accessible label for the previewer region. Defaults to `'PDF preview'`. */
261
+ title?: string;
262
+ /** Default download filename. Defaults to `'document.pdf'`. */
263
+ downloadFilename?: string;
264
+ /** Hides the outer border and border-radius around the previewer. Defaults to `false`. */
265
+ hideBorder?: boolean;
266
+ /**
267
+ * Renders the footer bar below the page area. Omit for no footer. See
268
+ * {@link FooterConfig}.
269
+ */
270
+ footer?: FooterConfig;
271
+ /** Whether to apply custom styling to scrollbars. Defaults to `false`. */
272
+ styleScrollbars?: boolean;
273
+ /**
274
+ * Selection highlight colour as any valid CSS colour. Defaults to the
275
+ * platform-standard `Highlight` system colour. This takes precedence over
276
+ * an inherited `--bpdf-selection` custom property.
277
+ */
278
+ selectionColor?: string;
279
+ }
280
+ /** Per-document data handed to the deprecated `load(pages, options)` form. */
281
+ export interface LoadOptions {
282
+ /**
283
+ * `@font-face` CSS (e.g. from `generateSvgDocumentAsync`) embedding the
284
+ * subsetted fonts the document uses, so pages render with the exact faces they
285
+ * were laid out with. Injected once at the document level (font resources are
286
+ * document-scoped and reach shadow content; the names are namespaced so they
287
+ * never collide with installed fonts).
288
+ */
289
+ fontFaceCss?: string;
290
+ /**
291
+ * A ready PDF blob/URL for the download button.
292
+ * @deprecated Load the document or its export and pass {@link PreviewLoadOptions.pdf}.
293
+ */
294
+ pdfUrl?: string;
295
+ /**
296
+ * Lazily produces the PDF blob URL on the first download click. Preferred over
297
+ * {@link pdfUrl} so previewing a large document does not pay for full PDF
298
+ * generation unless the user actually downloads.
299
+ * @deprecated Load the document or its export and pass {@link PreviewLoadOptions.pdf}.
300
+ */
301
+ pdfProvider?: () => Promise<string>;
302
+ /** Overrides the download filename for this document. */
303
+ downloadFilename?: string;
304
+ /**
305
+ * The layout snapshot for this document (from `generateSvgDocumentAsync({
306
+ * captureLayout: true })`). Consumed by the accessibility inspector; ignored
307
+ * when no plugin uses it.
308
+ */
309
+ snapshot?: LayoutSnapshot;
310
+ /**
311
+ * A precomputed compliance report for this document (from core's
312
+ * `evaluateCompliance(snapshot)`). Consumed by the compliance-view plugin. When
313
+ * omitted while a `snapshot` is present, the plugin still shows role/status
314
+ * badges from the snapshot, just without severity findings.
315
+ */
316
+ report?: ComplianceReport;
317
+ }
318
+ /**
319
+ * A document the previewer can render itself: any object with these two methods,
320
+ * which `@bonniepdf/core`'s `Document` has. Checked by shape, not by class, so
321
+ * the previewer works with whichever copy of core the host bundles.
322
+ */
323
+ export interface PreviewableDocument {
324
+ generateSvgDocumentAsync(options?: {
325
+ captureLayout?: boolean;
326
+ }): Promise<PreviewExport>;
327
+ generateBytesAsync(): Promise<Uint8Array>;
328
+ readonly metadata?: {
329
+ readonly title?: string;
330
+ };
331
+ }
332
+ /**
333
+ * A rendered document produced anywhere, in either language: the value of
334
+ * `@bonniepdf/core`'s `generateSvgDocumentAsync()`, or the JSON a .NET server
335
+ * returns from `SvgDocumentExport.ToJson()`, parsed. Page sizes are read from
336
+ * each page's root `<svg>`.
337
+ */
338
+ export interface PreviewExport {
339
+ /** Export format version. Absent in exports from releases before it existed. */
340
+ version?: number;
341
+ /** One `<svg>` document per page, in page order. */
342
+ pages: readonly string[];
343
+ /** `@font-face` CSS for the embedded fonts, injected once for every page. */
344
+ fontFaceCss?: string;
345
+ /** The layout snapshot, present when the export captured layout. */
346
+ snapshot?: LayoutSnapshot;
347
+ /** The compliance report for {@link snapshot}. */
348
+ report?: ComplianceReport;
349
+ }
350
+ /** What {@link PreviewerHandle.load} accepts: a document, an export, or a promise of either. */
351
+ export type PreviewSource = PreviewableDocument | PreviewExport | PromiseLike<PreviewableDocument | PreviewExport>;
352
+ /**
353
+ * The PDF behind the download button: a URL, the bytes, or a function producing
354
+ * either, called on the first click only. When the previewer turns bytes into
355
+ * an object URL, it owns that URL and revokes it on the next load or on dispose.
356
+ */
357
+ export type PdfSource = string | Blob | Uint8Array | (() => string | Blob | Uint8Array | PromiseLike<string | Blob | Uint8Array>);
358
+ /** Per-load overrides for {@link PreviewerHandle.load}. */
359
+ export interface PreviewLoadOptions {
360
+ /**
361
+ * The download filename. Defaults to the document's title as a slug
362
+ * (`Quarterly Report` → `quarterly-report.pdf`), then to the previewer's
363
+ * `downloadFilename`.
364
+ */
365
+ downloadFilename?: string;
366
+ /**
367
+ * The PDF for the download button. A loaded document supplies its own
368
+ * (generated on the first click), so this is needed only for an export.
369
+ * Without a PDF the download button is hidden.
370
+ */
371
+ pdf?: PdfSource;
372
+ }
373
+ /** Controls a created previewer instance. Returned by `createPreviewer`. */
374
+ export interface PreviewerHandle {
375
+ /**
376
+ * Shows a document. Pass a `@bonniepdf/core` `Document`, and the previewer
377
+ * renders it, captures layout when an inspector needs it, and generates the
378
+ * PDF only if the user downloads. Pass an export (`generateSvgDocumentAsync()`'s
379
+ * result, or .NET's `ToJson()` parsed) when the document was generated
380
+ * elsewhere. A promise of either shows the loading state until it settles.
381
+ *
382
+ * Resolves once the document is shown, or when a newer `load()` supersedes
383
+ * this one. Rejects if rendering fails; the viewer then shows an error state
384
+ * and dispatches a `bpp-load-error` event from the host element.
385
+ */
386
+ load(source: PreviewSource, options?: PreviewLoadOptions): Promise<void>;
387
+ /**
388
+ * Replaces the previewed document with the given pages.
389
+ * @deprecated Pass the document or its export: `load(doc)` or `load(svgExport)`.
390
+ */
391
+ load(pages: PreviewPage[], options?: LoadOptions): void;
392
+ /** Selects and reveals a layout-snapshot node. */
393
+ selectSnapshotNode(nodeId: string): boolean;
394
+ /** Clears rendered pages and resets to the loading state without removing injected fonts. */
395
+ clear(): void;
396
+ /** Disconnects observers and listeners. Safe to call more than once. */
397
+ dispose(): void;
398
+ }
399
+ /**
400
+ * Convenience adapter: turn the raw `string[]` returned by `exportSvgPagesAsync`
401
+ * into {@link PreviewPage}s by reading each SVG's intrinsic dimensions.
402
+ * @deprecated `load()` accepts the export directly: `load(svgExport)`.
403
+ */
404
+ export declare function svgStringsToPages(svgs: readonly string[]): PreviewPage[];
405
+ /** Internal: {@link PreviewPage}s from page SVGs, sized from each root `<svg>`. */
406
+ export declare function readPreviewPages(svgs: readonly string[]): PreviewPage[];
@@ -0,0 +1,16 @@
1
+ /** A running windowed mounter; `disconnect()` stops further mount/unmount. */
2
+ export interface LazyMounter {
3
+ disconnect(): void;
4
+ }
5
+ /**
6
+ * Windowed lazy mount/unmount of SVG items inside a scroll container: each item's
7
+ * markup is injected only while it is near the viewport and emptied once it
8
+ * scrolls away, so only a handful of (potentially huge) page/thumbnail SVGs are
9
+ * ever live in the DOM. The namespaced markup for each index is memoised, so
10
+ * re-entering the viewport never re-runs the id-rewriting regexes over the same
11
+ * string. Falls back to mounting everything when there's no `IntersectionObserver`.
12
+ *
13
+ * Placeholders keep their own box (sized by the caller), so scroll position stays
14
+ * stable as content comes and goes.
15
+ */
16
+ export declare function observeLazyMount(items: HTMLElement[], svgFor: (index: number) => string, prefixFor: (index: number) => string, scrollRoot: HTMLElement | null, rootMargin: string): LazyMounter;
@@ -0,0 +1,16 @@
1
+ /** A running windowed mounter; `disconnect()` stops further mount/unmount. */
2
+ export interface LazyMounter {
3
+ disconnect(): void;
4
+ }
5
+ /**
6
+ * Windowed lazy mount/unmount of SVG items inside a scroll container: each item's
7
+ * markup is injected only while it is near the viewport and emptied once it
8
+ * scrolls away, so only a handful of (potentially huge) page/thumbnail SVGs are
9
+ * ever live in the DOM. The namespaced markup for each index is memoised, so
10
+ * re-entering the viewport never re-runs the id-rewriting regexes over the same
11
+ * string. Falls back to mounting everything when there's no `IntersectionObserver`.
12
+ *
13
+ * Placeholders keep their own box (sized by the caller), so scroll position stays
14
+ * stable as content comes and goes.
15
+ */
16
+ export declare function observeLazyMount(items: HTMLElement[], svgFor: (index: number) => string, prefixFor: (index: number) => string, scrollRoot: HTMLElement | null, rootMargin: string): LazyMounter;
package/package.json CHANGED
@@ -1,6 +1,92 @@
1
1
  {
2
2
  "name": "@bonniepdf/previewer",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2026.11.21",
4
+ "description": "Framework-agnostic PDF preview component for BonniePDF — renders the SVG pages from @bonniepdf/core as a paginated, zoomable viewer with thumbnails. Ships as a Shadow-DOM web component, fully isolated from host-page CSS.",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "author": "CodeFocus Limited",
8
+ "sideEffects": [
9
+ "./dist/element.js",
10
+ "./dist/element.cjs",
11
+ "./src/element.ts"
12
+ ],
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "require": {
23
+ "types": "./dist/index.d.cts",
24
+ "default": "./dist/index.cjs"
25
+ }
26
+ },
27
+ "./element": {
28
+ "import": {
29
+ "types": "./dist/element.d.ts",
30
+ "default": "./dist/element.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/element.d.cts",
34
+ "default": "./dist/element.cjs"
35
+ }
36
+ }
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "LICENSE"
41
+ ],
42
+ "keywords": [
43
+ "pdf",
44
+ "pdf-viewer",
45
+ "pdf-preview",
46
+ "preview",
47
+ "viewer",
48
+ "svg",
49
+ "web-component",
50
+ "custom-element",
51
+ "pdf-ua",
52
+ "accessibility",
53
+ "wcag",
54
+ "typescript",
55
+ "javascript",
56
+ "bonniepdf"
57
+ ],
58
+ "homepage": "https://www.bonniepdf.dev/features/typescript/previewer",
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "https://github.com/bonniepdf/BonniePDF-Previewer"
62
+ },
63
+ "bugs": {
64
+ "url": "https://github.com/bonniepdf/BonniePDF-Previewer/issues"
65
+ },
66
+ "peerDependencies": {
67
+ "@bonniepdf/core": ">=2026.7.2"
68
+ },
69
+ "peerDependenciesMeta": {
70
+ "@bonniepdf/core": {
71
+ "optional": true
72
+ }
73
+ },
74
+ "devDependencies": {
75
+ "jsdom": "30.0.1",
76
+ "tsup": "^8.5.1",
77
+ "typescript": "7.0.2",
78
+ "vitest": "^4.1.11",
79
+ "@bonniepdf/core": "2026.11.21"
80
+ },
81
+ "publishConfig": {
82
+ "access": "public"
83
+ },
84
+ "scripts": {
85
+ "build": "tsup && tsc --noEmit false --emitDeclarationOnly --outDir dist && node scripts/fix-dts-extensions.mjs dist && node scripts/emit-cjs-declarations.mjs dist",
86
+ "check:consumer-types": "tsc -p scripts/consumer-types/tsconfig.json",
87
+ "dev": "tsup --watch",
88
+ "typecheck": "tsc --noEmit",
89
+ "clean": "node --input-type=module -e \"import { rmSync } from 'fs'; rmSync('dist', { recursive: true, force: true });\"",
90
+ "test": "vitest run"
91
+ }
6
92
  }