@mkabatek/pptx-viewer 1.5.3 → 1.5.5

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 (44) hide show
  1. package/README.md +13 -9
  2. package/package.json +2 -9
  3. package/node_modules/emf-converter/LICENSE +0 -21
  4. package/node_modules/emf-converter/README.md +0 -629
  5. package/node_modules/emf-converter/dist/index.d.mts +0 -86
  6. package/node_modules/emf-converter/dist/index.d.ts +0 -86
  7. package/node_modules/emf-converter/dist/index.js +0 -4257
  8. package/node_modules/emf-converter/dist/index.mjs +0 -4253
  9. package/node_modules/emf-converter/package.json +0 -53
  10. package/node_modules/mtx-decompressor/LICENSE +0 -373
  11. package/node_modules/mtx-decompressor/README.md +0 -271
  12. package/node_modules/mtx-decompressor/dist/index.d.mts +0 -84
  13. package/node_modules/mtx-decompressor/dist/index.d.ts +0 -84
  14. package/node_modules/mtx-decompressor/dist/index.js +0 -1532
  15. package/node_modules/mtx-decompressor/dist/index.mjs +0 -1528
  16. package/node_modules/mtx-decompressor/package.json +0 -44
  17. package/node_modules/pptx-viewer-core/LICENSE +0 -21
  18. package/node_modules/pptx-viewer-core/NOTICE +0 -16
  19. package/node_modules/pptx-viewer-core/README.md +0 -1294
  20. package/node_modules/pptx-viewer-core/dist/SvgExporter-BtZczTlB.d.ts +0 -557
  21. package/node_modules/pptx-viewer-core/dist/SvgExporter-D4mBWJHE.d.mts +0 -557
  22. package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +0 -150
  23. package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +0 -150
  24. package/node_modules/pptx-viewer-core/dist/cli/index.js +0 -0
  25. package/node_modules/pptx-viewer-core/dist/cli/index.mjs +0 -0
  26. package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +0 -48
  27. package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +0 -48
  28. package/node_modules/pptx-viewer-core/dist/converter/index.js +0 -0
  29. package/node_modules/pptx-viewer-core/dist/converter/index.mjs +0 -0
  30. package/node_modules/pptx-viewer-core/dist/index.d.mts +0 -12744
  31. package/node_modules/pptx-viewer-core/dist/index.d.ts +0 -12744
  32. package/node_modules/pptx-viewer-core/dist/index.js +0 -66894
  33. package/node_modules/pptx-viewer-core/dist/index.mjs +0 -66420
  34. package/node_modules/pptx-viewer-core/dist/presentation-nZxgWvXq.d.mts +0 -5645
  35. package/node_modules/pptx-viewer-core/dist/presentation-nZxgWvXq.d.ts +0 -5645
  36. package/node_modules/pptx-viewer-core/dist/signature-inspection-status-BCUpfCQh.d.mts +0 -220
  37. package/node_modules/pptx-viewer-core/dist/signature-inspection-status-BCUpfCQh.d.ts +0 -220
  38. package/node_modules/pptx-viewer-core/dist/signature-node/index.d.mts +0 -177
  39. package/node_modules/pptx-viewer-core/dist/signature-node/index.d.ts +0 -177
  40. package/node_modules/pptx-viewer-core/dist/signature-node/index.js +0 -1206
  41. package/node_modules/pptx-viewer-core/dist/signature-node/index.mjs +0 -1143
  42. package/node_modules/pptx-viewer-core/dist/text-operations-DCTGMltY.d.mts +0 -134
  43. package/node_modules/pptx-viewer-core/dist/text-operations-DYmhoi7U.d.ts +0 -134
  44. package/node_modules/pptx-viewer-core/package.json +0 -96
