JohnPremKumar / vite-plugin-favicons-inject

A Vite plugin for creating and injecting favicons during the application build!
MIT License
10 stars 3 forks source link

Typescript Types? #1

Open GimpMaster opened 2 years ago

GimpMaster commented 2 years ago

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

JohnPremKumar commented 2 years ago

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 commented 1 year ago

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 commented 4 months ago

No chance for types, I take it?

elliotnash commented 2 months ago

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;
}