@svgr/core

  • Version 6.2.1
  • Published
  • 27.4 kB
  • 3 dependencies
  • MIT license

Install

npm i @svgr/core
yarn add @svgr/core
pnpm add @svgr/core

Overview

Transform SVG into React Components.

Index

Variables

variable DEFAULT_CONFIG

const DEFAULT_CONFIG: Config;

    variable loadConfig

    const loadConfig: {
    (
    { configFile, ...baseConfig }: Config,
    state?: Pick<State, 'filePath'>
    ): Promise<Config>;
    sync(
    { configFile, ...baseConfig }: Config,
    state?: Pick<State, 'filePath'>
    ): Config;
    };

      variable resolveConfig

      const resolveConfig: {
      (
      searchFrom?: string | undefined,
      configFile?: string | undefined
      ): Promise<Config | null>;
      sync(
      searchFrom?: string | undefined,
      configFile?: string | undefined
      ): Config | null;
      };

        variable resolveConfigFile

        const resolveConfigFile: {
        (filePath: string): Promise<string | null>;
        sync(filePath: string): string | null;
        };

          variable transform

          const transform: {
          (code: string, config?: Config, state?: Partial<State>): Promise<string>;
          sync(code: string, config?: Config, state?: Partial<State>): string;
          };

            Interfaces

            interface Config

            interface Config {}

              property configFile

              configFile?: string;

                property dimensions

                dimensions?: boolean;

                  property expandProps

                  expandProps?: boolean | 'start' | 'end';

                    property exportType

                    exportType?: 'named' | 'default';

                      property icon

                      icon?: boolean | string | number;

                        property index

                        index?: boolean;

                          property jsx

                          jsx?: {
                          babelConfig?: TransformOptions;
                          };

                            property jsxRuntime

                            jsxRuntime?: 'classic' | 'classic-preact' | 'automatic';

                              property memo

                              memo?: boolean;

                                property namedExport

                                namedExport?: string;

                                  property native

                                  native?: boolean;

                                    property plugins

                                    plugins?: ConfigPlugin[];

                                      property prettier

                                      prettier?: boolean;

                                        property prettierConfig

                                        prettierConfig?: Options;

                                          property ref

                                          ref?: boolean;

                                            property replaceAttrValues

                                            replaceAttrValues?: {
                                            [key: string]: string;
                                            };

                                              property runtimeConfig

                                              runtimeConfig?: boolean;

                                                property svgo

                                                svgo?: boolean;

                                                  property svgoConfig

                                                  svgoConfig?: OptimizeOptions;

                                                    property svgProps

                                                    svgProps?: {
                                                    [key: string]: string;
                                                    };

                                                      property template

                                                      template?: Options$1['template'];

                                                        property titleProp

                                                        titleProp?: boolean;

                                                          property typescript

                                                          typescript?: boolean;

                                                            interface Plugin

                                                            interface Plugin {}

                                                              call signature

                                                              (code: string, config: Config, state: State): string;

                                                                interface State

                                                                interface State {}

                                                                  property caller

                                                                  caller?: {
                                                                  name?: string;
                                                                  previousExport?: string | null;
                                                                  defaultPlugins?: ConfigPlugin[];
                                                                  };

                                                                    property componentName

                                                                    componentName: string;

                                                                      property filePath

                                                                      filePath?: string;

                                                                        Type Aliases

                                                                        type ConfigPlugin

                                                                        type ConfigPlugin = string | Plugin;

                                                                          Package Files (1)

                                                                          Dependencies (3)

                                                                          Dev Dependencies (1)

                                                                          Peer Dependencies (0)

                                                                          No peer dependencies.

                                                                          Badge

                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@svgr/core.

                                                                          • Markdown
                                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@svgr/core)
                                                                          • HTML
                                                                            <a href="https://www.jsdocs.io/package/@svgr/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>