From 8e4b647423e6d360bb5a752c9aa7b86aac73e2bb Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Thu, 2 Nov 2023 19:27:12 +0100 Subject: [PATCH] fix(icons-react): use declare keyword in bucket TypeScript types --- .../icon-build-helpers/src/builders/react/next/typescript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f538b1b75976..fcf25c5311fc 100644 --- a/packages/icon-build-helpers/src/builders/react/next/typescript.js +++ b/packages/icon-build-helpers/src/builders/react/next/typescript.js @@ -57,7 +57,7 @@ async function writeBucketTypes(buckets, outDir) { for (const bucket of buckets) { const iconLines = []; for (const m of bucket.modules) { - iconLines.push('export const ' + m.name + ': CarbonIconType;'); + iconLines.push('declare const ' + m.name + ': CarbonIconType;'); } const bucketModule = `generated/${bucket.id}`; const filepath = path.resolve(outDir, `${bucketModule}.d.ts`); @@ -66,7 +66,7 @@ async function writeBucketTypes(buckets, outDir) { '\n' + "import type { CarbonIconType } from '../CarbonIcon';\n" + iconLines.join('\n') + - '\n'; + `\nexport { ${bucket.modules.map((m) => m.name).join(', ')} };\n`; await fs.writeFile(filepath, content); } }