ai-pdf-builder 0.1.0

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.

Potentially problematic release.


This version of ai-pdf-builder might be problematic. Click here for more details.

package/dist/index.js ADDED
@@ -0,0 +1,655 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ checkLaTeX: () => checkLaTeX,
34
+ checkPandoc: () => checkPandoc,
35
+ checkSystem: () => checkSystem,
36
+ clearTemplateCache: () => clearTemplateCache,
37
+ formatFileSize: () => formatFileSize,
38
+ generateAgreement: () => generateAgreement,
39
+ generateCapitalIntroAgreement: () => generateCapitalIntroAgreement,
40
+ generateMemo: () => generateMemo,
41
+ generateNDA: () => generateNDA,
42
+ generatePDF: () => generatePDF,
43
+ generateProposal: () => generateProposal,
44
+ generateReport: () => generateReport,
45
+ generateSAFE: () => generateSAFE,
46
+ generateTermsheet: () => generateTermsheet,
47
+ generateWhitepaper: () => generateWhitepaper,
48
+ getTemplate: () => getTemplate,
49
+ getTemplateConfig: () => getTemplateConfig,
50
+ getTemplatePath: () => getTemplatePath,
51
+ getTemplatesDirectory: () => getTemplatesDirectory,
52
+ getTemplatesForDocType: () => getTemplatesForDocType,
53
+ hasTemplate: () => hasTemplate,
54
+ listTemplates: () => listTemplates,
55
+ parseColor: () => parseColor,
56
+ registerTemplate: () => registerTemplate,
57
+ sanitizeContent: () => sanitizeContent,
58
+ unregisterTemplate: () => unregisterTemplate
59
+ });
60
+ module.exports = __toCommonJS(index_exports);
61
+
62
+ // src/generator.ts
63
+ var import_child_process2 = require("child_process");
64
+ var fs3 = __toESM(require("fs"));
65
+ var path3 = __toESM(require("path"));
66
+
67
+ // src/templates.ts
68
+ var fs = __toESM(require("fs"));
69
+ var path = __toESM(require("path"));
70
+ var TEMPLATES_DIR = path.join(__dirname, "..", "templates");
71
+ var BUILT_IN_TEMPLATES = {
72
+ default: {
73
+ name: "default",
74
+ path: path.join(TEMPLATES_DIR, "default.latex"),
75
+ description: "Clean, professional default template with modern styling",
76
+ supportedDocTypes: ["memo", "whitepaper", "report", "proposal", "generic"]
77
+ },
78
+ memo: {
79
+ name: "memo",
80
+ path: path.join(TEMPLATES_DIR, "memo.latex"),
81
+ description: "Business memo template with executive summary styling",
82
+ supportedDocTypes: ["memo", "report", "proposal"]
83
+ },
84
+ agreement: {
85
+ name: "agreement",
86
+ path: path.join(TEMPLATES_DIR, "agreement.latex"),
87
+ description: "Legal agreement template with formal structure",
88
+ supportedDocTypes: ["agreement", "generic"]
89
+ },
90
+ termsheet: {
91
+ name: "termsheet",
92
+ path: path.join(TEMPLATES_DIR, "termsheet.latex"),
93
+ description: "Term sheet template for investment documents",
94
+ supportedDocTypes: ["termsheet", "agreement"]
95
+ }
96
+ };
97
+ var customTemplates = /* @__PURE__ */ new Map();
98
+ var templateCache = /* @__PURE__ */ new Map();
99
+ function getTemplate(name) {
100
+ if (templateCache.has(name)) {
101
+ return templateCache.get(name) || null;
102
+ }
103
+ if (customTemplates.has(name)) {
104
+ const config = customTemplates.get(name);
105
+ return loadTemplateFile(config.path, name);
106
+ }
107
+ if (BUILT_IN_TEMPLATES[name]) {
108
+ return loadTemplateFile(BUILT_IN_TEMPLATES[name].path, name);
109
+ }
110
+ if (fs.existsSync(name)) {
111
+ return loadTemplateFile(name, name);
112
+ }
113
+ return null;
114
+ }
115
+ function getTemplatePath(name) {
116
+ if (customTemplates.has(name)) {
117
+ return customTemplates.get(name).path;
118
+ }
119
+ if (BUILT_IN_TEMPLATES[name]) {
120
+ return BUILT_IN_TEMPLATES[name].path;
121
+ }
122
+ if (fs.existsSync(name)) {
123
+ return name;
124
+ }
125
+ return null;
126
+ }
127
+ function loadTemplateFile(filePath, cacheKey) {
128
+ try {
129
+ if (!fs.existsSync(filePath)) {
130
+ console.warn(`Template file not found: ${filePath}`);
131
+ return null;
132
+ }
133
+ const content = fs.readFileSync(filePath, "utf-8");
134
+ templateCache.set(cacheKey, content);
135
+ return content;
136
+ } catch (error) {
137
+ console.error(`Error loading template ${filePath}:`, error);
138
+ return null;
139
+ }
140
+ }
141
+ function listTemplates() {
142
+ const builtIn = Object.values(BUILT_IN_TEMPLATES);
143
+ const custom = Array.from(customTemplates.values());
144
+ return [...builtIn, ...custom];
145
+ }
146
+ function getTemplateConfig(name) {
147
+ if (customTemplates.has(name)) {
148
+ return customTemplates.get(name) || null;
149
+ }
150
+ if (BUILT_IN_TEMPLATES[name]) {
151
+ return BUILT_IN_TEMPLATES[name];
152
+ }
153
+ return null;
154
+ }
155
+ function registerTemplate(config) {
156
+ if (!fs.existsSync(config.path)) {
157
+ throw new Error(`Template file not found: ${config.path}`);
158
+ }
159
+ const absolutePath = path.resolve(config.path);
160
+ customTemplates.set(config.name, {
161
+ ...config,
162
+ path: absolutePath
163
+ });
164
+ templateCache.delete(config.name);
165
+ }
166
+ function unregisterTemplate(name) {
167
+ if (customTemplates.has(name)) {
168
+ customTemplates.delete(name);
169
+ templateCache.delete(name);
170
+ return true;
171
+ }
172
+ return false;
173
+ }
174
+ function hasTemplate(name) {
175
+ return customTemplates.has(name) || BUILT_IN_TEMPLATES.hasOwnProperty(name) || fs.existsSync(name);
176
+ }
177
+ function getTemplatesForDocType(docType) {
178
+ const all = listTemplates();
179
+ return all.filter((t) => t.supportedDocTypes.includes(docType));
180
+ }
181
+ function clearTemplateCache() {
182
+ templateCache.clear();
183
+ }
184
+ function getTemplatesDirectory() {
185
+ return TEMPLATES_DIR;
186
+ }
187
+
188
+ // src/utils.ts
189
+ var import_child_process = require("child_process");
190
+ var fs2 = __toESM(require("fs"));
191
+ var path2 = __toESM(require("path"));
192
+ var os = __toESM(require("os"));
193
+ function checkPandoc() {
194
+ try {
195
+ const version = (0, import_child_process.execSync)("pandoc --version", { encoding: "utf-8" });
196
+ const versionMatch = version.match(/pandoc\s+([\d.]+)/);
197
+ const pathResult = (0, import_child_process.execSync)("which pandoc", { encoding: "utf-8" }).trim();
198
+ return {
199
+ available: true,
200
+ version: versionMatch ? versionMatch[1] : "unknown",
201
+ path: pathResult
202
+ };
203
+ } catch (error) {
204
+ return {
205
+ available: false,
206
+ error: "Pandoc not found. Install with: brew install pandoc (macOS) or apt-get install pandoc (Linux)"
207
+ };
208
+ }
209
+ }
210
+ function checkLaTeX() {
211
+ try {
212
+ const version = (0, import_child_process.execSync)("pdflatex --version", { encoding: "utf-8" });
213
+ const versionMatch = version.match(/pdfTeX\s+([\d.-]+)/);
214
+ const pathResult = (0, import_child_process.execSync)("which pdflatex", { encoding: "utf-8" }).trim();
215
+ return {
216
+ available: true,
217
+ engine: "pdflatex",
218
+ version: versionMatch ? versionMatch[1] : "unknown",
219
+ path: pathResult
220
+ };
221
+ } catch (error) {
222
+ return {
223
+ available: false,
224
+ error: "pdflatex not found. Install BasicTeX (brew install --cask basictex) or TeX Live"
225
+ };
226
+ }
227
+ }
228
+ function checkSystem() {
229
+ const pandoc = checkPandoc();
230
+ const latex = checkLaTeX();
231
+ const ready = pandoc.available && latex.available;
232
+ let message = "";
233
+ if (ready) {
234
+ message = `Ready: Pandoc ${pandoc.version}, pdfTeX ${latex.version}`;
235
+ } else {
236
+ const missing = [];
237
+ if (!pandoc.available) missing.push("Pandoc");
238
+ if (!latex.available) missing.push("LaTeX/pdflatex");
239
+ message = `Missing dependencies: ${missing.join(", ")}`;
240
+ }
241
+ return { pandoc, latex, ready, message };
242
+ }
243
+ function createTempDir(prefix = "pdf-builder") {
244
+ const tempDir = path2.join(os.tmpdir(), `${prefix}-${Date.now()}`);
245
+ fs2.mkdirSync(tempDir, { recursive: true });
246
+ return tempDir;
247
+ }
248
+ function cleanupTempDir(dirPath) {
249
+ try {
250
+ if (fs2.existsSync(dirPath)) {
251
+ fs2.rmSync(dirPath, { recursive: true, force: true });
252
+ }
253
+ } catch (error) {
254
+ console.warn(`Warning: Could not clean up temp directory: ${dirPath}`);
255
+ }
256
+ }
257
+ function generateYAMLFrontMatter(metadata) {
258
+ const lines = ["---"];
259
+ for (const [key, value] of Object.entries(metadata)) {
260
+ if (value !== void 0 && value !== "") {
261
+ const escapedValue = String(value).replace(/"/g, '\\"');
262
+ lines.push(`${key}: "${escapedValue}"`);
263
+ }
264
+ }
265
+ lines.push("---");
266
+ return lines.join("\n");
267
+ }
268
+ function sanitizeContent(content) {
269
+ const dangerousCommands = [
270
+ "\\input",
271
+ "\\include",
272
+ "\\write18",
273
+ "\\immediate",
274
+ "\\openin",
275
+ "\\openout",
276
+ "\\read",
277
+ "\\write",
278
+ "\\newwrite",
279
+ "\\closeout",
280
+ "\\closein"
281
+ ];
282
+ let sanitized = content;
283
+ for (const cmd of dangerousCommands) {
284
+ const regex = new RegExp(cmd.replace("\\", "\\\\") + "[^\\s{]*({[^}]*})?", "gi");
285
+ sanitized = sanitized.replace(regex, "");
286
+ }
287
+ return sanitized;
288
+ }
289
+ function parseColor(color) {
290
+ if (/^\d+,\s*\d+,\s*\d+$/.test(color)) {
291
+ return color.replace(/\s/g, "");
292
+ }
293
+ const rgbMatch = color.match(/RGB\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i);
294
+ if (rgbMatch) {
295
+ return `${rgbMatch[1]},${rgbMatch[2]},${rgbMatch[3]}`;
296
+ }
297
+ const hexMatch = color.match(/^#?([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/);
298
+ if (hexMatch) {
299
+ const r = parseInt(hexMatch[1], 16);
300
+ const g = parseInt(hexMatch[2], 16);
301
+ const b = parseInt(hexMatch[3], 16);
302
+ return `${r},${g},${b}`;
303
+ }
304
+ return "59,130,246";
305
+ }
306
+ function formatFileSize(bytes) {
307
+ if (bytes < 1024) return `${bytes} B`;
308
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
309
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
310
+ }
311
+
312
+ // src/generator.ts
313
+ var DEFAULT_OPTIONS = {
314
+ toc: true,
315
+ tocDepth: 2,
316
+ numberSections: true,
317
+ fontSize: 11,
318
+ margin: "1in",
319
+ paperSize: "letter",
320
+ timeout: 6e4
321
+ };
322
+ async function generatePDF(options) {
323
+ const startTime = Date.now();
324
+ const opts = { ...DEFAULT_OPTIONS, ...options };
325
+ const sysCheck = checkSystem();
326
+ if (!sysCheck.ready) {
327
+ return {
328
+ success: false,
329
+ error: `System requirements not met: ${sysCheck.message}`
330
+ };
331
+ }
332
+ if (!opts.content || opts.content.trim().length === 0) {
333
+ return {
334
+ success: false,
335
+ error: "Content is required"
336
+ };
337
+ }
338
+ let tempDir = null;
339
+ try {
340
+ tempDir = opts.workDir || createTempDir("pdf-builder");
341
+ const sanitizedContent = sanitizeContent(opts.content);
342
+ const fullMarkdown = buildMarkdownDocument(sanitizedContent, opts);
343
+ const inputPath = path3.join(tempDir, "input.md");
344
+ fs3.writeFileSync(inputPath, fullMarkdown, "utf-8");
345
+ const templatePath = await prepareTemplate(tempDir, opts);
346
+ const outputPath = opts.outputPath || path3.join(tempDir, "output.pdf");
347
+ const pandocOpts = {
348
+ inputPath,
349
+ outputPath,
350
+ templatePath,
351
+ toc: opts.toc ?? true,
352
+ tocDepth: opts.tocDepth ?? 2,
353
+ numberSections: opts.numberSections ?? true,
354
+ fontSize: opts.fontSize ?? 11,
355
+ margin: opts.margin ?? "1in",
356
+ paperSize: opts.paperSize ?? "letter",
357
+ timeout: opts.timeout ?? 6e4
358
+ };
359
+ await executePandoc(pandocOpts);
360
+ if (!fs3.existsSync(outputPath)) {
361
+ return {
362
+ success: false,
363
+ error: "PDF generation failed - output file not created"
364
+ };
365
+ }
366
+ const buffer = fs3.readFileSync(outputPath);
367
+ const stats = fs3.statSync(outputPath);
368
+ const generationTime = Date.now() - startTime;
369
+ const result = {
370
+ success: true,
371
+ buffer: opts.outputPath ? void 0 : buffer,
372
+ path: opts.outputPath || void 0,
373
+ fileSize: stats.size,
374
+ generationTime
375
+ };
376
+ result.pageCount = estimatePageCount(buffer);
377
+ return result;
378
+ } catch (error) {
379
+ const errorMessage = error instanceof Error ? error.message : String(error);
380
+ return {
381
+ success: false,
382
+ error: `PDF generation failed: ${errorMessage}`,
383
+ generationTime: Date.now() - startTime
384
+ };
385
+ } finally {
386
+ if (tempDir && !opts.workDir && !opts.outputPath) {
387
+ } else if (tempDir && !opts.workDir) {
388
+ cleanupTempDir(tempDir);
389
+ }
390
+ }
391
+ }
392
+ function buildMarkdownDocument(content, opts) {
393
+ const parts = [];
394
+ if (opts.metadata) {
395
+ const frontMatter = generateYAMLFrontMatter({
396
+ ...opts.metadata,
397
+ geometry: `margin=${opts.margin || "1in"}`,
398
+ fontsize: `${opts.fontSize || 11}pt`,
399
+ papersize: opts.paperSize || "letter"
400
+ });
401
+ parts.push(frontMatter);
402
+ parts.push("");
403
+ }
404
+ parts.push(content);
405
+ return parts.join("\n");
406
+ }
407
+ async function prepareTemplate(tempDir, opts) {
408
+ const templateName = opts.template || "default";
409
+ let templateContent = getTemplate(templateName);
410
+ if (!templateContent) {
411
+ const templatePath = getTemplatePath(templateName);
412
+ if (templatePath && fs3.existsSync(templatePath)) {
413
+ templateContent = fs3.readFileSync(templatePath, "utf-8");
414
+ } else {
415
+ templateContent = getTemplate("default");
416
+ }
417
+ }
418
+ if (!templateContent) {
419
+ throw new Error(`Template not found: ${templateName}`);
420
+ }
421
+ if (opts.customColors) {
422
+ templateContent = applyColorCustomizations(templateContent, opts.customColors);
423
+ }
424
+ const customTemplatePath = path3.join(tempDir, "template.latex");
425
+ fs3.writeFileSync(customTemplatePath, templateContent, "utf-8");
426
+ return customTemplatePath;
427
+ }
428
+ function applyColorCustomizations(template, colors) {
429
+ let result = template;
430
+ if (colors.primary) {
431
+ const rgb = parseColor(colors.primary);
432
+ result = result.replace(
433
+ /\\definecolor{(?:zeroBlue|primaryColor)}{RGB}{[^}]+}/g,
434
+ `\\definecolor{primaryColor}{RGB}{${rgb}}`
435
+ );
436
+ }
437
+ if (colors.secondary) {
438
+ const rgb = parseColor(colors.secondary);
439
+ result = result.replace(
440
+ /\\definecolor{(?:zeroGray|secondaryColor)}{RGB}{[^}]+}/g,
441
+ `\\definecolor{secondaryColor}{RGB}{${rgb}}`
442
+ );
443
+ }
444
+ if (colors.accent) {
445
+ const rgb = parseColor(colors.accent);
446
+ result = result.replace(
447
+ /\\definecolor{(?:zeroDark|accentColor)}{RGB}{[^}]+}/g,
448
+ `\\definecolor{accentColor}{RGB}{${rgb}}`
449
+ );
450
+ }
451
+ return result;
452
+ }
453
+ function executePandoc(opts) {
454
+ return new Promise((resolve2, reject) => {
455
+ const args = [
456
+ opts.inputPath,
457
+ "-o",
458
+ opts.outputPath,
459
+ "--pdf-engine=pdflatex",
460
+ `-V`,
461
+ `geometry:margin=${opts.margin}`,
462
+ `-V`,
463
+ `fontsize=${opts.fontSize}pt`,
464
+ `-V`,
465
+ `papersize=${opts.paperSize}`,
466
+ `-V`,
467
+ `documentclass=article`,
468
+ `-V`,
469
+ `colorlinks=true`,
470
+ `-V`,
471
+ `linkcolor=blue`,
472
+ `-V`,
473
+ `urlcolor=blue`
474
+ ];
475
+ if (opts.templatePath) {
476
+ args.push(`--template=${opts.templatePath}`);
477
+ }
478
+ if (opts.toc) {
479
+ args.push("--toc");
480
+ args.push(`--toc-depth=${opts.tocDepth}`);
481
+ }
482
+ if (opts.numberSections) {
483
+ args.push("--number-sections");
484
+ }
485
+ const pandoc = (0, import_child_process2.spawn)("pandoc", args, {
486
+ stdio: ["pipe", "pipe", "pipe"]
487
+ });
488
+ let stderr = "";
489
+ pandoc.stderr.on("data", (data) => {
490
+ stderr += data.toString();
491
+ });
492
+ const timeout = setTimeout(() => {
493
+ pandoc.kill("SIGKILL");
494
+ reject(new Error(`Pandoc timed out after ${opts.timeout}ms`));
495
+ }, opts.timeout);
496
+ pandoc.on("close", (code) => {
497
+ clearTimeout(timeout);
498
+ if (code === 0) {
499
+ resolve2();
500
+ } else {
501
+ reject(new Error(`Pandoc failed with code ${code}: ${stderr}`));
502
+ }
503
+ });
504
+ pandoc.on("error", (error) => {
505
+ clearTimeout(timeout);
506
+ reject(new Error(`Failed to execute Pandoc: ${error.message}`));
507
+ });
508
+ });
509
+ }
510
+ function estimatePageCount(buffer) {
511
+ const content = buffer.toString("binary");
512
+ const matches = content.match(/\/Type\s*\/Page[^s]/g);
513
+ return matches ? matches.length : 1;
514
+ }
515
+
516
+ // src/presets.ts
517
+ async function generateMemo(content, metadata, options) {
518
+ return generatePDF({
519
+ content,
520
+ metadata,
521
+ template: "memo",
522
+ toc: false,
523
+ numberSections: true,
524
+ fontSize: 11,
525
+ margin: "1in",
526
+ ...options
527
+ });
528
+ }
529
+ async function generateAgreement(content, metadata, options) {
530
+ return generatePDF({
531
+ content,
532
+ metadata,
533
+ template: "agreement",
534
+ toc: false,
535
+ numberSections: true,
536
+ fontSize: 10,
537
+ margin: "1in",
538
+ ...options
539
+ });
540
+ }
541
+ async function generateTermsheet(content, metadata, options) {
542
+ return generatePDF({
543
+ content,
544
+ metadata,
545
+ template: "termsheet",
546
+ toc: false,
547
+ numberSections: true,
548
+ fontSize: 10,
549
+ margin: "1in",
550
+ ...options
551
+ });
552
+ }
553
+ async function generateWhitepaper(content, metadata, options) {
554
+ return generatePDF({
555
+ content,
556
+ metadata,
557
+ template: "default",
558
+ toc: true,
559
+ tocDepth: 2,
560
+ numberSections: true,
561
+ fontSize: 11,
562
+ margin: "1in",
563
+ ...options
564
+ });
565
+ }
566
+ async function generateReport(content, metadata, options) {
567
+ return generatePDF({
568
+ content,
569
+ metadata,
570
+ template: "default",
571
+ toc: true,
572
+ tocDepth: 2,
573
+ numberSections: true,
574
+ fontSize: 11,
575
+ margin: "1in",
576
+ ...options
577
+ });
578
+ }
579
+ async function generateProposal(content, metadata, options) {
580
+ return generatePDF({
581
+ content,
582
+ metadata,
583
+ template: "default",
584
+ toc: false,
585
+ numberSections: true,
586
+ fontSize: 11,
587
+ margin: "1in",
588
+ ...options
589
+ });
590
+ }
591
+ async function generateCapitalIntroAgreement(content, metadata, options) {
592
+ return generatePDF({
593
+ content,
594
+ metadata,
595
+ template: "agreement",
596
+ toc: false,
597
+ numberSections: true,
598
+ fontSize: 10,
599
+ margin: "1in",
600
+ ...options
601
+ });
602
+ }
603
+ async function generateSAFE(content, metadata, options) {
604
+ return generatePDF({
605
+ content,
606
+ metadata,
607
+ template: "agreement",
608
+ toc: false,
609
+ numberSections: true,
610
+ fontSize: 10,
611
+ margin: "1in",
612
+ ...options
613
+ });
614
+ }
615
+ async function generateNDA(content, metadata, options) {
616
+ return generatePDF({
617
+ content,
618
+ metadata,
619
+ template: "agreement",
620
+ toc: false,
621
+ numberSections: true,
622
+ fontSize: 10,
623
+ margin: "1in",
624
+ ...options
625
+ });
626
+ }
627
+ // Annotate the CommonJS export names for ESM import in node:
628
+ 0 && (module.exports = {
629
+ checkLaTeX,
630
+ checkPandoc,
631
+ checkSystem,
632
+ clearTemplateCache,
633
+ formatFileSize,
634
+ generateAgreement,
635
+ generateCapitalIntroAgreement,
636
+ generateMemo,
637
+ generateNDA,
638
+ generatePDF,
639
+ generateProposal,
640
+ generateReport,
641
+ generateSAFE,
642
+ generateTermsheet,
643
+ generateWhitepaper,
644
+ getTemplate,
645
+ getTemplateConfig,
646
+ getTemplatePath,
647
+ getTemplatesDirectory,
648
+ getTemplatesForDocType,
649
+ hasTemplate,
650
+ listTemplates,
651
+ parseColor,
652
+ registerTemplate,
653
+ sanitizeContent,
654
+ unregisterTemplate
655
+ });