import type { RenderedFontFamily } from "$types"; export type Orientation = "portrait" | "landscape"; export type StandardPageSize = "A4" | "A3" | "A5" | "LETTER" | "LEGAL" | "TABLOID" | "EXECUTIVE" | "FOLIO"; export type CustomPageSize = { width: number; height: number }; export type PageSize = StandardPageSize | CustomPageSize; export type MarginSide = "top" | "right" | "bottom" | "left"; export type Margins = Record; export type PdfExportOptions = { pageSize: PageSize; orientation: Orientation; margins: Margins; fontSize?: number; lineHeight?: number; includeTitle?: boolean; includeHeader?: boolean; includeFooter?: boolean; }; export type MarkdownListItem = { content: MarkdownNode[] }; export type MarkdownNode = | { type: "heading"; level: number; content: string } | { type: "paragraph"; content: string } | { type: "code"; content: string; language?: string } | { type: "list"; items: MarkdownListItem[]; ordered: boolean } | { type: "blockquote"; content: string } | { type: "footnote"; id: string; content: string } | { type: "image"; src: string; alt: string }; export type PdfRenderResult = { nodes: MarkdownNode[]; title?: string; word_count: number }; export type FontName = RenderedFontFamily; export type FontPayloadFormat = "woff" | "ttf" | "otf"; export type PdfFontSourceDescriptor = { file: string; src: string; fontWeight?: FontWeight; fontStyle?: FontStyle }; export type PdfFontResolution = { fontName: FontName; strategy: FontStrategy; family: string; sources: PdfFontSourceDescriptor[]; }; export type FontWeight = | number | "thin" | "ultralight" | "light" | "normal" | "medium" | "semibold" | "bold" | "ultrabold" | "heavy"; export type FontStyle = "normal" | "italic"; export type FontStrategy = "custom" | "builtin"; export type FontFile = { file: string; fontWeight?: FontWeight; fontStyle?: FontStyle }; export type FontConfig = { family: string; files: FontFile[] };