@@ -1,557 +0,0 @@
1
- import { m as PptxData, P as PptxElement, N as TextSegment, l as PptxSlide } from './presentation-nZxgWvXq.js';
2
-
3
- /**
4
- * Platform adapter for file system operations.
5
- *
6
- * Consumers must provide an implementation of this interface
7
- * when using the converter with file output (writing markdown
8
- * and extracting media to disk).
9
- *
10
- * For in-memory-only conversion (just getting the markdown string),
11
- * no adapter is required.
12
- */
13
- interface FileSystemAdapter {
14
- /**
15
- * Writes a UTF-8 text file at the given path, creating or overwriting as needed.
16
- * @param path - Absolute or relative path for the output file.
17
- * @param content - Text content to write.
18
- */
19
- writeFile(path: string, content: string): Promise<void>;
20
- /**
21
- * Writes a binary file (e.g. an extracted image) at the given path.
22
- * @param path - Absolute or relative path for the output file.
23
- * @param data - Raw binary content as a typed array.
24
- */
25
- writeBinaryFile(path: string, data: Uint8Array): Promise<void>;
26
- /**
27
- * Creates a directory (and any missing parents) at the given path.
28
- * Should be a no-op if the directory already exists.
29
- * @param path - Absolute or relative path for the directory.
30
- */
31
- createFolder(path: string): Promise<void>;
32
- }
33
- /**
34
- * Options shared by all document converters, controlling output paths,
35
- * media extraction folder names, and metadata inclusion.
36
- */
37
- interface ConversionOptions {
38
- /** Optional file path to write the generated markdown. When omitted, only the string is returned. */
39
- outputPath?: string;
40
- /** Name of the sub-folder (relative to outputDir) where extracted media will be stored. */
41
- mediaFolderName: string;
42
- /** When true, a YAML front-matter block with document metadata is prepended to the output. */
43
- includeMetadata: boolean;
44
- }
45
- /**
46
- * Summary of a completed conversion, including statistics about
47
- * the generated output and extracted media.
48
- */
49
- interface ConversionResult {
50
- /** Whether the conversion completed without errors. */
51
- success: boolean;
52
- /** Path where the markdown output was written. */
53
- outputPath: string;
54
- /** Character length of the generated markdown string. */
55
- markdownLength: number;
56
- /** Number of images extracted and saved to the media folder. */
57
- imagesExtracted: number;
58
- /** Absolute path to the media folder, or null if no images were extracted. */
59
- mediaFolder: string | null;
60
- /** Allows additional converter-specific metadata fields. */
61
- [key: string]: unknown;
62
- }
63
-
64
- /**
65
- * Parses a Base64-encoded `data:` URL and returns the decoded binary
66
- * content along with a suitable file extension.
67
- *
68
- * @param dataUrl - A complete `data:` URL in the form `data:<mime>;base64,<payload>`.
69
- * @returns An object with `bytes` (the decoded binary data) and `ext` (the file extension).
70
- * @throws Error if the data URL does not match the expected `data:<mime>;base64,<payload>` format.
71
- *
72
- * @example
73
- * ```ts
74
- * const { bytes, ext } = dataUrlToMediaBytes('data:image/png;base64,iVBOR...');
75
- * // bytes: Uint8Array of PNG data
76
- * // ext: 'png'
77
- * ```
78
- */
79
- declare function dataUrlToMediaBytes(dataUrl: string): {
80
- bytes: Uint8Array;
81
- ext: string;
82
- };
83
- /**
84
- * Generates a deterministic, zero-padded filename for an extracted image.
85
- *
86
- * @param index - The 1-based ordinal of the image within the conversion session.
87
- * @param ext - File extension (with or without leading dot).
88
- * @returns A filename like `"image-001.png"`.
89
- *
90
- * @example
91
- * ```ts
92
- * generateMediaFilename(7, 'jpg'); // "image-007.jpg"
93
- * ```
94
- */
95
- declare function generateMediaFilename(index: number, ext: string): string;
96
- /**
97
- * Manages the extraction and persistence of media files (images) during
98
- * a PPTX-to-Markdown conversion session.
99
- *
100
- * Each `MediaContext` tracks a running count of saved images and ensures
101
- * the target media directory is lazily created on first write. When no
102
- * {@link FileSystemAdapter} is provided, filenames are still generated
103
- * (for in-memory usage) but nothing is written to disk.
104
- */
105
- declare class MediaContext {
106
- private readonly folderName;
107
- private readonly fs?;
108
- /** Running counter used to assign unique sequential filenames. */
109
- private imageIndex;
110
- /** Whether the media output directory has been created yet. */
111
- private initialized;
112
- /** Fully resolved path to the media output directory. */
113
- private readonly resolvedMediaDir;
114
- /**
115
- * @param outputDir - Root output directory for the conversion.
116
- * @param folderName - Sub-folder name for media files (e.g. `"media"`).
117
- * @param fs - Optional file system adapter; omit for in-memory-only conversion.
118
- */
119
- constructor(outputDir: string, folderName: string, fs?: FileSystemAdapter | undefined);
120
- /** Returns the total number of images saved so far in this session. */
121
- get totalImages(): number;
122
- /** Returns the absolute path to the media output directory. */
123
- get mediaDir(): string;
124
- /**
125
- * Decodes a Base64 `data:` URL, saves the image to disk (if a FS adapter
126
- * is available), and returns a relative path suitable for embedding in markdown.
127
- *
128
- * @param dataUrl - The Base64-encoded data URL of the image.
129
- * @param prefix - Optional filename prefix (e.g. `"slide3"`) for disambiguation.
130
- * @returns A relative path like `"./media/slide3-image-001.png"`.
131
- * @throws Error if the data URL is malformed.
132
- */
133
- saveImage(dataUrl: string, prefix?: string): Promise<string>;
134
- /**
135
- * Saves raw image bytes to disk and returns a relative path for markdown embedding.
136
- *
137
- * @param bytes - Raw binary content of the image.
138
- * @param ext - File extension (e.g. `"png"`, `"jpg"`).
139
- * @param prefix - Optional filename prefix for disambiguation.
140
- * @returns A relative path like `"./media/image-001.png"`.
141
- */
142
- saveImageBytes(bytes: Uint8Array, ext: string, prefix?: string): Promise<string>;
143
- /**
144
- * Lazily creates the media output directory on the first call.
145
- * Subsequent calls are no-ops.
146
- */
147
- private ensureInitialized;
148
- }
149
-
150
- /**
151
- * Normalises a file path by trimming whitespace and converting
152
- * backslashes to forward slashes for cross-platform consistency.
153
- *
154
- * @param pathValue - The raw file path string.
155
- * @returns The normalised path with forward slashes.
156
- *
157
- * @example
158
- * ```ts
159
- * normalizePath(' C:\\Users\\docs\\file.md ');
160
- * // "C:/Users/docs/file.md"
161
- * ```
162
- */
163
- declare function normalizePath(pathValue: string): string;
164
- /**
165
- * Extracts the directory portion of a file path (everything before the
166
- * last `/` separator).
167
- *
168
- * @param filePath - A file path (backslashes are normalised automatically).
169
- * @returns The parent directory, `"."` if there is no separator, or `"/"` for root paths.
170
- *
171
- * @example
172
- * ```ts
173
- * getDirectory('/home/user/doc.md'); // "/home/user"
174
- * getDirectory('file.txt'); // "."
175
- * ```
176
- */
177
- declare function getDirectory(filePath: string): string;
178
- /**
179
- * Derives a `.md` output path from a source file path when no explicit
180
- * output path has been provided. Simply replaces the source extension
181
- * with `.md`.
182
- *
183
- * @param sourcePath - Original source file path (e.g. `"presentation.pptx"`).
184
- * @param explicitPath - An explicit output path; if provided, it is returned as-is.
185
- * @returns The derived markdown path, the explicit path, or `undefined` if both inputs are absent.
186
- *
187
- * @example
188
- * ```ts
189
- * deriveOutputPath('slides.pptx', undefined); // "slides.md"
190
- * deriveOutputPath('slides.pptx', '/tmp/out.md'); // "/tmp/out.md"
191
- * ```
192
- */
193
- declare function deriveOutputPath(sourcePath: string | undefined, explicitPath: string | undefined): string | undefined;
194
- /**
195
- * Abstract base class for document-to-Markdown converters.
196
- *
197
- * Provides shared infrastructure for media extraction ({@link MediaContext}),
198
- * YAML front-matter generation, and file output. Concrete subclasses implement
199
- * the {@link convert} method to handle a specific document type.
200
- *
201
- * @typeParam TSource - The parsed document data structure that this converter consumes.
202
- */
203
- declare abstract class DocumentConverter<TSource> {
204
- protected readonly outputDir: string;
205
- protected readonly options: ConversionOptions;
206
- protected readonly fs?: FileSystemAdapter | undefined;
207
- /** Shared context for extracting and saving media (images) during conversion. */
208
- protected readonly mediaContext: MediaContext;
209
- /**
210
- * @param outputDir - Root directory for all output files (markdown + media).
211
- * @param options - Conversion options (output path, media folder name, metadata flag).
212
- * @param fs - Optional file system adapter for writing files to disk.
213
- */
214
- protected constructor(outputDir: string, options: ConversionOptions, fs?: FileSystemAdapter | undefined);
215
- /**
216
- * Converts the given source document into a Markdown string.
217
- *
218
- * @param source - The parsed document data to convert.
219
- * @returns The generated Markdown content.
220
- */
221
- abstract convert(source: TSource): Promise<string>;
222
- /**
223
- * Builds a YAML front-matter block from a key-value metadata dictionary.
224
- * String values are quoted; numeric values are emitted bare.
225
- *
226
- * @param metadata - Key-value pairs to include in the front matter.
227
- * @returns A complete front-matter string (including `---` delimiters and trailing blank lines).
228
- */
229
- protected buildFrontMatter(metadata: Record<string, string | number>): string;
230
- /**
231
- * Writes the generated markdown content to an output file using the
232
- * configured {@link FileSystemAdapter}.
233
- *
234
- * @param content - The markdown string to write.
235
- * @param outputPath - Destination file path.
236
- * @throws Error if no `FileSystemAdapter` was provided at construction time.
237
- */
238
- protected writeOutput(content: string, outputPath: string): Promise<void>;
239
- }
240
-
241
- /**
242
- * Options specific to PPTX-to-Markdown conversion, extending the base
243
- * {@link ConversionOptions} with presentation-aware settings.
244
- */
245
- interface PptxConverterOptions extends ConversionOptions {
246
- /** Human-readable name of the source file, used in front-matter metadata. */
247
- sourceName: string;
248
- /** Whether to append speaker notes (as blockquotes) below each slide. */
249
- includeSpeakerNotes: boolean;
250
- /**
251
- * Optional 1-based slide range to limit conversion to a subset of the deck.
252
- * Omit or leave fields undefined to convert all slides.
253
- */
254
- slideRange?: {
255
- /** First slide to include (1-based, default 1). */
256
- start?: number;
257
- /** Last slide to include (1-based, default = last slide). */
258
- end?: number;
259
- };
260
- /**
261
- * When true, emit clean semantic markdown instead of CSS-positioned HTML.
262
- * Default is false (positioned HTML layout for slide fidelity).
263
- */
264
- semanticMode?: boolean;
265
- }
266
- /**
267
- * Converts a parsed {@link PptxData} presentation into a Markdown document.
268
- *
269
- * This is the primary entry point for PPTX-to-Markdown conversion. It
270
- * orchestrates slide processing, media extraction, metadata generation,
271
- * and output assembly. Each slide element type is handled by a dedicated
272
- * {@link ElementProcessor} registered in the internal registry.
273
- *
274
- * @example
275
- * ```ts
276
- * const converter = new PptxMarkdownConverter('/output', {
277
- * sourceName: 'deck.pptx',
278
- * includeSpeakerNotes: true,
279
- * mediaFolderName: 'media',
280
- * includeMetadata: true,
281
- * });
282
- * const markdown = await converter.convert(pptxData);
283
- * ```
284
- */
285
- declare class PptxMarkdownConverter extends DocumentConverter<PptxData> {
286
- /** Renderer for rich-text segments (bold, italic, hyperlinks, etc.). */
287
- private readonly textRenderer;
288
- /** Registry mapping element types to their dedicated processors. */
289
- private readonly registry;
290
- /** Delegate responsible for converting individual slides. */
291
- private readonly slideProcessor;
292
- /** Number of slides actually converted (after applying the slide range filter). */
293
- private convertedSlides;
294
- /** Total number of slides in the source presentation. */
295
- private totalSlides;
296
- /**
297
- * @param outputDir - Root directory for output files.
298
- * @param options - PPTX-specific conversion options.
299
- * @param fs - Optional file system adapter for writing media to disk.
300
- */
301
- constructor(outputDir: string, options: PptxConverterOptions, fs?: FileSystemAdapter);
302
- /** Returns the number of images extracted and saved during conversion. */
303
- get imagesExtracted(): number;
304
- /** Returns the media directory path, or `null` if no images were extracted. */
305
- get mediaDir(): string | null;
306
- /** Returns the number of slides that were actually converted. */
307
- get slidesConverted(): number;
308
- /** Returns the total number of slides in the source presentation. */
309
- get presentationSlides(): number;
310
- /**
311
- * Converts the full PPTX presentation (or a slide subset) into Markdown.
312
- *
313
- * The conversion pipeline:
314
- * 1. Resolves the slide range and selects the target slides.
315
- * 2. Processes each slide through {@link SlideProcessor}, producing markdown sections.
316
- * 3. Inserts section headings when slides belong to named sections.
317
- * 4. Optionally prepends YAML front-matter with document metadata.
318
- * 5. Appends header/footer information if present.
319
- * 6. Writes the output file if an `outputPath` was configured.
320
- *
321
- * @param source - The parsed PPTX data structure.
322
- * @returns The complete Markdown string.
323
- */
324
- convert(source: PptxData): Promise<string>;
325
- /**
326
- * Registers all element-type processors into the internal registry.
327
- * Each processor handles one or more {@link PptxElement} types
328
- * (text, image, table, chart, etc.).
329
- */
330
- private registerProcessors;
331
- /**
332
- * Assembles a YAML front-matter block containing presentation metadata
333
- * such as title, author, slide count, theme, dimensions, and more.
334
- *
335
- * @param source - The parsed PPTX data.
336
- * @returns A YAML front-matter string (including `---` delimiters).
337
- */
338
- private buildPptxFrontMatter;
339
- /**
340
- * Populates metadata entries from OPC core properties (title, author, subject, etc.).
341
- *
342
- * @param meta - The metadata dictionary to populate.
343
- * @param props - Core document properties from the PPTX file.
344
- */
345
- private addCoreProperties;
346
- /**
347
- * Populates metadata entries from application-level properties
348
- * (application name, editing time, word/paragraph counts).
349
- *
350
- * @param meta - The metadata dictionary to populate.
351
- * @param props - Application properties from the PPTX file.
352
- */
353
- private addAppProperties;
354
- /**
355
- * Adds presentation-level metadata (custom properties, show type, theme,
356
- * security warnings, embedded fonts, custom shows) to the front-matter dictionary.
357
- *
358
- * @param meta - The metadata dictionary to populate.
359
- * @param source - The full parsed PPTX data.
360
- */
361
- private addPresentationMeta;
362
- /**
363
- * Renders the presentation-level header/footer settings (header text,
364
- * footer text, date/time, slide numbers) into a pipe-delimited markdown string.
365
- *
366
- * @param hf - Header/footer configuration from the presentation.
367
- * @returns A formatted string, or an empty string if no header/footer data is present.
368
- */
369
- private renderHeaderFooter;
370
- /**
371
- * Resolves and clamps the user-specified slide range to valid bounds.
372
- * Defaults to the full deck if no range is configured.
373
- *
374
- * @param totalSlides - Total number of slides in the presentation.
375
- * @returns A 1-based `{ start, end }` range guaranteed to be within bounds.
376
- */
377
- private resolveRange;
378
- /** Casts the base `options` to the PPTX-specific options type. */
379
- private getOptions;
380
- }
381
-
382
- interface ElementProcessorContext {
383
- mediaContext: MediaContext;
384
- slideNumber: number;
385
- /** Slide canvas width in CSS pixels (for layout positioning). */
386
- slideWidth: number;
387
- /** Slide canvas height in CSS pixels (for layout positioning). */
388
- slideHeight: number;
389
- /** Scale factor applied to the layout container (for font/image sizing). */
390
- layoutScale?: number;
391
- /**
392
- * When true, processors should emit clean markdown instead of HTML.
393
- * Tables become markdown tables, images use `![alt](path)` syntax,
394
- * and text uses markdown formatting (not `<strong>`, `<em>`, etc.).
395
- */
396
- semanticMode?: boolean;
397
- processElements: (elements: PptxElement[]) => Promise<string[]>;
398
- }
399
- interface ElementProcessor {
400
- readonly supportedTypes: ReadonlyArray<PptxElement['type']>;
401
- process(element: PptxElement, ctx: ElementProcessorContext): Promise<string | null>;
402
- }
403
- declare class ElementProcessorRegistry {
404
- private readonly processors;
405
- register(processor: ElementProcessor): void;
406
- getProcessor(type: PptxElement['type']): ElementProcessor | null;
407
- processElement(element: PptxElement, ctx: ElementProcessorContext): Promise<string | null>;
408
- private buildActionAnnotation;
409
- }
410
-
411
- /**
412
- * Options controlling how text segments are rendered.
413
- */
414
- interface TextSegmentRenderOptions {
415
- paragraphIndents?: Array<{
416
- marginLeft?: number;
417
- indent?: number;
418
- }>;
419
- slideNumber?: number;
420
- dateTimeText?: string;
421
- inlineMode?: boolean;
422
- disableLists?: boolean;
423
- disableAlignment?: boolean;
424
- /**
425
- * When true, emit HTML formatting tags instead of Markdown syntax.
426
- */
427
- htmlFormatting?: boolean;
428
- }
429
- declare class TextSegmentRenderer {
430
- private readonly ommlConverter;
431
- render(segments: TextSegment[], options?: TextSegmentRenderOptions): string;
432
- renderInline(segments: TextSegment[], options?: TextSegmentRenderOptions): string;
433
- plainText(segments: TextSegment[], options?: TextSegmentRenderOptions): string;
434
- private groupParagraphs;
435
- private renderParagraph;
436
- private renderSegment;
437
- private resolvePlainSegmentText;
438
- private resolveFieldSegment;
439
- private wrapCode;
440
- private renderLinkDestination;
441
- private escapeLinkTitle;
442
- private escapeMarkdown;
443
- private escapeHtml;
444
- }
445
-
446
- /**
447
- * Options controlling how a single slide is processed into Markdown.
448
- */
449
- interface SlideProcessorOptions {
450
- /** Whether to include speaker notes below the slide content. */
451
- includeSpeakerNotes: boolean;
452
- /** Slide canvas width in CSS pixels (used for layout positioning). */
453
- slideWidth: number;
454
- /** Slide canvas height in CSS pixels (used for layout positioning). */
455
- slideHeight: number;
456
- /** When true, emit clean semantic markdown instead of positioned HTML. */
457
- semanticMode?: boolean;
458
- }
459
- /**
460
- * Converts a single {@link PptxSlide} into a Markdown section.
461
- */
462
- declare class SlideProcessor {
463
- private readonly registry;
464
- private readonly mediaContext;
465
- private readonly textRenderer;
466
- /** Delegate for rendering slide-level metadata sections. */
467
- private readonly metadataRenderer;
468
- /**
469
- * @param registry - Registry of element-type processors.
470
- * @param mediaContext - Shared media extraction context.
471
- * @param textRenderer - Renderer for rich-text segments.
472
- */
473
- constructor(registry: ElementProcessorRegistry, mediaContext: MediaContext, textRenderer: TextSegmentRenderer);
474
- /** Processes a slide into a complete Markdown section. */
475
- processSlide(slide: PptxSlide, options: SlideProcessorOptions): Promise<string>;
476
- /**
477
- * Builds the Markdown heading line for a slide, including its number,
478
- * detected title text, and flags (hidden, layout name).
479
- */
480
- private buildHeading;
481
- /**
482
- * Returns an HTML `<img>` for the slide background that can be
483
- * placed as the bottom-most layer inside the positioned container.
484
- */
485
- private renderBackgroundHtml;
486
- /** Detects the slide's title from placeholder or first text element. */
487
- private detectTitle;
488
- /**
489
- * Extracts the placeholder type from an element, if present.
490
- */
491
- private getPlaceholderType;
492
- /** Processes elements as clean semantic markdown. */
493
- private processElementsSemantic;
494
- /** Processes elements using CSS absolute positioning. */
495
- private processElementsWithLayout;
496
- /** Sorts elements into natural reading order (top-to-bottom, left-to-right). */
497
- private sortElementsByReadingOrder;
498
- }
499
-
500
- /**
501
- * Headless SVG exporter — converts parsed {@link PptxSlide} data to
502
- * SVG XML strings without requiring a browser DOM.
503
- *
504
- * All output is generated via string concatenation so the exporter
505
- * works in any JavaScript runtime (Node, Bun, Deno, Workers, etc.).
506
- *
507
- * @module converter/SvgExporter
508
- */
509
-
510
- /**
511
- * Options controlling SVG export behaviour.
512
- */
513
- interface SvgExportOptions {
514
- /** Include hidden slides when exporting all. Default `false`. */
515
- includeHidden?: boolean;
516
- /** Slide indices to export (0-based). If omitted, all slides are exported. */
517
- slideIndices?: number[];
518
- /** Default font family when the element does not specify one. */
519
- defaultFontFamily?: string;
520
- /** Default font size in points when the element does not specify one. */
521
- defaultFontSize?: number;
522
- }
523
- /**
524
- * Pure-TypeScript SVG exporter for parsed PPTX data.
525
- *
526
- * Generates well-formed SVG XML strings without any DOM dependency.
527
- *
528
- * @example
529
- * ```ts
530
- * const svgs = SvgExporter.exportAll(pptxData);
531
- * for (const [i, svg] of svgs.entries()) {
532
- * fs.writeFileSync(`slide_${i + 1}.svg`, svg);
533
- * }
534
- * ```
535
- */
536
- declare class SvgExporter {
537
- /**
538
- * Export a single slide to an SVG XML string.
539
- *
540
- * @param slide - The parsed slide.
541
- * @param width - SVG viewport width (pixels).
542
- * @param height - SVG viewport height (pixels).
543
- * @param options - Optional export settings.
544
- * @returns A complete SVG document as a string.
545
- */
546
- static exportSlide(slide: PptxSlide, width: number, height: number, options?: SvgExportOptions): string;
547
- /**
548
- * Export all (or selected) slides to SVG XML strings.
549
- *
550
- * @param data - The fully parsed PPTX data.
551
- * @param options - Optional export settings.
552
- * @returns An array of SVG strings (one per exported slide).
553
- */
554
- static exportAll(data: PptxData, options?: SvgExportOptions): string[];
555
- }
556
-
557
- export { type ConversionOptions as C, DocumentConverter as D, type FileSystemAdapter as F, MediaContext as M, type PptxConverterOptions as P, SlideProcessor as S, TextSegmentRenderer as T, type ConversionResult as a, PptxMarkdownConverter as b, type SlideProcessorOptions as c, type SvgExportOptions as d, SvgExporter as e, dataUrlToMediaBytes as f, deriveOutputPath as g, generateMediaFilename as h, getDirectory as i, normalizePath as n };