From 1bfca4456c0b06e8f8d1c4d9963ba3fc9a1ade29 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 29 May 2019 14:14:26 +0200 Subject: [PATCH] fix(core): update --- package.json | 2 +- ts/index.ts | 18 ++++++++++++++++-- ts/smartbrowser.plugins.ts | 6 ++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 26aecad..157ac96 100644 --- a/package.json +++ b/package.json @@ -40,4 +40,4 @@ "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/ts/index.ts b/ts/index.ts index 0c1947d..c23d8c1 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,7 +1,21 @@ import * as plugins from './smartbrowser.plugins'; export class SmartBrowser { - pdfFromPage() { - + puppeteer: plugins.puppeteer.Browser; + smartpdf: plugins.smartpdf.SmartPdf; + pdfFromPage(urlArg: string) { + this.smartpdf.getFullWebsiteAsSinglePdf(urlArg: ); + } + + public async start() { + this.smartpdf = new plugins.smartpdf.SmartPdf(); + this.smartpdf.init(); + } + + /** + * stops the smartbrowser instance + */ + stop() { + this.smartpdf.close(); } } diff --git a/ts/smartbrowser.plugins.ts b/ts/smartbrowser.plugins.ts index 45999f4..4939519 100644 --- a/ts/smartbrowser.plugins.ts +++ b/ts/smartbrowser.plugins.ts @@ -1,3 +1,9 @@ +// pushrocks scope +import * as smartpdf from '@pushrocks/smartpdf'; + +export { smartpdf }; + +// third party import * as puppeteer from 'puppeteer'; export { puppeteer };