chromiumly
Version:
A lightweight Typescript library that interacts with Gotenberg's different modules to convert a variety of document formats to PDF files.
27 lines (26 loc) • 820 B
TypeScript
import { PathLikeOrReadStream } from '../../common';
import { ChromiumOptions } from './common.types';
export type ImageProperties = {
format: 'png' | 'jpeg' | 'webp';
quality?: number;
omitBackground?: boolean;
width?: number;
height?: number;
clip?: boolean;
};
export type ScreenshotOptions = Omit<ChromiumOptions, 'assets' | 'header' | 'footer'> & {
properties?: ImageProperties;
optimizeForSpeed?: boolean;
};
export type HtmlScreenshotOptions = ScreenshotOptions & {
html: PathLikeOrReadStream;
};
export type UrlScreenshotOptions = ScreenshotOptions & {
url: string;
};
export type MarkdownScreenshotOptions = ScreenshotOptions & {
html: PathLikeOrReadStream;
markdown: PathLikeOrReadStream;
header?: PathLikeOrReadStream;
footer?: PathLikeOrReadStream;
};