mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Added sample definitions from pdfmake-examples and fixed model
This commit is contained in:
File diff suppressed because one or more lines are too long
Vendored
+5
-8
@@ -96,11 +96,7 @@ declare module 'pdfmake/build/pdfmake' {
|
||||
|
||||
type Margins = number | [number, number] | [number, number, number, number];
|
||||
|
||||
interface Styles {
|
||||
[key: string]: Style;
|
||||
}
|
||||
|
||||
type Alignment = 'left' | 'right' | 'justify' | 'center';
|
||||
type Alignment = 'left' | 'right' | 'justify' | 'center' | string;
|
||||
|
||||
interface Style {
|
||||
font?: any;
|
||||
@@ -120,7 +116,8 @@ declare module 'pdfmake/build/pdfmake' {
|
||||
characterSpacing?: number;
|
||||
noWrap?: boolean;
|
||||
markerColor?: string;
|
||||
leadingIndent?: any;
|
||||
leadingIndent?: any;
|
||||
[additionalProperty: string]: any;
|
||||
}
|
||||
|
||||
type TableRowFunction = (row: number) => number;
|
||||
@@ -176,11 +173,11 @@ declare module 'pdfmake/build/pdfmake' {
|
||||
header?: TDocumentHeaderFooterFunction;
|
||||
footer?: TDocumentHeaderFooterFunction;
|
||||
content: string | Content;
|
||||
styles?: Styles;
|
||||
styles?: Style;
|
||||
pageSize?: PageSize;
|
||||
pageOrientation?: PageOrientation;
|
||||
pageMargins?: Margins;
|
||||
defaultStyle?: Styles;
|
||||
defaultStyle?: Style;
|
||||
}
|
||||
|
||||
type CreatedPdfParams = (
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import * as pdfMake from 'pdfmake/build/pdfmake';
|
||||
import * as pdfFonts from 'pdfmake/build/vfs_fonts';
|
||||
|
||||
const docDefinition = { content: 'This is an sample PDF printed with pdfMake' };
|
||||
import definitions from './doc-definitions';
|
||||
|
||||
const createPdf = () => {
|
||||
const pdf = pdfMake;
|
||||
pdf.vfs = pdfFonts.pdfMake.vfs;
|
||||
pdfMake.createPdf(docDefinition).download();
|
||||
|
||||
for (const key in definitions) {
|
||||
const definition: pdfMake.TDocumentDefinitions = definitions[key];
|
||||
pdfMake.createPdf(definition).download();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user