From 934fb17d0a94b61ecbad337dd2d20aa74f52c6f8 Mon Sep 17 00:00:00 2001 From: Alec Caputo Date: Thu, 6 Feb 2020 18:06:07 -0500 Subject: [PATCH 1/3] export more types for typography - export useful TS types for typography which were hard to discover - Remove unused code --- .../material-ui/src/Typography/Typography.d.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/material-ui/src/Typography/Typography.d.ts b/packages/material-ui/src/Typography/Typography.d.ts index 1cadd8234ea8c7..4e2fa1899e1024 100644 --- a/packages/material-ui/src/Typography/Typography.d.ts +++ b/packages/material-ui/src/Typography/Typography.d.ts @@ -1,13 +1,15 @@ import * as React from 'react'; -import { StandardProps, PropTypes } from '..'; -import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent'; +import { PropTypes } from '..'; +import { OverrideProps, OverridableComponent } from '../OverridableComponent'; import { Variant as ThemeVariant } from '../styles/createTypography'; -type Variant = ThemeVariant | 'srOnly'; +export type TypographyVariant = ThemeVariant | 'srOnly'; + +export type TypographyAlignment = PropTypes.Alignment; export interface TypographyTypeMap

{ props: P & { - align?: PropTypes.Alignment; + align?: TypographyAlignment; color?: | 'initial' | 'inherit' @@ -20,8 +22,8 @@ export interface TypographyTypeMap

gutterBottom?: boolean; noWrap?: boolean; paragraph?: boolean; - variant?: Variant | 'inherit'; - variantMapping?: Partial>; + variant?: TypographyVariant | 'inherit'; + variantMapping?: Partial>; }; defaultComponent: D; classKey: TypographyClassKey; From 6b615002dff4ae50294655bff86f1f4defa34a52 Mon Sep 17 00:00:00 2001 From: Alec Caputo Date: Fri, 7 Feb 2020 08:34:03 -0500 Subject: [PATCH 2/3] just variant --- packages/material-ui/src/Typography/Typography.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/material-ui/src/Typography/Typography.d.ts b/packages/material-ui/src/Typography/Typography.d.ts index 4e2fa1899e1024..8a38a5685c62c5 100644 --- a/packages/material-ui/src/Typography/Typography.d.ts +++ b/packages/material-ui/src/Typography/Typography.d.ts @@ -5,11 +5,9 @@ import { Variant as ThemeVariant } from '../styles/createTypography'; export type TypographyVariant = ThemeVariant | 'srOnly'; -export type TypographyAlignment = PropTypes.Alignment; - export interface TypographyTypeMap

{ props: P & { - align?: TypographyAlignment; + align?: PropTypes.Alignment; color?: | 'initial' | 'inherit' From 1ed5965074cd8fbd7d3471cbbc962bc849481cab Mon Sep 17 00:00:00 2001 From: Alec Caputo Date: Thu, 13 Feb 2020 08:18:59 -0500 Subject: [PATCH 3/3] export variant from create typography --- packages/material-ui/src/Typography/Typography.d.ts | 10 +++++----- packages/material-ui/src/styles/index.d.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/material-ui/src/Typography/Typography.d.ts b/packages/material-ui/src/Typography/Typography.d.ts index 763b1c9879904b..e2a04c1bb5c436 100644 --- a/packages/material-ui/src/Typography/Typography.d.ts +++ b/packages/material-ui/src/Typography/Typography.d.ts @@ -1,9 +1,9 @@ import * as React from 'react'; -import { PropTypes } from '..'; -import { OverrideProps, OverridableComponent } from '../OverridableComponent'; +import { StandardProps, PropTypes } from '..'; +import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent'; import { Variant as ThemeVariant } from '../styles/createTypography'; -export type TypographyVariant = ThemeVariant | 'srOnly'; +type Variant = ThemeVariant | 'srOnly'; export interface TypographyTypeMap

{ props: P & { @@ -20,8 +20,8 @@ export interface TypographyTypeMap

gutterBottom?: boolean; noWrap?: boolean; paragraph?: boolean; - variant?: TypographyVariant | 'inherit'; - variantMapping?: Partial>; + variant?: Variant | 'inherit'; + variantMapping?: Partial>; }; defaultComponent: D; classKey: TypographyClassKey; diff --git a/packages/material-ui/src/styles/index.d.ts b/packages/material-ui/src/styles/index.d.ts index 74d23342c2d23d..bb7805447d4a06 100644 --- a/packages/material-ui/src/styles/index.d.ts +++ b/packages/material-ui/src/styles/index.d.ts @@ -6,7 +6,7 @@ export { SimplePaletteColorOptions, } from './createPalette'; export { default as createStyles } from './createStyles'; -export { TypographyStyle } from './createTypography'; +export { TypographyStyle, Variant as TypographyVariant } from './createTypography'; export { default as makeStyles } from './makeStyles'; export { default as responsiveFontSizes } from './responsiveFontSizes'; export { ComponentsPropsList } from './props';