import * as CSS from 'csstype'; import { CSSObject } from '@mui/styled-engine'; import { StandardCSSProperties } from './StandardCssProperties'; import { AliasesCSSProperties } from './AliasesCSSProperties'; import { OverwriteCSSProperties } from './OverwriteCSSProperties'; /** * The `css` function accepts arrays as values for mobile-first responsive styles. * 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 }; /** * Map of all CSS pseudo selectors (`:hover`, `:focus`, ...). */ export type CSSPseudoSelectorProps = { [K in CSS.Pseudos]?: ((theme: Theme) => SystemStyleObject) | SystemStyleObject; }; /** * Map all nested selectors. */ export interface CSSSelectorObject { [cssSelector: string]: ((theme: Theme) => SystemStyleObject) | SystemStyleObject; } type CssVariableType = string | number; /** * Map all nested selectors and CSS variables. */ export interface CSSSelectorObjectOrCssVariables { [cssSelectorOrVariable: string]: | ((theme: Theme) => SystemStyleObject | string | number) | SystemStyleObject | CssVariableType; } /** * Map of all available CSS properties (including aliases) and their raw value. * Only used internally to map CSS properties to input types (responsive value, * theme function or nested) in `SystemCssProperties`. */ export interface AllSystemCSSProperties extends Omit, OverwriteCSSProperties, AliasesCSSProperties {} export type SystemCssProperties = { [K in keyof AllSystemCSSProperties]: | ResponsiveStyleValue | ((theme: Theme) => ResponsiveStyleValue) | SystemStyleObject; }; /** * The `SystemStyleObject` defines custom properties that will be transformed to * their corresponding values from the `Theme`. Other valid CSS properties are also allowed. */ export type SystemStyleObject = | SystemCssProperties | CSSPseudoSelectorProps | CSSSelectorObjectOrCssVariables | null; /** * The `SxProps` can be either object or function */ export type SxProps = | SystemStyleObject | ((theme: Theme) => SystemStyleObject) | ReadonlyArray< boolean | SystemStyleObject | ((theme: Theme) => SystemStyleObject) >; export interface StyleFunctionSx { (props: object): CSSObject; filterProps?: string[]; } // eslint-disable-next-line @typescript-eslint/naming-convention export function unstable_createStyleFunctionSx( styleFunctionMapping: Record, ): StyleFunctionSx; declare const styleFunctionSx: StyleFunctionSx; export default styleFunctionSx;