Skip to content

Commit

Permalink
Fix/video prop types (#117)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
joelpierre and jpedroschmitz authored Jan 20, 2024
1 parent 232e4da commit 86411d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-doors-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphcms/rich-text-types": patch
---

Fix/video prop types
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ package-lock.json
yarn.lock
!/yarn.lock
coverage/

.idea
10 changes: 7 additions & 3 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface Element {
| 'iframe'
| 'embed'
| 'code-block';

[key: string]: unknown;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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 {
Expand Down

0 comments on commit 86411d2

Please sign in to comment.