/** * Generate Document Service * Generates a document from a template without uploading */ import type { GenerateDocumentRequest } from '@plyaz/types/api'; import type { ServiceOptions } from '@plyaz/types/api'; import type { EndpointsList } from '@/api/endpoints'; import type { FetchResponse } from 'fetchff'; /** * Generate a document from a template * Uses endpoint: POST /generate-document * * Returns the generated document as a base64-encoded buffer without uploading. * Useful for preview or direct download scenarios. * * @param data - Document generation request data * @param options - Optional service options (client override, config overrides) * @returns Promise * * @example * ```typescript * // Generate a PDF invoice * const result = await generateDocument({ * templateId: 'invoices/standard-invoice', * templateData: { * invoiceNumber: 'INV-001', * customerName: 'John Doe', * items: [{ description: 'Product', quantity: 2, unitPrice: 50 }], * }, * outputFormat: 'pdf', * }); * * // The result.buffer is base64 encoded * const pdfBlob = new Blob([ * Uint8Array.from(atob(result.buffer), c => c.charCodeAt(0)) * ], { type: 'application/pdf' }); * ``` * * @throws {ApiPackageError} When document generation fails */ export declare function generateDocument(data: GenerateDocumentRequest, options?: ServiceOptions): Promise; //# sourceMappingURL=generateDocument.d.ts.map