index.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { Plugin } from 'vite';
  2. export { default as tinycolor } from 'tinycolor2';
  3. declare function mixLighten(colorStr: string, weight: number): string;
  4. declare function mixDarken(colorStr: string, weight: number): string;
  5. declare function mix(color1: string, color2: string, weight: number, alpha1?: number, alpha2?: number): string;
  6. declare function toNum3(colorStr: string): number[];
  7. declare function dropPrefix(colorStr: string): string;
  8. declare function pad2(num: number): string;
  9. interface AntdDarkThemeOption {
  10. darkModifyVars?: any;
  11. fileName?: string;
  12. verbose?: boolean;
  13. selector?: string;
  14. filter?: (id: string) => boolean;
  15. extractCss?: boolean;
  16. preloadFiles?: string[];
  17. loadMethod?: 'link' | 'ajax';
  18. }
  19. declare function antdDarkThemePlugin(options: AntdDarkThemeOption): Plugin[];
  20. declare type ResolveSelector = (selector: string) => string;
  21. declare type InjectTo = 'head' | 'body' | 'body-prepend';
  22. interface ViteThemeOptions {
  23. colorVariables: string[];
  24. wrapperCssSelector?: string;
  25. resolveSelector?: ResolveSelector;
  26. customerExtractVariable?: (code: string) => string;
  27. fileName?: string;
  28. injectTo?: InjectTo;
  29. verbose?: boolean;
  30. }
  31. declare function viteThemePlugin(opt: ViteThemeOptions): Plugin[];
  32. export { InjectTo, ResolveSelector, ViteThemeOptions, antdDarkThemePlugin, dropPrefix, mix, mixDarken, mixLighten, pad2, toNum3, viteThemePlugin };