Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Improve function exports #29

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improved function docs
  • Loading branch information
zoey-kaiser committed Mar 4, 2024
commit 851653cf8a7ad866f8879c31b83c220fbe733910
1 change: 1 addition & 0 deletions src/runtime/server/components/drawHorizontalLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { PDFDocumentType } from "../../types"

/**
* Draw a Horizontal line across the document
* @param doc The PDF document object
* @param moveDown The amount of lines to move down before and after drawing the line. Default: 1
*/
export function drawHorizontalLine<T>(doc: PDFDocumentType<T>, moveDown = 1): void {
Expand Down
6 changes: 5 additions & 1 deletion src/runtime/server/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ async function printHeaders<T>(doc: PDFDocumentType<T>) {
}
}

/**
* Applies the Header and Footer designs to every page.
* @param doc The PDF document object
*/
export type ApplyLayout = () => Promise<void>
export async function applyLayout<T>(doc: PDFDocumentType<T>) {
export async function applyLayout<T>(doc: PDFDocumentType<T>): Promise<void> {
await printHeaders(doc)
await printFooters(doc)
}