mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Added missing baseline property to TextOptions (#37458)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
7a51b5f4c1
commit
94c1ab99fb
3
types/pdfkit/index.d.ts
vendored
3
types/pdfkit/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: http://pdfkit.org
|
||||
// Definitions by: Eric Hillah <https://github.com/erichillah>
|
||||
// Erik Berreßem <https://github.com/she11sh0cked>
|
||||
// Jeroen Vervaeke <https://github.com/jeroenvervaeke/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -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<TDocument> {
|
||||
|
||||
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user