Skip to content

Commit

Permalink
Better typings
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Jul 16, 2024
1 parent fad5c17 commit 8f90559
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/components/Image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,31 @@ import {
} from '../NakedImage/utils';
import { Sizer } from './Sizer';

type Maybe<T> = T | null;

export type ResponsiveImageType = {
/** The aspect ratio (width/height) of the image */
aspectRatio?: number;
/** A base64-encoded thumbnail to offer during image loading */
base64?: string;
base64?: Maybe<string>;
/** The height of the image */
height?: number;
height?: Maybe<number>;
/** The width of the image */
width: number;
/** The aspect ratio (width/height) of the image */
aspectRatio?: number;
/** The HTML5 `sizes` attribute for the image */
sizes?: string;
sizes?: Maybe<string>;
/** The fallback `src` attribute for the image */
src?: string;
src?: Maybe<string>;
/** The HTML5 `srcSet` attribute for the image */
srcSet?: string;
srcSet?: Maybe<string>;
/** The HTML5 `srcSet` attribute for the image in WebP format, for browsers that support the format */
webpSrcSet?: string;
webpSrcSet?: Maybe<string>;
/** The background color for the image placeholder */
bgColor?: string;
bgColor?: Maybe<string>;
/** Alternate text (`alt`) for the image */
alt?: string;
alt?: Maybe<string>;
/** Title attribute (`title`) for the image */
title?: string;
title?: Maybe<string>;
};

type State = {
Expand Down

0 comments on commit 8f90559

Please sign in to comment.