@mfgames-writing/weasyprint-format
Version:
A formatter plugin for mfgames-writing-format that creates PDF files.
30 lines • 1.13 kB
TypeScript
import { ContentArgs, EditionArgs, FormatImageRequest, FormatImageResponse, Formatter, FormatterSettings } from "@mfgames-writing/contracts";
export declare class WeasyPrintFormatter implements Formatter {
private contentCounter;
private createdWorkDirectory;
private existingImageIds;
private htmlBuffer;
private lastContent;
private previousStyleName;
private stylesheets;
private workDirectory;
private workFinalPdfPath;
private workPdfPaths;
getSettings(): FormatterSettings;
start(args: EditionArgs): Promise<EditionArgs>;
addHtml(content: ContentArgs): Promise<ContentArgs>;
addImage(content: ContentArgs, image: FormatImageRequest): FormatImageResponse;
finish(args: EditionArgs): Promise<EditionArgs>;
private mergePdfs;
/**
* Checks to see if we need to render the PDF because we change some
* part that requires a different stylesheet.
*/
private checkHtmlPdf;
private renderHtmlPdf;
private renderPdf;
private writeHtml;
private copyPdf;
private loadStylesheet;
}
//# sourceMappingURL=WeasyPrintFormatter.d.ts.map