@svgr/core

  • Version 8.1.0
  • Published
  • 24.8 kB
  • 5 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, configFile?: string): Promise<Config | null>;
      sync(searchFrom?: string, configFile?: string): 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 descProp

                descProp?: boolean;

                  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 jsxRuntimeImport

                                jsxRuntimeImport?: {
                                source: string;
                                namespace?: string;
                                specifiers?: string[];
                                defaultSpecifier?: string;
                                };

                                  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?: Config$1;

                                                        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 (5)

                                                                              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>