@types/vite-plugin-react-svg
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

Installation

npm install --save @types/vite-plugin-react-svg

Summary

This package contains type definitions for vite-plugin-react-svg (https://github.com/visualfanatic/vite-svg).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/vite-plugin-react-svg.

index.d.ts

import * as React from "react";
import { OptimizeOptions } from "svgo";
import { Plugin } from "vite";

interface Options {
    /**
     * Default behavior when importing `.svg` files, possible options are: `url` and `component`.
     *
     * Default value: `url`
     */
    defaultExport?: "url" | "component";
    /** Boolean flag to enable/disable SVGO */
    svgo?: boolean;
    /** Specify SVGO config */
    svgoConfig?: OptimizeOptions;
    /** Props to be forwarded on SVG tag, possible options: `start`, `end` or `false` */
    expandProps?: "start" | "end" | false;
    /** Setting this to `true` will forward ref to the root SVG tag */
    ref?: boolean;
    /** Setting this to `true` will wrap the exported component in `React.memo` */
    memo?: boolean;
    /**
     * Replace an attribute value by another.
     * The main usage of this option is to change an icon color to `currentColor` in order to inherit from text color.
     */
    replaceAttrValues?: Record<string, unknown>;
    /** Add props to the root SVG tag */
    svgProps?: React.SVGAttributes<SVGSVGElement>;
    /** Add title tag via `title` property */
    titleProp?: boolean;
}

declare function reactSvgPlugin(options?: Options): Plugin;

export = reactSvgPlugin;

Additional Details

Credits

These definitions were written by Priyanshu Rav.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/vite-plugin-react-svg

Weekly Downloads

2,551

Version

0.2.5

License

MIT

Unpacked Size

5.47 kB

Total Files

5

Last publish

Collaborators

  • types