From b28f6b4f2a89c044c50125272bf34231e6ad5b61 Mon Sep 17 00:00:00 2001 From: Zoey Kaiser Date: Tue, 13 Feb 2024 14:10:56 +0100 Subject: [PATCH] export PDFDocumentType and PDFOptions types --- playground/server/api/pdf/landscape.ts | 13 ++++++++++--- src/runtime/server/index.ts | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/playground/server/api/pdf/landscape.ts b/playground/server/api/pdf/landscape.ts index 9ddfa82..76ee431 100644 --- a/playground/server/api/pdf/landscape.ts +++ b/playground/server/api/pdf/landscape.ts @@ -1,9 +1,16 @@ -import { createPDF, streamReturnPDF } from '#pdf' +import { createPDF, streamReturnPDF, type PDFOptions } from '#pdf' export default eventHandler(async (event) => { - const pdf = createPDF({ + const options: PDFOptions = { + margins: { + top: 100, + bottom: 100, + left: 50, + right: 50, + }, layout: 'landscape' - }) + } + const pdf = createPDF(options) pdf.text('Welcome to NuxtPDF!') pdf.end() diff --git a/src/runtime/server/index.ts b/src/runtime/server/index.ts index 5368ad6..cbd611f 100644 --- a/src/runtime/server/index.ts +++ b/src/runtime/server/index.ts @@ -1 +1,2 @@ export { createPDF, streamReturnPDF } from './pdf' +export type { PDFDocumentType, PDFOptions } from '../types'