diff --git a/ts/interfaces/index.ts b/ts/interfaces/index.ts new file mode 100644 index 0000000..b911c7d --- /dev/null +++ b/ts/interfaces/index.ts @@ -0,0 +1 @@ +export * from './interface.pdfresult'; \ No newline at end of file diff --git a/ts/interfaces/interface.pdfresult.ts b/ts/interfaces/interface.pdfresult.ts new file mode 100644 index 0000000..31e6ce2 --- /dev/null +++ b/ts/interfaces/interface.pdfresult.ts @@ -0,0 +1,5 @@ +export interface IPdfResult { + name: string, + id: string, + buffer: Buffer; +} diff --git a/ts/smartpdf.classes.smartpdf.ts b/ts/smartpdf.classes.smartpdf.ts index 866c0ad..8ac12ee 100644 --- a/ts/smartpdf.classes.smartpdf.ts +++ b/ts/smartpdf.classes.smartpdf.ts @@ -5,11 +5,7 @@ import { PdfCandidate } from './smartpdf.classes.pdfcandidate'; declare const document; -export interface IPdfResult { - name: string, - id: string, - buffer: Buffer; -} +import { IPdfResult } from './interfaces'; export class SmartPdf { htmlServerInstance: Server; @@ -80,7 +76,7 @@ export class SmartPdf { id: pdfCandidate.pdfId, name: `${pdfCandidate.pdfId}.js`, buffer: pdfBuffer - } + }; } async getPdfForWebsite(websiteUrl: string): Promise { @@ -99,7 +95,7 @@ export class SmartPdf { id: pdfId, name: `${pdfId}.js`, buffer: pdfBuffer - } + }; } async getFullWebsiteAsSinglePdf(websiteUrl: string) { @@ -107,8 +103,7 @@ export class SmartPdf { page.emulateMedia('screen'); const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' }); const pdfId = plugins.smartunique.shortId(); - const {documentHeight, documentWidth} = await page.evaluate(() => { - + const { documentHeight, documentWidth } = await page.evaluate(() => { return { documentHeight: document.height, documentWidth: document.width @@ -126,6 +121,6 @@ export class SmartPdf { id: pdfId, name: `${pdfId}.js`, buffer: pdfBuffer - } + }; } }