diff --git a/packages/mui-material/src/AppBar/AppBar.d.ts b/packages/mui-material/src/AppBar/AppBar.d.ts index 2d0388405baca2..93be380f80e91b 100644 --- a/packages/mui-material/src/AppBar/AppBar.d.ts +++ b/packages/mui-material/src/AppBar/AppBar.d.ts @@ -1,16 +1,16 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; -import { DistributiveOmit, OverridableStringUnion } from '@mui/types'; +import { OverridableStringUnion } from '@mui/types'; import { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent'; import { PropTypes, Theme } from '..'; -import { PaperProps } from '../Paper'; import { AppBarClasses } from './appBarClasses'; +import { ExtendPaperTypeMap } from '../Paper/Paper'; export interface AppBarPropsColorOverrides {} -export interface AppBarTypeMap

{ - props: P & - DistributiveOmit & { +export type AppBarTypeMap

= ExtendPaperTypeMap< + { + props: P & { /** * Override or extend the styles applied to the component. */ @@ -39,8 +39,10 @@ export interface AppBarTypeMap

{ */ sx?: SxProps; }; - defaultComponent: D; -} + defaultComponent: D; + }, + 'position' | 'color' | 'classes' +>; /** * diff --git a/packages/mui-material/src/AppBar/AppBar.spec.tsx b/packages/mui-material/src/AppBar/AppBar.spec.tsx index 8600ddcd018553..5cd01d7d44537a 100644 --- a/packages/mui-material/src/AppBar/AppBar.spec.tsx +++ b/packages/mui-material/src/AppBar/AppBar.spec.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import AppBar from '@mui/material/AppBar'; +import { expectType } from '@mui/types'; const CustomComponent: React.FC<{ stringProp: string; numberProp: number }> = function CustomComponent() { @@ -12,7 +13,13 @@ function AppBarTest() { - + { + expectType, typeof event>(event); + }} + /> {/* @ts-expect-error missing stringProp and numberProp */}