import {GestureResponderEvent, StyleProp, TextStyle} from 'react-native';
import {MixedStyleDeclaration, RenderersProps} from 'react-native-render-html';

export interface HtmlRenderProps {
  html: string;
  contentWidth?: number;
  onLoaded?: () => void;
  onLinkPress?: (event: GestureResponderEvent, href: string) => void;
  textStyle?: StyleProp<TextStyle>;
  androidLayerType?: string;
  tagsStyles?: Record<string, MixedStyleDeclaration>;
  numberOfLines?: number;
  hasCustomVideoControl?: boolean;
  resizeAndAlignMultimedia?: boolean;
  baseStyle?: StyleProp<TextStyle>;
}

/**
 * The library types `renderersProps.img` strictly; our `CustomImageRenderer`
 * reads an extra `resizeAndAlignMultimedia` flag, so we widen the slot via a
 * narrow intersection (no `any`) to keep autocompletion + safety.
 */
export type CustomImgRendererProps = RenderersProps['img'] & {
  resizeAndAlignMultimedia?: boolean;
};
