Pictogrammers / vue-icon

A Vue component to render an SVG path icon.
MIT License
26 stars 11 forks source link

Need support the typescript #10

Open Tyler-Franklin opened 2 years ago

Tyler-Franklin commented 2 years ago

thanks a lot

Subilan commented 2 years ago

same here

tristanlins commented 1 year ago

Add this to local *.d.ts file:

declare let SvgIcon: import("vue").DefineComponent<{
  type: {
    type: StringConstructor;
    default: string;
  };
  path: {
    type: StringConstructor;
    default: string;
  };
  size: {
    type: NumberConstructor;
    optional: boolean;
  };
  viewbox: {
    type: StringConstructor;
    optional: boolean;
  };
  flip: {
    type: StringConstructor;
    optional: boolean;
  };
  rotate: {
    type: StringConstructor;
    optional: boolean;
  };
}>;

declare module "@jamescoyle/vue-icon" {
  export default SvgIcon
}

Its just basic, but typescript compiler will complain less. 😉