MUI5 自定义排版打字稿指南不正确?

MUI5 custom typography typescript guide incorrect?

我正在尝试按照本指南 https://mui.com/customization/typography/#adding-amp-disabling-variants 在 MUI5 中设置自定义排版变体。当我在步骤 2 中添加类型定义时

declare module '@mui/material/styles' {
  interface TypographyVariants {
    poster: React.CSSProperties;
  }

  // allow configuration using `createTheme`
  interface TypographyVariantsOptions {
    poster?: React.CSSProperties;
  }
}

// Update the Typography's variant prop options
declare module '@mui/material/Typography' {
  interface TypographyPropsVariantOverrides {
    poster: true;
    h3: false;
  }
}

到一个名为 typography.d.ts 的文件中,并将示例换成我实际使用的内容,它似乎覆盖了整个模块,我开始看到类似

的错误
JSX element type 'Typography' does not have any construct or call signatures.

尝试使用排版组件时,或

Module '"@mui/material/styles"' has no exported member 'createTheme'.

尝试创建主题时。

有什么想法吗?

问题是它在 *.d.ts 文件中;当我将打字移动到普通的 *.ts 文件中时,所有警告都消失了。