mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 22:27:43 +01:00
* Adjust typescript types * adjust types * fix types in all helper files * Fix types * Migrate js files to ts files * Refactor to TS files * Rename extentions * Adjust imports * Fix builds * Update lockfile * Fix last typescript migration * Fix entry path @lucide/outline-svg * Fix types * add checkout step * format files * Format files
33 lines
874 B
TypeScript
33 lines
874 B
TypeScript
import base64SVG from '@lucide/build-icons/utils/base64SVG';
|
|
import defineExportTemplate from '@lucide/build-icons/utils/defineExportTemplate';
|
|
|
|
export default defineExportTemplate(async ({ componentName, iconName, getSvg, deprecated, deprecationReason }) => {
|
|
let svgContents = await getSvg();
|
|
const svgBase64 = base64SVG(svgContents);
|
|
|
|
svgContents = svgContents.replace(
|
|
'<svg',
|
|
`
|
|
<svg
|
|
class="lucide lucide-${iconName}"`,
|
|
);
|
|
|
|
return `
|
|
/**
|
|
* @name ${iconName}
|
|
* @description Lucide SVG string.
|
|
*
|
|
* @preview  - https://lucide.dev/icons/${iconName}
|
|
* @see https://lucide.dev/guide/packages/lucide-static - Documentation
|
|
*
|
|
* @returns {String}
|
|
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
|
*/
|
|
const ${componentName}: string = \`\
|
|
${svgContents}\
|
|
\`
|
|
|
|
export default ${componentName};
|
|
`;
|
|
});
|