/******************************************************************************** * Copyright (c) 2026 EclipseSource and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the Eclipse * Public License v. 2.0 are satisfied: GNU General Public License, version 2 * with the GNU Classpath Exception which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { Action, ExportFormat, ExportMimeType, GModelRoot, PngExportOptions } from '@eclipse-glsp/sprotty'; import { DiagramExporter } from './diagram-exporter'; import { GLSPSvgExporter } from './glsp-svg-exporter'; /** * Default PNG strategy for the unified export registry. Reuses {@link GLSPSvgExporter}'s * SVG-rendering pipeline and rasterises the result client-side via `OffscreenCanvas`. * Adopters that need server-side rendering replace this binding with their own strategy. */ export declare class DefaultPngDiagramExporter implements DiagramExporter { readonly format: ExportFormat; readonly mimeType: ExportMimeType; readonly encoding: "base64"; protected svgExporter: GLSPSvgExporter; export(root: GModelRoot, options?: PngExportOptions, cause?: Action): Promise; /** * Rewrite the root `` tag so its rendered size matches the target raster dimensions. * Replaces `width`/`height` attributes and strips conflicting `style` declarations * (the SVG exporter emits `width: …px !important` on the inline style for viewer-friendly * display, which would otherwise win over the attributes). The existing `viewBox` * preserves the vector coordinate system so the content scales without distortion. */ protected applyRasterSize(svgString: string, width: number, height: number): string; protected computeDimensions(svgString: string, options: PngExportOptions): { width: number; height: number; }; /** * Read the aspect ratio from the root `` tag's `viewBox`, falling back to the * `width`/`height` attributes. GLSP-emitted SVGs always carry a `viewBox` (set by the * underlying sprotty exporter), so the fallback is a defensive safeguard. */ protected parseAspectRatio(svgString: string): number; protected rasterise(svgString: string, width: number, height: number, background: string): Promise; protected bitmapFromSvgUrl(url: string): Promise; protected blobToBase64(blob: Blob): Promise; } //# sourceMappingURL=default-png-diagram-exporter.d.ts.map