From 9598693144092b2dae9ee3b7ecaa18131526e958 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Wed, 1 Nov 2023 18:16:50 +0100 Subject: [PATCH] fix(icons-react): fix exports in individual icon TypeScript declarations (#15032) * fix(icons-react): fix exports in individual icon TypeScript declarations * fix(icon-build-helpers): add missing declare keyword in TS builder --------- Co-authored-by: TJ Egan --- .../icon-build-helpers/src/builders/react/next/typescript.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/icon-build-helpers/src/builders/react/next/typescript.js b/packages/icon-build-helpers/src/builders/react/next/typescript.js index c7716b1112b2..f538b1b75976 100644 --- a/packages/icon-build-helpers/src/builders/react/next/typescript.js +++ b/packages/icon-build-helpers/src/builders/react/next/typescript.js @@ -46,9 +46,8 @@ async function writeModuleTypes(modules, outDir) { templates.banner + '\n' + "import type { CarbonIconType } from './CarbonIcon';\n" + - 'export const ' + - m.name + - ': CarbonIconType;\n'; + `declare const ${m.name}: CarbonIconType;\n` + + `export default ${m.name}\n`; const filename = path.resolve(outDir, m.filepath.replace(/\.js$/, '.d.ts')); await fs.writeFile(filename, content); }