Summary
ImageProps extends Experimental_GeneratedImage, which makes uint8Array required:
export type ImageProps = Experimental_GeneratedImage & {
className?: string;
alt?: string;
};
But the element only ever reads base64 and mediaType. Callers that have those two — an image-generation tool result, a stored image record, anything reconstructed from JSON — are forced to fabricate a uint8Array they don't need and the component never touches.
Suggestion
Make it optional while keeping it accepted:
export type ImageProps = Omit<Experimental_GeneratedImage, "uint8Array"> & {
uint8Array?: Experimental_GeneratedImage["uint8Array"];
className?: string;
alt?: string;
};
Backwards compatible — existing callers passing the full object still typecheck.
Context
Raising as an issue rather than a PR since it changes a public prop type and you may prefer a different shape. Happy to send the patch if the direction is right. We currently carry this as a downstream override and would rather not.
Summary
ImagePropsextendsExperimental_GeneratedImage, which makesuint8Arrayrequired:But the element only ever reads
base64andmediaType. Callers that have those two — an image-generation tool result, a stored image record, anything reconstructed from JSON — are forced to fabricate auint8Arraythey don't need and the component never touches.Suggestion
Make it optional while keeping it accepted:
Backwards compatible — existing callers passing the full object still typecheck.
Context
Raising as an issue rather than a PR since it changes a public prop type and you may prefer a different shape. Happy to send the patch if the direction is right. We currently carry this as a downstream override and would rather not.