Blame view

天文台pc/tianwentai-ui/node_modules/@mui/system/style/style.d.ts 1.18 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  import { CSSObject } from '@mui/styled-engine';
  export type PropsFor<SomeStyleFunction> = SomeStyleFunction extends StyleFunction<infer Props> ? Props : never;
  export type StyleFunction<Props> = (props: Props) => any;
  export type SimpleStyleFunction<PropKey extends keyof any> = StyleFunction<Partial<Record<PropKey, any>>> & {
    filterProps: string[];
  };
  export type TransformFunction = (cssValue: unknown, userValue: unknown) => number | string | React.CSSProperties | CSSObject;
  export interface StyleOptions<PropKey> {
    cssProperty?: PropKey | keyof React.CSSProperties | false | undefined;
    prop: PropKey;
    /**
     * dot access in `Theme`
     */
    themeKey?: string | undefined;
    transform?: TransformFunction | undefined;
  }
  export function getPath<T>(obj: T, path: string | undefined, checkVars?: boolean): null | unknown;
  export function getStyleValue(themeMapping: object | ((arg: any) => any), transform: TransformFunction | null, propValueFinal: unknown, userValue?: unknown): any;
  export default function style<PropKey extends string, Theme extends object>(options: StyleOptions<PropKey>): StyleFunction<{ [K in PropKey]?: unknown } & {
    theme?: Theme | undefined;
  }> & {
    filterProps: string[];
  };