diff --git a/types/pdfkit/index.d.ts b/types/pdfkit/index.d.ts index 30301ae532..d244a4484e 100644 --- a/types/pdfkit/index.d.ts +++ b/types/pdfkit/index.d.ts @@ -2,6 +2,7 @@ // Project: http://pdfkit.org // Definitions by: Eric Hillah // Erik Berreßem +// Jeroen Vervaeke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -146,6 +147,8 @@ declare namespace PDFKit.Mixins { /** the alignment of the text (center, justify, left, right) */ //TODO check this align?: 'center' | 'justify' | 'left' | 'right' | string; + /** the vertical alignment of the text with respect to its insertion point */ + baseline?: number | "svg-middle" | "middle" | "svg-central" | "bottom" | "ideographic" | "alphabetic" | "mathematical" | "hanging" | "top" } interface PDFText { diff --git a/types/pdfkit/pdfkit-tests.ts b/types/pdfkit/pdfkit-tests.ts index baa27517e7..df18544490 100644 --- a/types/pdfkit/pdfkit-tests.ts +++ b/types/pdfkit/pdfkit-tests.ts @@ -162,11 +162,15 @@ doc.image( }, { scale: 0.25, - } + }, ).text('Scale', 320, 265); doc.text('Scale', { align: 'justify' }); +doc.text('Baseline - string literal', { baseline: 'alphabetic' }); + +doc.text('Baseline - numeric', { baseline: 10 }); + doc.goTo(0, 0, 0, 0, 'lorem'); doc.image('path/to/image.png', {