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 };