import { ElementNode } from '../../util/xml.js'; import { IDMLSpreadPackageContext } from '../SpreadPackage.js'; import { GeometricSprite, GeometricSpriteOpts } from './GeometricSprite.js'; import { type SvgViewBox } from '../../util/svgViewBox.js'; export type GraphicBounds = { left: number; top: number; right: number; bottom: number; }; export declare class ImageSprite extends GeometricSprite { private contents?; private graphicBounds?; linkURI?: string; private graphicType; private actualPpi?; constructor(id: string, contents: ArrayBuffer | undefined, graphicBounds: GraphicBounds | undefined, opts: GeometricSpriteOpts, context: IDMLSpreadPackageContext, linkURI?: string, graphicType?: string, actualPpi?: { x: number; y: number; }); /** The original linked resource URI (e.g. `file:/…/cover.png`), if any. */ getLinkURI(): string | undefined; /** The source IDML tag ('Image' | 'PDF' | 'EPS' | 'WMF' | 'SVG'). */ getGraphicType(): string; /** True for placed vector graphics (PDF/EPS/WMF/SVG) whose embedded bytes are * not a browser-renderable raster — they must be supplied via their link instead. */ isVectorGraphic(): boolean; /** Embedded bytes only when they are a usable raster (a real ``). * Vector graphics return undefined so they fall back to their link + placeholder. */ getRasterContents(): ArrayBuffer | undefined; protected serializeTagName(): string; getImageType(): Promise; getContents(): ArrayBuffer | undefined; /** * Natural pixel size from IDML metadata alone: GraphicBounds (points, the * image's untransformed bounds) × ActualPpi / 72. This is the source of * truth for linked images whose bytes are not embedded (e.g. a linked PSD), * where decoding is impossible but the crop still has to map to real source * pixels of the (externally converted) file. */ getMetadataNaturalSize(): { width: number; height: number; } | undefined; getNaturalSize(): Promise<{ width: number; height: number; }>; getBBox(): { x: number; y: number; width: number; height: number; } | undefined; /** The SVG's `viewBox` (its RENDERED coordinate extent) from EMBEDDED bytes, or undefined * for a non-SVG / linked SVG (whose bytes reach the converter, which supplies the viewBox * separately). The IDML GraphicBounds is the CONTENT bbox (InDesign auto-crops the artboard * padding); a crop must be expressed against the viewBox — see {@link viewBoxToBBox}. */ getSvgViewBox(): SvgViewBox | undefined; /** Map an SVG viewBox rect (in the SVG's user space, same space as GraphicBounds) into the * page-normalized bbox space `getBBox` uses — so it can serve as the crop reference `ib` * for the RENDERED extent (the whole artboard) instead of just the cropped content. */ viewBoxToBBox(vb: SvgViewBox): { x: number; y: number; width: number; height: number; }; setBBox(x: number, y: number, width: number, height: number): void; serialize(): ElementNode; static parseGraphicBounds(element: Element): { left: number; top: number; right: number; bottom: number; }; static parseElement(element: Element, context: IDMLSpreadPackageContext): ImageSprite; } //# sourceMappingURL=Image.d.ts.map