From 8db493127a13ae2c58a2438a9b4eb5d5bfcc2054 Mon Sep 17 00:00:00 2001 From: Domino987 Date: Thu, 4 Apr 2019 14:09:05 +0200 Subject: [PATCH] [CardMedia] Allow generic component in TypeScript (#15098) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update CardMedia.d.ts … - [CardMedia] Allow generic component --- .../material-ui/src/CardMedia/CardMedia.d.ts | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/material-ui/src/CardMedia/CardMedia.d.ts b/packages/material-ui/src/CardMedia/CardMedia.d.ts index 70ebe52e0f0b27..8a3f294700ce2c 100644 --- a/packages/material-ui/src/CardMedia/CardMedia.d.ts +++ b/packages/material-ui/src/CardMedia/CardMedia.d.ts @@ -1,15 +1,22 @@ import * as React from 'react'; -import { StandardProps } from '..'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -export interface CardMediaProps - extends StandardProps, CardMediaClassKey> { - component?: React.ElementType; - image?: string; - src?: string; +interface CardMediaTypeMap { + props: P & { + image?: string; + src?: string; + }; + defaultComponent: D; + classKey: CardMediaClassKey; } +declare const CardMedia: OverridableComponent>; + export type CardMediaClassKey = 'root' | 'media'; -declare const CardMedia: React.ComponentType; +export type CardMediaProps = OverrideProps< + CardMediaTypeMap, + D +>; export default CardMedia;