buildx-connect
Version:
Official JavaScript/TypeScript SDK for Buildx low-code platform
37 lines (36 loc) • 1.14 kB
TypeScript
import { ErrorResponse, SuccessResponse, BuildxConfig } from "../types/index";
/**
* Templates service for Buildx
* Handles template rendering and preview
*
* @example
* ```typescript
* const templates = buildx.templates();
*
* // Preview a template
* const preview = await templates.preview('template', { name: 'John' });
*
* // Render a template
* const rendered = await templates.render('template-id', { name: 'John' });
*
* // Generate PDF
* await templates.generatePDF('template-id', data);
* ```
*/
export declare class Templates {
private baseService;
constructor(config: BuildxConfig);
updateConfig(config: BuildxConfig): void;
/**
* Preview a template with data
*/
preview(template: any, data: any, projectId?: string): Promise<any | ErrorResponse>;
/**
* Render a template by ID with data
*/
render(templateId: string, data: any, projectId?: string): Promise<any | ErrorResponse>;
/**
* Render a template as PDF and download (browser only)
*/
renderPDF(templateId: string, data: any, projectId?: string): Promise<SuccessResponse | ErrorResponse>;
}