Skip to content

Commit

Permalink
🏷️ [placeholder-pdf-lib] Either pdfDoc or pdfPage is required, not both
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuch committed Mar 18, 2024
1 parent f884e3a commit 1c79a47
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
13 changes: 10 additions & 3 deletions packages/placeholder-pdf-lib/dist/pdflibAddPlaceholder.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export function pdflibAddPlaceholder({ pdfDoc, pdfPage, reason, contactInfo, name, location, signingTime, signatureLength, byteRangePlaceholder, subFilter, widgetRect, appName, }: InputType): void;
export type PDFDocument = import('pdf-lib').PDFDocument;
export type PDFPage = import('pdf-lib').PDFPage;
export type InputType = {
pdfDoc: PDFDocument;
pdfPage: PDFPage;
export type CommonInputType = {
pdfDoc?: PDFDocument;
pdfPage?: PDFPage;
reason: string;
contactInfo: string;
name: string;
Expand All @@ -24,4 +24,11 @@ export type InputType = {
*/
appName?: string;
};
export type DocInputType = {
pdfDoc: PDFDocument;
};
export type PageInputType = {
pdfPage: PDFPage;
};
export type InputType = CommonInputType & (DocInputType | PageInputType);
//# sourceMappingURL=pdflibAddPlaceholder.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions packages/placeholder-pdf-lib/dist/pdflibAddPlaceholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var _pdfLib = require("pdf-lib");
*/

/**
* @typedef {object} InputType
* @property {PDFDocument} pdfDoc
* @property {PDFPage} pdfPage
* @typedef {object} CommonInputType
* @property {PDFDocument} [pdfDoc]
* @property {PDFPage} [pdfPage]
* @property {string} reason
* @property {string} contactInfo
* @property {string} name
Expand All @@ -30,6 +30,20 @@ var _pdfLib = require("pdf-lib");
* @property {string} [appName] Name of the application generating the signature
*/

/**
* @typedef {object} DocInputType
* @property {PDFDocument} pdfDoc
*/

/**
* @typedef {object} PageInputType
* @property {PDFPage} pdfPage
*/

/**
* @typedef {CommonInputType & (DocInputType | PageInputType)} InputType
*/

/**
* Adds a signature placeholder to a PDF-LIB PDFDocument.
*
Expand Down
20 changes: 17 additions & 3 deletions packages/placeholder-pdf-lib/src/pdflibAddPlaceholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
*/

/**
* @typedef {object} InputType
* @property {PDFDocument} pdfDoc
* @property {PDFPage} pdfPage
* @typedef {object} CommonInputType
* @property {PDFDocument} [pdfDoc]
* @property {PDFPage} [pdfPage]
* @property {string} reason
* @property {string} contactInfo
* @property {string} name
Expand All @@ -34,6 +34,20 @@ import {
* @property {string} [appName] Name of the application generating the signature
*/

/**
* @typedef {object} DocInputType
* @property {PDFDocument} pdfDoc
*/

/**
* @typedef {object} PageInputType
* @property {PDFPage} pdfPage
*/

/**
* @typedef {CommonInputType & (DocInputType | PageInputType)} InputType
*/

/**
* Adds a signature placeholder to a PDF-LIB PDFDocument.
*
Expand Down

0 comments on commit 1c79a47

Please sign in to comment.