Skip to content

Commit

Permalink
use ReadonlyArray
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Feb 7, 2024
1 parent fe2af84 commit a900b56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/mui-styled-engine/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface SerializedStyles {

export type CSSProperties = CSS.PropertiesFallback<number | string>;
export type CSSPropertiesWithMultiValues = {
[K in keyof CSSProperties]: CSSProperties[K] | Array<Extract<CSSProperties[K], string>>;
[K in keyof CSSProperties]: CSSProperties[K] | ReadonlyArray<Extract<CSSProperties[K], string>>;
};

// TODO v6 - check if we can drop the unknown, as it breaks the autocomplete
Expand All @@ -49,7 +49,7 @@ export interface CSSOthersObject {
}
export type CSSPseudosForCSSObject = { [K in CSS.Pseudos]?: CSSObject };

export interface ArrayCSSInterpolation extends Array<CSSInterpolation> {}
export interface ArrayCSSInterpolation extends ReadonlyArray<CSSInterpolation> {}

export interface CSSOthersObjectForCSSObject {
[propertiesName: string]: CSSInterpolation;
Expand Down Expand Up @@ -98,7 +98,7 @@ export interface FunctionInterpolation<Props> {
(props: Props): Interpolation<Props>;
}

export interface ArrayInterpolation<Props> extends Array<Interpolation<Props>> {}
export interface ArrayInterpolation<Props> extends ReadonlyArray<Interpolation<Props>> {}

export type Interpolation<Props> =
| InterpolationPrimitive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> = T | Array<T | null> | { [key: string]: T | null };
export type ResponsiveStyleValue<T> = T | ReadonlyArray<T | null> | { [key: string]: T | null };

/**
* Map of all CSS pseudo selectors (`:hover`, `:focus`, ...).
Expand Down

0 comments on commit a900b56

Please sign in to comment.