From 1511a7f7a5fdb428a8bcc4e59402b5b5fe7f956d Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Wed, 7 Feb 2024 11:09:02 +0700 Subject: [PATCH] use ReadonlyArray --- packages/mui-styled-engine/src/index.d.ts | 6 +++--- .../mui-system/src/styleFunctionSx/styleFunctionSx.d.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mui-styled-engine/src/index.d.ts b/packages/mui-styled-engine/src/index.d.ts index bb369ddf08e22a..4bc50bc1452bda 100644 --- a/packages/mui-styled-engine/src/index.d.ts +++ b/packages/mui-styled-engine/src/index.d.ts @@ -35,7 +35,7 @@ export interface SerializedStyles { export type CSSProperties = CSS.PropertiesFallback; export type CSSPropertiesWithMultiValues = { - [K in keyof CSSProperties]: CSSProperties[K] | Array>; + [K in keyof CSSProperties]: CSSProperties[K] | ReadonlyArray>; }; // TODO v6 - check if we can drop the unknown, as it breaks the autocomplete @@ -49,7 +49,7 @@ export interface CSSOthersObject { } export type CSSPseudosForCSSObject = { [K in CSS.Pseudos]?: CSSObject }; -export interface ArrayCSSInterpolation extends Array {} +export interface ArrayCSSInterpolation extends ReadonlyArray {} export interface CSSOthersObjectForCSSObject { [propertiesName: string]: CSSInterpolation; @@ -98,7 +98,7 @@ export interface FunctionInterpolation { (props: Props): Interpolation; } -export interface ArrayInterpolation extends Array> {} +export interface ArrayInterpolation extends ReadonlyArray> {} export type Interpolation = | InterpolationPrimitive diff --git a/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts b/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts index 929177b4cd99ee..6d373d0ae5e74f 100644 --- a/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts +++ b/packages/mui-system/src/styleFunctionSx/styleFunctionSx.d.ts @@ -9,7 +9,7 @@ import { OverwriteCSSProperties } from './OverwriteCSSProperties'; * Note that this extends to non-theme values also. For example `display=['none', 'block']` * will also works. */ -export type ResponsiveStyleValue = T | Array | { [key: string]: T | null }; +export type ResponsiveStyleValue = T | ReadonlyArray | { [key: string]: T | null }; /** * Map of all CSS pseudo selectors (`:hover`, `:focus`, ...).