feat: update pdfmake (#34830)

This commit is contained in:
Pavithran Gridharan
2019-04-25 23:43:33 +02:00
committed by Pranav Senthilnathan
parent 93d055288f
commit 3c2a4dda5e
2 changed files with 38 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ declare module 'pdfmake/build/vfs_fonts' {
declare module 'pdfmake/build/pdfmake' {
let vfs: TFontFamily;
let fonts: { [name: string]: TFontFamilyTypes };
function createPdf(documentDefinitions: TDocumentDefinitions): TCreatedPdf;
function createPdf(documentDefinitions: TDocumentDefinitions, tableLayouts?: any, fonts?: any, vfs?: any): TCreatedPdf;
enum PageSize {
A0_x_4 = '4A0',
@@ -183,16 +183,46 @@ declare module 'pdfmake/build/pdfmake' {
defaultStyle?: Style;
}
type CreatedPdfParams = (
interface Pagesize {
height: number;
width: number;
orientation: PageOrientation;
}
interface Page {
items: any[];
pageSize: Pagesize;
}
interface BufferOptions {
autoPrint?: boolean;
}
type CreatedPdfDownloadParams = (
defaultFileName?: string,
cb?: string,
options?: string
cb?: () => void,
options?: BufferOptions,
) => void;
type CreatedPdfOpenPrintParams = (
options?: BufferOptions,
win?: Window | null,
) => void;
type CreatedPdfBufferParams = (
cb: (result: any, pages: Page[]) => void,
options?: BufferOptions,
) => void;
interface TCreatedPdf {
download: CreatedPdfParams;
open: CreatedPdfParams;
print: CreatedPdfParams;
download: CreatedPdfDownloadParams;
getBlob: CreatedPdfBufferParams;
getBase64: CreatedPdfBufferParams;
getBuffer: CreatedPdfBufferParams;
getDataUrl: CreatedPdfBufferParams;
getStream: CreatedPdfBufferParams; // minimal version 0.1.41
open: CreatedPdfOpenPrintParams;
print: CreatedPdfOpenPrintParams;
}
interface pdfMakeStatic {

View File

@@ -2,6 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"dom",
"es6"
],
"noImplicitAny": true,