GitOfZGT / vite-plugin-theme-preprocessor

css theme preprocessor plugin for vite
MIT License
161 stars 15 forks source link

toggleTheme for typescript #46

Open hmz22 opened 2 years ago

hmz22 commented 2 years ago

toggleTheme don't work in ts. I add this:

declare module "@zougt/vite-plugin-theme-preprocessor/dist/browser-utils" {
  export function toggleTheme(options: {
    scopeName?: string;
    customLinkHref?: (href: string) => string;
  });

  export function addClassNameToHtmlTag(options: {
    scopeName?: string;
    multipleScopeVars: { scopeName: string; path?: string }[];
  });
}

but not work and when use toggle show me error in console: Screenshot 2022-07-04 171805

please help for fix it

hmz22 commented 2 years ago

when build project worked prefect but in development with typescript mode show this error multipleScopeVars is null or undefined. please add support typescript

Chasen-Zhang commented 2 years ago

How did you fix the bug @hmz22 image I have this errors yet

asnipera commented 2 years ago

@

How did you fix the bug @hmz22 image I have this errors yet add themePreprocessorPlugin, themePreprocessorHmrPlugin to vite plugins