Blame view

天文台pc/tianwentai-ui/node_modules/@mui/material/styles/createThemeNoVars.d.ts 3.13 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig } from '@mui/system';
  import { Mixins, MixinsOptions } from "./createMixins.js";
  import { Palette, PaletteOptions } from "./createPalette.js";
  import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
  import { Shadows } from "./shadows.js";
  import { Transitions, TransitionsOptions } from "./createTransitions.js";
  import { ZIndex, ZIndexOptions } from "./zIndex.js";
  import { Components } from "./components.js";
  import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions } from "./createThemeFoundation.js";
  
  /**
   * To disable custom properties, use module augmentation
   *
   * @example
   * declare module '@mui/material/styles' {
   *   interface CssThemeVariables {
   *     enabled: true;
   *   }
   * }
   */
  export interface CssThemeVariables {}
  type CssVarsOptions = CssThemeVariables extends {
    enabled: true;
  } ? ColorSystemOptions : {};
  export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVarsOptions {
    mixins?: MixinsOptions;
    components?: Components<Omit<Theme, 'components'>>;
    palette?: PaletteOptions;
    shadows?: Shadows;
    shape?: ShapeOptions;
    transitions?: TransitionsOptions;
    typography?: TypographyVariantsOptions | ((palette: Palette) => TypographyVariantsOptions);
    zIndex?: ZIndexOptions;
    unstable_strictMode?: boolean;
    unstable_sxConfig?: SxConfig;
    modularCssLayers?: boolean | string;
  }
  export interface BaseTheme extends SystemTheme {
    mixins: Mixins;
    palette: Palette & (CssThemeVariables extends {
      enabled: true;
    } ? CssVarsPalette : {});
    shadows: Shadows;
    shape: Shape;
    transitions: Transitions;
    typography: TypographyVariants;
    zIndex: ZIndex;
    unstable_strictMode?: boolean;
  }
  
  // shut off automatic exporting for the `BaseTheme` above
  export {};
  type CssVarsProperties = CssThemeVariables extends {
    enabled: true;
  } ? Pick<CssVarsTheme, 'applyStyles' | 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
  
  /**
   * Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
   */
  export interface Theme extends BaseTheme, CssVarsProperties {
    cssVariables?: false;
    components?: Components<BaseTheme>;
    unstable_sx: (props: SxProps<Theme>) => CSSObject;
    unstable_sxConfig: SxConfig;
    alpha: (color: string, value: number | string) => string;
    lighten: (color: string, coefficient: number | string) => string;
    darken: (color: string, coefficient: number | string) => string;
  }
  
  /**
   * Generate a theme base on the options received.
   * @param options Takes an incomplete theme object and adds the missing parts.
   * @param args Deep merge the arguments with the about to be returned theme.
   * @returns A complete, ready-to-use theme object.
   */
  export default function createThemeNoVars(options?: ThemeOptions, ...args: object[]): Theme;