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

    0.2.1 • 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

    // Type definitions for vite-plugin-react-svg 0.2
    // Project: https://github.com/visualfanatic/vite-svg
    // Definitions by: Priyanshu Rav <https://github.com/priyanshurav>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // Minimum TypeScript Version: 4.0
    
    import { Plugin } from 'vite';
    import { OptimizeOptions } from 'svgo';
    import * as React from 'react';
    
    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.

    Keywords

    none

    Install

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

    DownloadsWeekly Downloads

    1,171

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    5.97 kB

    Total Files

    4

    Last publish

    Collaborators

    • types