Skip to content

Commit

Permalink
Fix vue TypeScript declarations (#322)
Browse files Browse the repository at this point in the history
* Fix vue TS declarations

The declarations generated by #254 aren't correct, leading to tsc errors as
seen in #318.

* Use `RenderFunction` instead of `DefineComponent`

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
  • Loading branch information
zmwangx and bradlc authored Aug 17, 2021
1 parent 29bfad1 commit 2d3a08a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function buildIcons(package, style, format) {
let types =
package === 'react'
? `import * as React from 'react';\ndeclare function ${componentName}(props: React.ComponentProps<'svg'>): JSX.Element;\nexport default ${componentName};\n`
: `export default import("vue").DefineComponent;`
: `import { RenderFunction } from 'vue';\ndeclare const ${componentName}: RenderFunction;\nexport default ${componentName};\n`

return [
fs.writeFile(`${outDir}/${componentName}.js`, content, 'utf8'),
Expand Down

0 comments on commit 2d3a08a

Please sign in to comment.