diff --git a/gulpfile.js b/gulpfile.js index ad128a06e..4bea019fd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -662,7 +662,7 @@ gulp.task('svg-to-react', gulp.series('clean-react', async (cb) => { } let indexCode = '', - indexDCode = `import { FC, SVGAttributes } from 'react';\n\ninterface TablerIconProps extends SVGAttributes { color?: string; size?: string | number; stroke?: string | number; }\n\ntype TablerIcon = FC;\n\n` + indexDCode = `import { FC, SVGAttributes } from 'react';\n\ntype TablerIconProps = Omit, 'color' | 'stroke'> & {\n color?: SVGAttributes['stroke'];\n size?: SVGAttributes['width'];\n stroke?: SVGAttributes['strokeWidth'];\n}\n\ntype TablerIcon = FC;\n\n` await asyncForEach(files, async function(file) { const svgCode = optimizeSvgCode(fs.readFileSync(file).toString()), diff --git a/icons-react/index.d.ts b/icons-react/index.d.ts index 592d81059..75e56caa3 100644 --- a/icons-react/index.d.ts +++ b/icons-react/index.d.ts @@ -1,6 +1,10 @@ import { FC, SVGAttributes } from 'react'; -interface TablerIconProps extends SVGAttributes { color?: string; size?: string | number; stroke?: string | number; } +type TablerIconProps = Omit, 'color' | 'stroke'> & { + color?: SVGAttributes['stroke']; + size?: SVGAttributes['width']; + stroke?: SVGAttributes['strokeWidth']; +} type TablerIcon = FC;