import { APIResource } from "../resource.js"; import * as Core from "../core.js"; export declare class Documents extends APIResource { /** * Generates a PDF document from a published document template. */ generate(documentId: string, body: DocumentGenerateParams, options?: Core.RequestOptions): Core.APIPromise; /** * Generates a PDF document from raw HTML content and/or a URL. If both are * provided, the HTML content will be injected into the page at the specified URL. */ generateHTML(body: DocumentGenerateHTMLParams, options?: Core.RequestOptions): Core.APIPromise; } /** * Base64 encoded PDF (when format=base64) */ export type DocumentGenerateResponse = DocumentGenerateResponse.Data | DocumentGenerateResponse.URL; export declare namespace DocumentGenerateResponse { /** * Base64 encoded PDF (when format=base64) */ interface Data { data?: string; } /** * PDF URL (when format=json) */ interface URL { url?: string; } } /** * Base64 encoded PDF (when format=base64) */ export type DocumentGenerateHTMLResponse = DocumentGenerateHTMLResponse.Data | DocumentGenerateHTMLResponse.URL; export declare namespace DocumentGenerateHTMLResponse { /** * Base64 encoded PDF (when format=base64) */ interface Data { data?: string; } /** * PDF URL (when format=json) */ interface URL { url?: string; } } export interface DocumentGenerateParams { /** * Props to pass to the document component */ props: Record; /** * Response format. `pdf` returns a binary PDF file, `base64` returns the PDF * encoded as base64 in JSON, `json` returns a URL to download the PDF. Defaults to * `pdf` */ format?: 'pdf' | 'base64' | 'json'; orientation?: 'portrait' | 'landscape'; /** * Page size (A3, A4, A5, letter, legal, or custom size like '8.5in 11in') */ size?: string; } export interface DocumentGenerateHTMLParams { /** * Response format. `pdf` returns a binary PDF file, `base64` returns the PDF * encoded as base64 in JSON, `json` returns a URL to download the PDF. Defaults to * `pdf` */ format?: 'pdf' | 'base64' | 'json'; /** * HTML content to convert to PDF or inject into the page at the specified URL */ html?: string; orientation?: 'portrait' | 'landscape'; /** * Page size (A3, A4, A5, letter, legal, or custom size like '8.5in 11in') */ size?: string; /** * URL of the webpage to convert to PDF or use as a base for HTML injection */ url?: string; } export declare namespace Documents { export { type DocumentGenerateResponse as DocumentGenerateResponse, type DocumentGenerateHTMLResponse as DocumentGenerateHTMLResponse, type DocumentGenerateParams as DocumentGenerateParams, type DocumentGenerateHTMLParams as DocumentGenerateHTMLParams, }; } //# sourceMappingURL=documents.d.ts.map