react-modern-gantt
Version:
A modern, customizable Gantt chart component for React applications with export functionality
56 lines (55 loc) • 1.72 kB
TypeScript
import { ExportOptions, ExportFormat, ExportResult } from "@/types";
/**
* Service for exporting Gantt chart as image or PDF
* Uses html2canvas for DOM capture and jspdf for PDF generation
*/
export declare class ExportService {
private static prepareCloneForExport;
/**
* Export the Gantt chart element to the specified format
*/
static export(element: HTMLElement, options?: ExportOptions): Promise<ExportResult>;
/**
* Export as PNG image
*/
private static exportAsPng;
/**
* Export as JPEG image
*/
private static exportAsJpeg;
/**
* Export as PDF document
*/
private static exportAsPdf;
/**
* Get data URL without downloading (useful for previews)
*/
static getDataUrl(element: HTMLElement, format?: ExportFormat, options?: Omit<ExportOptions, "format" | "filename">): Promise<string | null>;
/**
* Get as Blob (useful for uploading or processing)
*/
static getBlob(element: HTMLElement, format?: ExportFormat, options?: Omit<ExportOptions, "format" | "filename">): Promise<Blob | null>;
/**
* Copy chart to clipboard as image
*/
static copyToClipboard(element: HTMLElement, options?: Omit<ExportOptions, "format" | "filename">): Promise<boolean>;
/**
* Helper to download file from data URL
*/
private static downloadFile;
/**
* Dynamically load html2canvas
*/
private static loadHtml2Canvas;
/**
* Dynamically load jsPDF
*/
private static loadJsPDF;
/**
* Check if export dependencies are available
*/
static checkDependencies(): Promise<{
html2canvas: boolean;
jspdf: boolean;
}>;
}