Skip to content

Commit

Permalink
interface correction
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Oct 20, 2020
1 parent ef22b39 commit b3743d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/reporting/server/lib/layouts/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ContextPageSize, PredefinedPageSize } from 'pdfmake/interfaces';
import { CustomPageSize, PredefinedPageSize } from 'pdfmake/interfaces';
import { PageSizeParams, PdfImageSize, Size } from './';

export interface ViewZoomWidthHeight {
Expand All @@ -27,7 +27,7 @@ export abstract class Layout {

public abstract getPdfPageSize(
pageSizeParams: PageSizeParams
): ContextPageSize | PredefinedPageSize;
): CustomPageSize | PredefinedPageSize;

public abstract getViewport(itemsCount: number): ViewZoomWidthHeight | null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import path from 'path';
import { ContextPageSize, PageOrientation } from 'pdfmake/interfaces';
import { CustomPageSize } from 'pdfmake/interfaces';
import {
getDefaultLayoutSelectors,
Layout,
Expand All @@ -26,13 +26,11 @@ export class PreserveLayout extends Layout implements LayoutInstance {
public readonly width: number;
private readonly scaledHeight: number;
private readonly scaledWidth: number;
private readonly orientation: PageOrientation;

constructor(size: Size, layoutSelectors?: LayoutSelectorDictionary) {
super(LayoutTypes.PRESERVE_LAYOUT);
this.height = size.height;
this.width = size.width;
this.orientation = size.height > size.width ? 'portrait' : 'landscape';
this.scaledHeight = size.height * ZOOM;
this.scaledWidth = size.width * ZOOM;

Expand Down Expand Up @@ -75,7 +73,7 @@ export class PreserveLayout extends Layout implements LayoutInstance {
return undefined;
}

public getPdfPageSize(pageSizeParams: PageSizeParams): ContextPageSize {
public getPdfPageSize(pageSizeParams: PageSizeParams): CustomPageSize {
return {
height:
this.height +
Expand All @@ -85,7 +83,6 @@ export class PreserveLayout extends Layout implements LayoutInstance {
pageSizeParams.headingHeight +
pageSizeParams.subheadingHeight,
width: this.width + pageSizeParams.pageMarginWidth * 2 + pageSizeParams.tableBorderWidth * 2,
orientation: this.orientation,
};
}
}

0 comments on commit b3743d3

Please sign in to comment.