Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript Types? #1

Open
GimpMaster opened this issue Aug 2, 2022 · 4 comments
Open

Typescript Types? #1

GimpMaster opened this issue Aug 2, 2022 · 4 comments

Comments

@GimpMaster
Copy link

Any chance you can generate typescript types so this can work with vite.config.ts files?

@JohnPremKumar
Copy link
Owner

JohnPremKumar commented Aug 10, 2022

It can be used in vite.config.ts and it should be working without any issues. But, support for TypeScript might be implemented if required in future versions.

@sey
Copy link

sey commented Aug 20, 2023

It would be great to have the type definitions for this package. It would prevent VS Code from complaining.

The workaround for now is to declare the module ourselves:

declare module "vite-plugin-favicons-inject";

And include that file in the proper tsconfig.

@Atulin
Copy link

Atulin commented Jun 22, 2024

No chance for types, I take it?

@elliotnash
Copy link

elliotnash commented Sep 7, 2024

No chance for types, I take it?

If anyone is looking to add their own type definitions, in your global.d.ts add

declare module 'vite-plugin-favicons-inject' {
  import type { Plugin } from 'vite';
  import type { FaviconOptions } from 'favicons';
  export type VPFIPluginConfig = {
    failGraciously?: boolean;
  };
  export default function vitePluginFaviconsInject(
    source: string,
    config?: FaviconOptions,
    pluginConfig?: VPFIPluginConfig,
  ): Plugin;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants