import { ImageRun } from '../../../../../../../../layout-engine/contracts/src/index.js';
import { PMNode } from '../../types.js';
import { InlineConverterParams } from './common.js';
/**
 * Converts an image PM node to an ImageRun for inline rendering.
 *
 * Extracts all necessary properties from the node including:
 * - Image source and dimensions (from attrs.size, NOT attrs.width/height)
 * - Spacing attributes (distT/distB/distL/distR from wrap.attrs)
 * - Position tracking (pmStart/pmEnd)
 * - SDT metadata if present
 *
 * IMPORTANT: Dimensions are read from attrs.size, NOT from attrs.width/height.
 * This is because Word documents store image dimensions in a nested size object.
 *
 * ERROR CONDITIONS:
 * - Returns null if node.attrs.src is missing or empty
 * - Falls back to DEFAULT_IMAGE_DIMENSION_PX for invalid/missing dimensions
 *
 * @param node - Image PM node containing image metadata in attrs
 * @param positions - Position map for ProseMirror node tracking (pmStart/pmEnd)
 * @param activeSdt - Optional active SDT metadata to attach to the ImageRun
 * @returns ImageRun object with all extracted properties, or null if src is missing
 *
 * @example
 * ```typescript
 * // Successful conversion with all properties
 * imageNodeToRun(
 *   {
 *     type: 'image',
 *     attrs: {
 *       src: 'data:image/png;base64,iVBORw...',
 *       size: { width: 200, height: 150 },
 *       alt: 'Company logo',
 *       wrap: { attrs: { distTop: 10, distBottom: 10 } }
 *     }
 *   },
 *   positionMap
 * )
 * // Returns: { kind: 'image', src: 'data:...', width: 200, height: 150, alt: 'Company logo', distTop: 10, distBottom: 10, verticalAlign: 'top' }
 *
 * // Missing src - returns null
 * imageNodeToRun({ type: 'image', attrs: {} }, positionMap)
 * // Returns: null
 *
 * // Invalid dimensions - uses defaults
 * imageNodeToRun(
 *   { type: 'image', attrs: { src: 'image.png', size: { width: NaN, height: -10 } } },
 *   positionMap
 * )
 * // Returns: { kind: 'image', src: 'image.png', width: 100, height: 100, verticalAlign: 'top' }
 * ```
 */
export declare function imageNodeToRun({ node, positions, sdtMetadata }: InlineConverterParams): ImageRun | null;
/**
 * Detects if an image node should be rendered inline (as ImageRun) vs. as a separate block (ImageBlock).
 *
 * CRITICAL: Must check RAW attributes BEFORE normalization, because normalizeWrap() would discard
 * the wrap.type === 'Inline' information.
 *
 * Priority order (highest to lowest):
 * 1. wrap.type === 'Inline' - Authoritative signal for inline rendering
 * 2. wrap.type !== 'Inline' - Any other wrap type (Tight, Square, etc.) means block-level
 * 3. attrs.inline === true - Legacy fallback for inline detection
 * 4. attrs.display === 'inline' - Additional fallback for inline detection
 * 5. Default: false (treat as block-level image)
 *
 * @param node - Image node to check for inline rendering indicators
 * @returns true if image should be rendered inline (as ImageRun), false for block-level (as ImageBlock)
 *
 * @example
 * ```typescript
 * // Inline image (explicit wrap type)
 * isInlineImage({ type: 'image', attrs: { wrap: { type: 'Inline' } } })
 * // Returns: true
 *
 * // Block image (anchored wrap type)
 * isInlineImage({ type: 'image', attrs: { wrap: { type: 'Tight' } } })
 * // Returns: false
 *
 * // Inline image (legacy attribute)
 * isInlineImage({ type: 'image', attrs: { inline: true } })
 * // Returns: true
 *
 * // Block image (default behavior)
 * isInlineImage({ type: 'image', attrs: {} })
 * // Returns: false
 * ```
 */
export declare function isInlineImage(node: PMNode): boolean;
//# sourceMappingURL=image.d.ts.map