Blame view

天文台pc/tianwentai-ui/node_modules/@mui/system/compose/compose.d.ts 702 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  import { StyleFunction } from "../style/index.js";
  
  /**
   * given a list of StyleFunction return the intersection of the props each individual
   * StyleFunction requires.
   *
   * If `firstFn` requires { color: string } and `secondFn` requires { spacing: number }
   * their composed function requires { color: string, spacing: number }
   */
  type ComposedArg<T> = T extends Array<(arg: infer P) => any> ? P : never;
  type ComposedOwnerState<T> = ComposedArg<T>;
  export type ComposedStyleFunction<T extends Array<StyleFunction<any>>> = StyleFunction<ComposedOwnerState<T>> & {
    filterProps: string[];
  };
  export default function compose<T extends Array<StyleFunction<any>>>(...args: T): ComposedStyleFunction<T>;