JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.02k stars 270 forks source link

How to use the BrowserSpriteSymbol type in typescript? #361

Closed kaysonwu closed 4 years ago

kaysonwu commented 4 years ago

Do you want to request a feature, report a bug or ask a question?

question

What is the expected behavior?

interface IconProps {
    type: BrowserSpriteSymbol
}

Please tell us about your environment:

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

When I introduced the svg file with require, I got a BrowserSpriteSymbol type, but I don't know how to use it as a property type. Can you tell me? Thank you!

kvashonin commented 4 years ago

I added next interface in my project

interface BrowserSpriteSymbol {
  id: string;
  viewBox: string;
  content: string;
  node: SVGSymbolElement;
}
kisenka commented 4 years ago

@etozhkirill could you please make a PR with typings?