Skip to content

[pickers] Declaration files don't type-check with TypeScript 4.8 #6134

Closed
@Methuselah96

Description

@Methuselah96

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

The declaration files currently have a error with TypeScript 4.8:

ERROR in node_modules/@mui/x-date-pickers/internals/models/muiPickersAdapter.d.ts:2:55
TS2344: Type 'TDate' does not satisfy the constraint 'ExtendableDateType'.
    1 | import { IUtils } from '@date-io/core/IUtils';
  > 2 | export declare type MuiPickersAdapter<TDate> = IUtils<TDate>;
      |                                                       ^^^^^
    3 | export declare type MuiDateSectionName = 'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'am-pm';
    4 | export declare type MuiFormatTokenMap = {
    5 |     [formatToken: string]: MuiDateSectionName;

Expected behavior 🤔

The declaration files should not have an error with TypeScript 4.8.

Steps to reproduce 🕹

Create TypeScript 4.8 project with @mui/x-date-pickers with skipLibCheck turned off.

Context 🔦

I noticed this was addressed in #5935, but wanted to make sure that the fix made it into v5 since the release notes for the latest v5 release mentioned that this was the last scheduled regular release for v5.

Your environment 🌎

N/A

Order ID 💳 (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: pickersThis is the name of the generic UI component, not the React module!typescript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions