From 86411d2ca48761ad4f0d2dba141abfa3b77f050c Mon Sep 17 00:00:00 2001 From: Joel Pierre <8969851+joelpierre@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:35:31 +0000 Subject: [PATCH] Fix/video prop types (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update types for video and image tag * chore: remove .idea from git * Create sharp-doors-rest.md --------- Co-authored-by: João Pedro Schmitz --- .changeset/sharp-doors-rest.md | 5 +++++ .gitignore | 2 ++ packages/types/src/index.ts | 10 +++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/sharp-doors-rest.md diff --git a/.changeset/sharp-doors-rest.md b/.changeset/sharp-doors-rest.md new file mode 100644 index 0000000..5cae252 --- /dev/null +++ b/.changeset/sharp-doors-rest.md @@ -0,0 +1,5 @@ +--- +"@graphcms/rich-text-types": patch +--- + +Fix/video prop types diff --git a/.gitignore b/.gitignore index ff57de7..f44984c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ package-lock.json yarn.lock !/yarn.lock coverage/ + +.idea diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 2d56928..480f984 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -26,6 +26,7 @@ export interface Element { | 'iframe' | 'embed' | 'code-block'; + [key: string]: unknown; } @@ -78,12 +79,13 @@ export interface LinkElement extends LinkProps, Element { } export interface ImageProps { + type: 'image'; src: string; title?: string; width?: number; height?: number; handle?: string; - mimeType?: AssetMimeTypes; + mimeType?: ImageMimeTypes; altText?: string; } @@ -93,10 +95,12 @@ export interface ImageElement extends ImageProps, Element { export interface VideoProps { src: string; + type: 'video'; title?: string; - width?: number; - height?: number; + width: number | null; + height: number | null; handle?: string; + mimeType: VideoMimeTypes; } export interface VideoElement extends VideoProps, Element {