@shad0wz7/nestjs-pdf 2.4.3 → 2.5.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.
@@ -0,0 +1,407 @@
1
+ import { DynamicModule, InjectionToken, ModuleMetadata, OnModuleDestroy, OnModuleInit, OptionalFactoryDependency } from "@nestjs/common";
2
+ import { HandlebarsOptions } from "@gboutte/nestjs-hbs/dist/handlebars-options.interface";
3
+ import { Browser } from "@puppeteer/browsers";
4
+ import { MJMLParsingOptions } from "mjml-core";
5
+ import { Browser as Browser$1, BrowserContext, PDFOptions } from "puppeteer";
6
+ import { Data, Options } from "ejs";
7
+ import { EtaConfig } from "eta";
8
+ import { EscapeFunction } from "mustache";
9
+ import { ConfigureOptions } from "nunjucks";
10
+ import { LocalsObject, Options as Options$1 } from "pug";
11
+ import { HandlebarsService } from "@gboutte/nestjs-hbs";
12
+ //#region src/helpers/getRelativePath.helper.d.ts
13
+ /**
14
+ * Get the relative path to a value from the module directory.
15
+ * @param moduleDir the path of the module, typically __dirname
16
+ * @param relativeToModule the path to the value relative to the module directory
17
+ * @returns the relative path from the current working directory to the value
18
+ * @example
19
+ * getRelativePathToValue(__dirname, './templates/my-template.hbs');
20
+ * // returns 'context/pdf/templates/my-template.hbs' if the current working directory is '/
21
+ */
22
+ declare function getRelativePathToValue(moduleDir: string, relativeToModule: string): string;
23
+ //#endregion
24
+ //#region src/puppeteer/browser/browser.service.d.ts
25
+ declare enum BrowserTag {
26
+ LATEST = "latest",
27
+ BETA = "beta",
28
+ DEV = "dev",
29
+ STABLE = "stable",
30
+ CANARY = "canary"
31
+ }
32
+ type Headless = boolean | 'shell' | undefined;
33
+ declare class BrowserService implements OnModuleDestroy {
34
+ private readonly cacheDir;
35
+ private readonly options?;
36
+ private _browserInstance;
37
+ private browser;
38
+ activeJobs: number;
39
+ totalJobs: number;
40
+ private recycleRequested;
41
+ private recycling;
42
+ private browserTag;
43
+ private useLockedBrowser;
44
+ private buildId;
45
+ constructor(pdfParams: PuppeteerParameters);
46
+ onModuleDestroy(): Promise<void>;
47
+ getBrowserInstance(args: Array<string>, headless: boolean | 'shell' | undefined, executablePathBin: string | undefined): Promise<Browser$1>;
48
+ createContext(args: Array<string>, headless: Headless, executablePath?: string): Promise<BrowserContext>;
49
+ markJobStarted(): void;
50
+ markJobFinished(): Promise<void>;
51
+ recycleBrowserIfNeeded(): Promise<void>;
52
+ private cleanupCacheBestEffort;
53
+ install(lock?: boolean): Promise<import("@puppeteer/browsers", { with: { "resolution-mode": "import" } }).InstalledBrowser | null | undefined>;
54
+ private registerCleanupHooks;
55
+ private loadBrowser;
56
+ setBrowser(browser: Browser): void;
57
+ getBrowser(): Browser;
58
+ private loadBrowserTag;
59
+ private loadBuildId;
60
+ setBrowserTag(browserTag: BrowserTag): void;
61
+ getBrowserTag(): BrowserTag;
62
+ getBuildId(): string | undefined;
63
+ setBuildId(value: string | undefined): void;
64
+ private loadUseLockedBrowser;
65
+ hasBrowserInstalled(browser: Browser, buildId: string): Promise<boolean>;
66
+ getExecutablePath(): Promise<string>;
67
+ private launchBrowser;
68
+ private writeLockFile;
69
+ getLockedBuildId(browser: Browser): string | null;
70
+ }
71
+ //#endregion
72
+ //#region src/puppeteer/engines/ejs/ejs.service.d.ts
73
+ interface EjsOptions extends Omit<Options, 'async'> {
74
+ async?: boolean;
75
+ }
76
+ declare class EjsService {
77
+ render(template: string, data?: Data, options?: EjsOptions): Promise<string>;
78
+ renderFile(filePath: string, data?: Data, options?: EjsOptions): Promise<string>;
79
+ }
80
+ //#endregion
81
+ //#region src/puppeteer/engines/eta/eta.service.d.ts
82
+ interface EtaOptions extends Partial<EtaConfig> {
83
+ cache?: boolean;
84
+ autoEscape?: boolean;
85
+ varName?: string;
86
+ views?: string;
87
+ useWith?: boolean;
88
+ plugins?: Array<any>;
89
+ }
90
+ declare class EtaService {
91
+ private readonly eta;
92
+ private readonly templateCache;
93
+ private readonly maxCacheSize;
94
+ constructor();
95
+ /**
96
+ * Render an Eta template from a string
97
+ * @param template The template string to render
98
+ * @param data The data object to use for rendering
99
+ * @param options Optional Eta rendering options
100
+ * @returns The rendered HTML string
101
+ */
102
+ render(template: string, data?: Record<string, unknown>, options?: EtaOptions): string;
103
+ /**
104
+ * Render an Eta template from a file
105
+ * @param filePath The path to the template file
106
+ * @param data The data object to use for rendering
107
+ * @param options Optional Eta rendering options
108
+ * @returns The rendered HTML string
109
+ */
110
+ renderFile(filePath: string, data?: Record<string, unknown>, options?: EtaOptions): string;
111
+ /**
112
+ * Clear the template cache
113
+ */
114
+ clearCache(): void;
115
+ /**
116
+ * Get the current cache size
117
+ * @returns The number of cached templates
118
+ */
119
+ getCacheSize(): number;
120
+ }
121
+ //#endregion
122
+ //#region src/puppeteer/engines/mustache/mustache.service.d.ts
123
+ interface MustacheOptions {
124
+ tags?: [string, string];
125
+ escape?: EscapeFunction;
126
+ }
127
+ declare class MustacheService {
128
+ private readonly templateCache;
129
+ private readonly maxCacheSize;
130
+ /**
131
+ * Render a Mustache template from a string
132
+ * @param template The template string to render
133
+ * @param data The data object to use for rendering
134
+ * @param options Optional Mustache rendering options
135
+ * @returns The rendered HTML string
136
+ */
137
+ render(template: string, data?: Record<string, unknown>, options?: MustacheOptions): string;
138
+ /**
139
+ * Render a Mustache template from a file
140
+ * @param filePath The path to the template file
141
+ * @param data The data object to use for rendering
142
+ * @param options Optional Mustache rendering options
143
+ * @returns The rendered HTML string
144
+ */
145
+ renderFile(filePath: string, data?: Record<string, unknown>, options?: MustacheOptions): string;
146
+ /**
147
+ * Clear the template cache
148
+ */
149
+ clearCache(): void;
150
+ /**
151
+ * Get the current cache size
152
+ * @returns The number of cached templates
153
+ */
154
+ getCacheSize(): number;
155
+ }
156
+ //#endregion
157
+ //#region src/puppeteer/engines/nunjucks/nunjucks.service.d.ts
158
+ interface NunjucksOptions extends Partial<ConfigureOptions> {
159
+ noCache?: boolean;
160
+ watch?: boolean;
161
+ throwOnUndefined?: boolean;
162
+ trimBlocks?: boolean;
163
+ lstripBlocks?: boolean;
164
+ }
165
+ declare class NunjucksService {
166
+ constructor();
167
+ render(template: string, data?: Record<string, unknown>, options?: NunjucksOptions): string;
168
+ renderFile(filePath: string, data?: Record<string, unknown>, options?: NunjucksOptions): string;
169
+ }
170
+ //#endregion
171
+ //#region src/puppeteer/engines/pug/pug.service.d.ts
172
+ type PugOptions = Options$1;
173
+ declare class PugService {
174
+ render(template: string, data?: LocalsObject, options?: PugOptions): string;
175
+ renderFile(filePath: string, data?: LocalsObject, options?: PugOptions): string;
176
+ }
177
+ //#endregion
178
+ //#region src/puppeteer/puppeteer-parameters.interface.d.ts
179
+ interface PuppeteerParameters {
180
+ pdfOptions?: PDFOptions;
181
+ hbsOptions?: HandlebarsOptions;
182
+ mjmlOptions?: MJMLParsingOptions;
183
+ pugOptions?: PugOptions;
184
+ ejsOptions?: EjsOptions;
185
+ nunjucksOptions?: NunjucksOptions;
186
+ etaOptions?: EtaOptions;
187
+ mustacheOptions?: MustacheOptions;
188
+ chromiumRevision?: string;
189
+ buildId?: string;
190
+ headless?: boolean | 'shell';
191
+ browser?: Browser;
192
+ browserTag?: BrowserTag;
193
+ useLockedBrowser?: boolean;
194
+ browserInstallBaseUrl?: string;
195
+ extraPuppeteerArgs?: Array<string>;
196
+ executablePath?: string;
197
+ cleanupBrowserCacheOnExit?: boolean;
198
+ }
199
+ //#endregion
200
+ //#region src/nestjs-pdf.module.d.ts
201
+ interface PdfLibModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
202
+ inject?: Array<any>;
203
+ useFactory: (...args: Array<any>) => any;
204
+ }
205
+ declare class NestjsPdfModule {
206
+ static forRoot(options: PuppeteerParameters): DynamicModule;
207
+ static forRootAsync(options: PdfLibModuleAsyncOptions): DynamicModule;
208
+ }
209
+ //#endregion
210
+ //#region src/puppeteer/engines/mjml/mjml.service.d.ts
211
+ declare class MjmlService {
212
+ render(template: string, options?: MJMLParsingOptions): Promise<string>;
213
+ renderFile(filePath: string, options?: MJMLParsingOptions): Promise<string>;
214
+ }
215
+ //#endregion
216
+ //#region src/puppeteer/puppeteer.service.d.ts
217
+ declare class PuppeteerService {
218
+ private readonly browserService;
219
+ private readonly options;
220
+ private readonly hbsService?;
221
+ private readonly mjmlService?;
222
+ private readonly pugService?;
223
+ private readonly ejsService?;
224
+ private readonly nunjucksService?;
225
+ private readonly etaService?;
226
+ private readonly mustacheService?;
227
+ constructor(browserService: BrowserService, options: PuppeteerParameters, hbsService?: HandlebarsService | undefined, mjmlService?: MjmlService | undefined, pugService?: PugService | undefined, ejsService?: EjsService | undefined, nunjucksService?: NunjucksService | undefined, etaService?: EtaService | undefined, mustacheService?: MustacheService | undefined);
228
+ private readonly limit;
229
+ generatePdfFromHtml(html: string, options?: PuppeteerParameters): Promise<Uint8Array>;
230
+ generatePdfFromTemplateHbsString(template: string, parameters?: any, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
231
+ generatePdfFromTemplateHbsFile(file: string, parameters?: any, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
232
+ generatePdfFromMjmlString(template: string, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
233
+ generatePdfFromMjmlFile(file: string, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
234
+ generatePdfFromPugString(template: string, data?: LocalsObject, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
235
+ generatePdfFromPugFile(file: string, data?: LocalsObject, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
236
+ generatePdfFromEjsString(template: string, data?: Data, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
237
+ generatePdfFromEjsFile(file: string, data?: Data, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
238
+ generatePdfFromNunjucksString(template: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
239
+ generatePdfFromNunjucksFile(file: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
240
+ generatePdfFromEtaString(template: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
241
+ generatePdfFromEtaFile(file: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
242
+ generatePdfFromMustacheString(template: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
243
+ generatePdfFromMustacheFile(file: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
244
+ }
245
+ //#endregion
246
+ //#region src/nestjs-pdf.service.d.ts
247
+ declare class NestjsPdfService {
248
+ private readonly puppeteerService;
249
+ constructor(puppeteerService: PuppeteerService);
250
+ /**
251
+ * @param html HTML string to convert to PDF
252
+ * @param options PDF generation options (optional)
253
+ * @returns PDF generated from the provided HTML
254
+ * @description This method uses the Puppeteer service to generate a PDF from an HTML string. Generation options can be customized by passing a `PuppeteerParameters` object as the second argument. This allows you to control various aspects of PDF rendering, such as page size, margins, background display, etc. If no options are provided, the default parameters defined in the Puppeteer service will be used.
255
+ */
256
+ generatePdfFromHtml(html: string, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
257
+ /**
258
+ * @param template Handlebars template string
259
+ * @param parameters Data parameters to inject into the template
260
+ * @param options PDF generation options (optional)
261
+ * @returns PDF generated from the provided Handlebars template with parameters applied
262
+ * @description This method generates a PDF from a Handlebars template provided as a string. The parameters to inject into the template are passed in the `parameters` object, which is used to render the template before converting it to PDF. PDF generation options can also be customized by passing a `PuppeteerParameters` object as the third argument. This allows you to control various aspects of PDF rendering, such as page size, margins, background display, etc. If no options are provided, the default parameters defined in the Puppeteer service will be used.
263
+ */
264
+ generatePdfFromTemplateHbsString(template: string, parameters?: any, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
265
+ /**
266
+ * @param file Path to the Handlebars template file
267
+ * @param parameters Data parameters to inject into the template
268
+ * @param options PDF generation options (optional)
269
+ * @returns PDF generated from the Handlebars template at the provided file path with parameters applied
270
+ * @description This method generates a PDF from a Handlebars template located at the specified file path. The file path is passed as a string in the `file` parameter. The parameters to inject into the template are passed in the `parameters` object, which is used to render the template before converting it to PDF. PDF generation options can also be customized by passing a `PuppeteerParameters` object as the third argument. This allows you to control various aspects of PDF rendering, such as page size, margins, background display, etc. If no options are provided, the default parameters defined in the Puppeteer service will be used.
271
+ */
272
+ generatePdfFromTemplateHbsFile(file: string, parameters?: any, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
273
+ /**
274
+ * @param template MJML template string
275
+ * @param options PDF generation options (optional)
276
+ * @returns PDF generated from the provided MJML template
277
+ * @description This method generates a PDF from an MJML template provided as a string. MJML (MJML Markup Language) is a markup language designed to reduce the pain of coding a responsive email. The template is first rendered to HTML using the MJML renderer, then converted to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the second argument.
278
+ */
279
+ generatePdfFromMjmlString(template: string, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
280
+ /**
281
+ * @param file Path to the MJML template file
282
+ * @param options PDF generation options (optional)
283
+ * @returns PDF generated from the MJML template at the provided file path
284
+ * @description This method generates a PDF from an MJML template located at the specified file path. The file path is passed as a string in the `file` parameter. The template is first rendered to HTML using the MJML renderer, then converted to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the second argument.
285
+ */
286
+ generatePdfFromMjmlFile(file: string, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
287
+ /**
288
+ * @param template EJS template string
289
+ * @param data Data to inject into the template
290
+ * @param options PDF generation options (optional)
291
+ * @returns PDF generated from the provided EJS template with data applied
292
+ * @description This method generates a PDF from an EJS (Embedded JavaScript) template provided as a string. EJS is a templating language with a simple, straightforward syntax. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
293
+ */
294
+ generatePdfFromEjsString(template: string, data?: Data, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
295
+ /**
296
+ * @param file Path to the EJS template file
297
+ * @param data Data to inject into the template
298
+ * @param options PDF generation options (optional)
299
+ * @returns PDF generated from the EJS template at the provided file path with data applied
300
+ * @description This method generates a PDF from an EJS template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
301
+ */
302
+ generatePdfFromEjsFile(file: string, data?: Data, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
303
+ /**
304
+ * @param template Pug template string
305
+ * @param data Data to inject into the template
306
+ * @param options PDF generation options (optional)
307
+ * @returns PDF generated from the provided Pug template with data applied
308
+ * @description This method generates a PDF from a Pug template provided as a string. Pug is a clean, whitespace-sensitive syntax for writing HTML. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
309
+ */
310
+ generatePdfFromPugString(template: string, data?: LocalsObject, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
311
+ /**
312
+ * @param file Path to the Pug template file
313
+ * @param data Data to inject into the template
314
+ * @param options PDF generation options (optional)
315
+ * @returns PDF generated from the Pug template at the provided file path with data applied
316
+ * @description This method generates a PDF from a Pug template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
317
+ */
318
+ generatePdfFromPugFile(file: string, data?: LocalsObject, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
319
+ /**
320
+ * @param template Nunjucks template string
321
+ * @param data Data to inject into the template
322
+ * @param options PDF generation options (optional)
323
+ * @returns PDF generated from the provided Nunjucks template with data applied
324
+ * @description This method generates a PDF from a Nunjucks template provided as a string. Nunjucks is a powerful templating language with support for inheritance, macros, and filters. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
325
+ */
326
+ generatePdfFromNunjucksString(template: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
327
+ /**
328
+ * @param file Path to the Nunjucks template file
329
+ * @param data Data to inject into the template
330
+ * @param options PDF generation options (optional)
331
+ * @returns PDF generated from the Nunjucks template at the provided file path with data applied
332
+ * @description This method generates a PDF from a Nunjucks template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
333
+ */
334
+ generatePdfFromNunjucksFile(file: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
335
+ /**
336
+ * @param template Eta template string
337
+ * @param data Data to inject into the template
338
+ * @param options PDF generation options (optional)
339
+ * @returns PDF generated from the provided Eta template with data applied
340
+ * @description This method generates a PDF from an Eta template provided as a string. Eta is a fast and lightweight embedded templating language with a syntax similar to EJS but with better performance. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
341
+ */
342
+ generatePdfFromEtaString(template: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
343
+ /**
344
+ * @param file Path to the Eta template file
345
+ * @param data Data to inject into the template
346
+ * @param options PDF generation options (optional)
347
+ * @returns PDF generated from the Eta template at the provided file path with data applied
348
+ * @description This method generates a PDF from an Eta template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
349
+ */
350
+ generatePdfFromEtaFile(file: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
351
+ /**
352
+ * @param template Mustache template string
353
+ * @param data Data to inject into the template
354
+ * @param options PDF generation options (optional)
355
+ * @returns PDF generated from the provided Mustache template with data applied
356
+ * @description This method generates a PDF from a Mustache template provided as a string. Mustache is a logic-less template language that emphasizes readable and simple templates. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
357
+ */
358
+ generatePdfFromMustacheString(template: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
359
+ /**
360
+ * @param file Path to the Mustache template file
361
+ * @param data Data to inject into the template
362
+ * @param options PDF generation options (optional)
363
+ * @returns PDF generated from the Mustache template at the provided file path with data applied
364
+ * @description This method generates a PDF from a Mustache template located at the specified file path. The file path is passed as a string in the `file` parameter. The data to inject into the template is passed in the `data` object, which is used to render the template before converting it to PDF. PDF generation options can be customized by passing a `PuppeteerParameters` object as the third argument.
365
+ */
366
+ generatePdfFromMustacheFile(file: string, data?: Record<string, unknown>, options?: PuppeteerParameters): Promise<Uint8Array<ArrayBufferLike>>;
367
+ /**
368
+ * @param pdf The PDF bytes to modify
369
+ * @param fieldName The name of the signature field to add (default: 'SignatureDebtor')
370
+ * @param anchorText The text anchor to locate the signature field position (default: '__SIG_DEBTOR_ANCHOR__')
371
+ * @returns Modified PDF with a signature field added at the anchor position
372
+ * @description This method adds a signature field to a PDF using a text anchor as a reference for the field position. It uses the `addSignatureFieldUsingAnchor` function which finds the anchor in the PDF and inserts a signature field at that location. The signature field is named according to the `fieldName` parameter and the anchor is defined by `anchorText`.
373
+ *
374
+ * Usage example:
375
+ * ```typescript
376
+ * const modifiedPdf = await pdfService.addSignatureFieldSignatureDebtorRaw(
377
+ * originalPdfBytes,
378
+ * 'SignatureDebtor',
379
+ * '__SIG_DEBTOR_ANCHOR__'
380
+ * );
381
+ * ```
382
+ *
383
+ * In this example, `originalPdfBytes` is a byte array representing the original PDF, `SignatureDebtor` is the name of the signature field to add, and `__SIG_DEBTOR_ANCHOR__` is the anchor text used to position the signature field in the PDF.
384
+ *
385
+ * If the anchor is not found, the signature field will be added at a default position (centered at the bottom of the last page).
386
+ *
387
+ * Note: Ensure that the input PDF contains the anchor defined by `anchorText` for the signature field to be positioned correctly. Otherwise, it will be added at a default position.
388
+ */
389
+ addSignatureFieldSignatureDebtorRaw(pdf: Uint8Array | Buffer, fieldName?: string, anchorText?: string): Promise<Uint8Array<ArrayBufferLike>>;
390
+ }
391
+ //#endregion
392
+ //#region src/puppeteer/puppeteer.module.d.ts
393
+ interface PuppeteerModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
394
+ inject?: Array<InjectionToken | OptionalFactoryDependency>;
395
+ useFactory: (...args: Array<any>) => Promise<PuppeteerParameters> | PuppeteerParameters;
396
+ }
397
+ declare class PuppeteerModule implements OnModuleInit {
398
+ private readonly browserService;
399
+ private readonly pdfParams;
400
+ constructor(browserService: BrowserService, pdfParams: PuppeteerParameters);
401
+ onModuleInit(): Promise<void>;
402
+ static forRoot(pdfParameters: PuppeteerParameters): DynamicModule;
403
+ static forRootAsync(options: PuppeteerModuleAsyncOptions): DynamicModule;
404
+ }
405
+ //#endregion
406
+ export { EjsOptions, EjsService, EtaOptions, EtaService, MjmlService, MustacheOptions, MustacheService, NestjsPdfModule, NestjsPdfService, NunjucksOptions, NunjucksService, PdfLibModuleAsyncOptions, PugOptions, PugService, PuppeteerModule, PuppeteerModuleAsyncOptions, PuppeteerParameters, PuppeteerService, getRelativePathToValue };
407
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/helpers/getRelativePath.helper.ts","../src/puppeteer/browser/browser.service.ts","../src/puppeteer/engines/ejs/ejs.service.ts","../src/puppeteer/engines/eta/eta.service.ts","../src/puppeteer/engines/mustache/mustache.service.ts","../src/puppeteer/engines/nunjucks/nunjucks.service.ts","../src/puppeteer/engines/pug/pug.service.ts","../src/puppeteer/puppeteer-parameters.interface.ts","../src/nestjs-pdf.module.ts","../src/puppeteer/engines/mjml/mjml.service.ts","../src/puppeteer/puppeteer.service.ts","../src/nestjs-pdf.service.ts","../src/puppeteer/puppeteer.module.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAWgB,uBACd,mBACA;;;aCIU;EACV;EACA;EACA;EACA;EACA;;KAGU;cAqCC,0BAA0B;mBACpB;mBACA;UAET;UACA;EAED;EACA;UAEC;UACA;UAEA;UACA;UACA;EAE8B,YAAA,WAAW;EAc3C,mBAAe;EAgBf,mBACJ,MAAM,eACN,yCACA,wCAAqC,QAAA;EAajC,cACJ,MAAM,eACN,UAAU,UACV,0BACC,QAAQ;EA2BX;EASM,mBAAe;EAKf,0BAAsB;UA6Bd;EA6BR,QAAQ,iBAAqB,wCAAA,yCAAA;UA2D3B;UAuBA;EAUD,WAAW,SAAS;EAIpB,cAAc;UAIb;UAcA;EAUD,cAAc,YAAY;EAI1B,iBAAiB;EAIxB;EAIA,WAAW;UAIH;EAUF,oBAAoB,SAAS,SAAa,kBAAe;EAWzD,qBAAqB;UA2Bb;UAwBN;EAYR,iBAAiB,SAAS;;;;UCjcX,mBAAmB,KAAK;EACvC;;cAIW;EACL,OAAO,kBAAkB,OAAM,MAAW,UAAU,aAAU;EAa9D,WAAW,kBAAkB,OAAM,MAAW,UAAU,aAAU;;;;UChBzD,mBAAmB,QAAQ;EAC1C;EACA;EACA;EACA;EACA;EACA,UAAU;;cAIC;mBACM;mBACA;mBACA;;;;;;;;;EAiBjB,OACE,kBACA,OAAM,yBACN,UAAU;;;;;;;;EA6BZ,WACE,kBACA,OAAM,yBACN,UAAU;;;;EA8BZ;;;;;EAQA;;;;UCvGe;EACf;EACA,SAAS;;cAIE;mBACM;mBACA;;;;;;;;EASjB,OACE,kBACA,OAAM,yBACN,UAAU;;;;;;;;EAsBZ,WACE,kBACA,OAAM,yBACN,UAAU;;;;EA4BZ;;;;;E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