Closed joelpierre closed 8 months ago
Hey @joelpierre, indeed this has changed and the types don't match anymore. It should look something like this:
export interface VideoProps {
src: string;
type: 'video';
title?: string;
width: number | null;
height: number | null;
handle?: string;
mimeType: string // we could also have a more restrict type here, but I'm not sure about all the options
}
If you could open a PR, this would be very much appreciated.
Nice one will do when I get a second. I will try today 👍🏽
I think mimeType being a string is fine FWIW too
@jpedroschmitz - PR here https://github.com/hygraph/rich-text/pull/117 not sure how you do your version bumps etc
Merged and release, @joelpierre! Thanks 🙏🏻
The Video Node Renderer has the following types:
type VideoNodeRenderer = (props: Partial<VideoProps>) => JSX.Element;
VideoProps is as follows:
However the RichText response is
I can't without fudging the types on my end access the mimeType or "type" properties. Also the width and height are not types correctly. They probably should be
Maybe<number>
I am happy to raise a pull request to fix if needed? I assume we should look at more of the responses too like Image and Audio?