Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add generic item icons transpilable from core models (#1465)

Leendert de Borstcdc03f44948c
diff --git a/core/models/build.sh b/core/models/build.sh
index a1b414031..28c39dea7 100755
--- a/core/models/build.sh
+++ b/core/models/build.sh
@@ -21,7 +21,7 @@ echo "πŸ”„ Generating platform-specific models (C#, Swift, Kotlin)..."
node scripts/generate-field-keys.cjs
dist_path="dist"
-files_to_copy=("webapi" "vault" "metadata")
+files_to_copy=("webapi" "vault" "metadata" "icons")
for target in "${TARGETS[@]}"; do
echo "πŸ“‚ Copying $package_name β†’ $target"
diff --git a/core/models/scripts/generate-field-keys.cjs b/core/models/scripts/generate-field-keys.cjs
index e500c4be4..816194ab9 100755
--- a/core/models/scripts/generate-field-keys.cjs
+++ b/core/models/scripts/generate-field-keys.cjs
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/**
- * Generates FieldKey, FieldType, ItemType constants and SystemFieldRegistry for C#, Swift, and Kotlin from TypeScript source.
+ * Generates FieldKey, FieldType, ItemType constants, SystemFieldRegistry, and ItemTypeIcons for C#, Swift, and Kotlin from TypeScript source.
* All type definitions are dynamically extracted from the TypeScript source files.
*/
@@ -12,16 +12,21 @@ const REPO_ROOT = path.join(__dirname, '../../..');
const TS_SOURCE = path.join(REPO_ROOT, 'core/models/src/vault/FieldKey.ts');
const TS_ITEM_SOURCE = path.join(REPO_ROOT, 'core/models/src/vault/Item.ts');
const TS_REGISTRY_SOURCE = path.join(REPO_ROOT, 'core/models/src/vault/SystemFieldRegistry.ts');
+const TS_ICONS_SOURCE = path.join(REPO_ROOT, 'core/models/src/icons/ItemTypeIcons.ts');
const CS_OUTPUT = path.join(REPO_ROOT, 'apps/server/Databases/AliasClientDb/Models/FieldKey.cs');
const CS_FIELD_TYPE_OUTPUT = path.join(REPO_ROOT, 'apps/server/Databases/AliasClientDb/Models/FieldType.cs');
const CS_ITEM_TYPE_OUTPUT = path.join(REPO_ROOT, 'apps/server/Databases/AliasClientDb/Models/ItemType.cs');
const CS_REGISTRY_OUTPUT = path.join(REPO_ROOT, 'apps/server/Databases/AliasClientDb/Models/SystemFieldRegistry.cs');
+const CS_ICONS_OUTPUT = path.join(REPO_ROOT, 'apps/server/Databases/AliasClientDb/Models/ItemTypeIcons.cs');
const SWIFT_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/ios/VaultModels/FieldKey.swift');
const SWIFT_FIELD_TYPE_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/ios/VaultModels/FieldType.swift');
const SWIFT_ITEM_TYPE_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/ios/VaultModels/ItemType.swift');
+const SWIFT_ICONS_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/ios/VaultModels/ItemTypeIcons.swift');
const KOTLIN_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/FieldKey.kt');
const KOTLIN_FIELD_TYPE_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/FieldType.kt');
const KOTLIN_ITEM_TYPE_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/ItemType.kt');
+const KOTLIN_ICONS_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/android/app/src/main/java/net/aliasvault/app/vaultstore/models/ItemTypeIcons.kt');
+const RN_ICONS_OUTPUT = path.join(REPO_ROOT, 'apps/mobile-app/components/items/ItemTypeIconComponents.tsx');
/**
* Parse the TypeScript FieldKey.ts file and extract constants
@@ -945,6 +950,328 @@ function ensureDir(filePath) {
}
}
+// ==================== ICON GENERATION ====================
+
+/**
+ * Parse ItemTypeIconSvgs from TypeScript source
+ */
+function parseItemTypeIconSvgs(tsContent) {
+ const icons = {};
+
+ // Find the ItemTypeIconSvgs constant
+ const startMatch = tsContent.match(/export const ItemTypeIconSvgs\s*=\s*\{/);
+ if (!startMatch) {
+ console.warn('Warning: Could not find ItemTypeIconSvgs in source');
+ return icons;
+ }
+
+ const startIdx = startMatch.index + startMatch[0].length;
+
+ // Find the closing brace by counting braces
+ let braceCount = 1;
+ let endIdx = startIdx;
+ while (braceCount > 0 && endIdx < tsContent.length) {
+ if (tsContent[endIdx] === '{') braceCount++;
+ if (tsContent[endIdx] === '}') braceCount--;
+ endIdx++;
+ }
+
+ const body = tsContent.slice(startIdx, endIdx - 1);
+
+ // Match each icon: IconName: `<svg...>`,
+ // Use a state machine to handle template literals with backticks
+ const lines = body.split('\n');
+ let currentIconName = null;
+ let currentSvg = '';
+ let inTemplateLiteral = false;
+
+ for (const line of lines) {
+ const trimmed = line.trim();
+
+ // Skip JSDoc comments
+ if (trimmed.startsWith('/**') || trimmed.startsWith('*')) {
+ continue;
+ }
+
+ // Check for icon name start: IconName: `
+ const iconStartMatch = trimmed.match(/^(\w+):\s*`(.*)$/);
+ if (iconStartMatch && !inTemplateLiteral) {
+ currentIconName = iconStartMatch[1];
+ const rest = iconStartMatch[2];
+
+ // Check if it ends on the same line
+ if (rest.endsWith('`,') || rest.endsWith('`')) {
+ icons[currentIconName] = rest.replace(/`,?$/, '');
+ currentIconName = null;
+ } else {
+ currentSvg = rest + '\n';
+ inTemplateLiteral = true;
+ }
+ continue;
+ }
+
+ // Continue collecting SVG content
+ if (inTemplateLiteral && currentIconName) {
+ // Check if this line ends the template literal
+ if (trimmed.endsWith('`,') || trimmed === '`,' || trimmed === '`') {
+ currentSvg += line.replace(/\s*`,?$/, '');
+ icons[currentIconName] = currentSvg.trim();
+ currentIconName = null;
+ currentSvg = '';
+ inTemplateLiteral = false;
+ } else {
+ currentSvg += line + '\n';
+ }
+ }
+ }
+
+ return icons;
+}
+
+
+/**
+ * Generate C# ItemTypeIcons static class
+ */
+function generateCSharpIcons(icons) {
+ const header = `// <auto-generated />
+// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
+// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+
+namespace AliasClientDb.Models;
+
+/// <summary>
+/// Centralized SVG icon definitions for item types.
+/// Single source of truth for all item type icons across platforms.
+/// </summary>
+public static class ItemTypeIcons
+{
+`;
+
+ const iconFields = Object.entries(icons)
+ .map(([name, svg]) => {
+ // Escape the SVG for C# string literal
+ const escapedSvg = svg.replace(/"/g, '\\"').replace(/\n/g, '\\n');
+ return ` /// <summary>${name} icon SVG.</summary>
+ public const string ${name} = "${escapedSvg}";`;
+ })
+ .join('\n\n');
+
+ const footer = `
+}
+`;
+
+ return header + iconFields + footer;
+}
+
+/**
+ * Generate Swift ItemTypeIcons struct
+ */
+function generateSwiftIcons(icons) {
+ const header = `// <auto-generated />
+// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
+// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+// swiftlint:disable line_length
+
+import Foundation
+
+/// Centralized SVG icon definitions for item types.
+/// Single source of truth for all item type icons across platforms.
+public struct ItemTypeIcons {
+`;
+
+ const iconFields = Object.entries(icons)
+ .map(([name, svg]) => {
+ const swiftName = name.charAt(0).toLowerCase() + name.slice(1);
+ // Use triple-quoted string for multiline SVG
+ return ` /// ${name} icon SVG.
+ public static let ${swiftName} = """
+${svg}
+"""`;
+ })
+ .join('\n\n');
+
+ const footer = `
+}
+`;
+
+ return header + iconFields + footer;
+}
+
+/**
+ * Parse SVG string and convert to React Native SVG component JSX.
+ * Handles circle, rect, path, and text elements.
+ */
+function svgToReactNative(svgString, componentName) {
+ // Extract elements from SVG
+ const circleRegex = /<circle\s+([^>]+)\/>/g;
+ const rectRegex = /<rect\s+([^>]+)\/>/g;
+ const pathRegex = /<path\s+([^>]+)\/>/g;
+ const textRegex = /<text\s+([^>]+)>([^<]+)<\/text>/g;
+
+ const elements = [];
+
+ // Parse circles
+ let match;
+ while ((match = circleRegex.exec(svgString)) !== null) {
+ const attrs = parseAttributes(match[1]);
+ const props = Object.entries(attrs)
+ .map(([key, value]) => {
+ const rnKey = toReactNativeAttr(key);
+ return `${rnKey}="${value}"`;
+ })
+ .join(' ');
+ elements.push({ index: match.index, element: `<Circle ${props} />` });
+ }
+
+ // Parse rects
+ while ((match = rectRegex.exec(svgString)) !== null) {
+ const attrs = parseAttributes(match[1]);
+ const props = Object.entries(attrs)
+ .map(([key, value]) => {
+ const rnKey = toReactNativeAttr(key);
+ return `${rnKey}="${value}"`;
+ })
+ .join(' ');
+ elements.push({ index: match.index, element: `<Rect ${props} />` });
+ }
+
+ // Parse paths
+ while ((match = pathRegex.exec(svgString)) !== null) {
+ const attrs = parseAttributes(match[1]);
+ const props = Object.entries(attrs)
+ .map(([key, value]) => {
+ const rnKey = toReactNativeAttr(key);
+ return `${rnKey}="${value}"`;
+ })
+ .join(' ');
+ elements.push({ index: match.index, element: `<Path ${props} />` });
+ }
+
+ // Parse text elements
+ while ((match = textRegex.exec(svgString)) !== null) {
+ const attrs = parseAttributes(match[1]);
+ const textContent = match[2];
+ const props = Object.entries(attrs)
+ .map(([key, value]) => {
+ const rnKey = toReactNativeAttr(key);
+ return `${rnKey}="${value}"`;
+ })
+ .join(' ');
+ elements.push({ index: match.index, element: `<SvgText ${props}>${textContent}</SvgText>` });
+ }
+
+ // Sort elements by their original position in the SVG
+ elements.sort((a, b) => a.index - b.index);
+
+ const elementLines = elements.map(e => ` ${e.element}`).join('\n');
+
+ return `export const ${componentName}Icon = ({ width = 32, height = 32 }: { width?: number; height?: number }): React.ReactElement => (
+ <Svg width={width} height={height} viewBox="0 0 32 32" fill="none">
+${elementLines}
+ </Svg>
+);`;
+}
+
+/**
+ * Parse HTML/SVG attributes into an object.
+ */
+function parseAttributes(attrString) {
+ const attrs = {};
+ const attrRegex = /(\w+(?:-\w+)*)="([^"]+)"/g;
+ let match;
+ while ((match = attrRegex.exec(attrString)) !== null) {
+ attrs[match[1]] = match[2];
+ }
+ return attrs;
+}
+
+/**
+ * Convert SVG attribute names to React Native SVG attribute names.
+ */
+function toReactNativeAttr(attr) {
+ const mapping = {
+ 'stroke-width': 'strokeWidth',
+ 'stroke-linecap': 'strokeLinecap',
+ 'stroke-linejoin': 'strokeLinejoin',
+ 'fill-rule': 'fillRule',
+ 'clip-rule': 'clipRule',
+ 'text-anchor': 'textAnchor',
+ 'font-size': 'fontSize',
+ 'font-weight': 'fontWeight',
+ 'font-family': 'fontFamily',
+ };
+ return mapping[attr] || attr;
+}
+
+/**
+ * Generate React Native SVG components from icons.
+ */
+function generateReactNativeIcons(icons) {
+ const header = `// <auto-generated />
+// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
+// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+
+import React from 'react';
+import Svg, { Circle, Path, Rect, Text as SvgText } from 'react-native-svg';
+
+`;
+
+ const components = Object.entries(icons)
+ .map(([name, svg]) => svgToReactNative(svg, name))
+ .join('\n\n');
+
+ const iconMap = `
+/**
+ * Map of icon key to React Native SVG component.
+ */
+export const iconComponents = {
+${Object.keys(icons).map(name => ` ${name}: ${name}Icon,`).join('\n')}
+};
+
+export type IconKey = keyof typeof iconComponents;
+`;
+
+ return header + components + iconMap;
+}
+
+/**
+ * Generate Kotlin ItemTypeIcons object
+ */
+function generateKotlinIcons(icons) {
+ const header = `// <auto-generated />
+// This file is auto-generated from core/models/src/icons/ItemTypeIcons.ts
+// Do not edit this file directly. Run 'npm run generate:models' to regenerate.
+@file:Suppress("MaxLineLength")
+
+package net.aliasvault.app.vaultstore.models
+
+/**
+ * Centralized SVG icon definitions for item types.
+ * Single source of truth for all item type icons across platforms.
+ */
+object ItemTypeIcons {
+`;
+
+ const iconFields = Object.entries(icons)
+ .map(([name, svg]) => {
+ const kotlinName = name.replace(/([A-Z])/g, '_$1').toUpperCase().replace(/^_/, '');
+ // Use trimIndent for multiline string
+ return ` /**
+ * ${name} icon SVG.
+ */
+ val ${kotlinName} = """
+${svg}
+ """.trimIndent()`;
+ })
+ .join('\n\n');
+
+ const footer = `
+}
+`;
+
+ return header + iconFields + footer;
+}
+
/**
* Main execution
*/
@@ -1068,6 +1395,46 @@ function main() {
fs.writeFileSync(KOTLIN_ITEM_TYPE_OUTPUT, kotlinItemTypeContent, 'utf8');
console.log(`Generated: ${KOTLIN_ITEM_TYPE_OUTPUT}`);
+ // ==================== ICON GENERATION ====================
+
+ // Read TypeScript ItemTypeIcons source
+ if (!fs.existsSync(TS_ICONS_SOURCE)) {
+ console.warn(`Warning: Icons source file not found: ${TS_ICONS_SOURCE}`);
+ } else {
+ const tsIconsContent = fs.readFileSync(TS_ICONS_SOURCE, 'utf8');
+ const iconSvgs = parseItemTypeIconSvgs(tsIconsContent);
+
+ if (Object.keys(iconSvgs).length === 0) {
+ console.warn('Warning: No icon SVGs found in source file');
+ } else {
+ console.log(`Parsed ${Object.keys(iconSvgs).length} icon SVGs: ${Object.keys(iconSvgs).join(', ')}`);
+
+ // Generate C# ItemTypeIcons
+ ensureDir(CS_ICONS_OUTPUT);
+ const csIconsContent = generateCSharpIcons(iconSvgs);
+ fs.writeFileSync(CS_ICONS_OUTPUT, csIconsContent, 'utf8');
+ console.log(`Generated: ${CS_ICONS_OUTPUT}`);
+
+ // Generate Swift ItemTypeIcons
+ ensureDir(SWIFT_ICONS_OUTPUT);
+ const swiftIconsContent = generateSwiftIcons(iconSvgs);
+ fs.writeFileSync(SWIFT_ICONS_OUTPUT, swiftIconsContent, 'utf8');
+ console.log(`Generated: ${SWIFT_ICONS_OUTPUT}`);
+
+ // Generate Kotlin ItemTypeIcons
+ ensureDir(KOTLIN_ICONS_OUTPUT);
+ const kotlinIconsContent = generateKotlinIcons(iconSvgs);
+ fs.writeFileSync(KOTLIN_ICONS_OUTPUT, kotlinIconsContent, 'utf8');
+ console.log(`Generated: ${KOTLIN_ICONS_OUTPUT}`);
+
+ // Generate React Native ItemTypeIcons components
+ ensureDir(RN_ICONS_OUTPUT);
+ const rnIconsContent = generateReactNativeIcons(iconSvgs);
+ fs.writeFileSync(RN_ICONS_OUTPUT, rnIconsContent, 'utf8');
+ console.log(`Generated: ${RN_ICONS_OUTPUT}`);
+ }
+ }
+
console.log('\nCode generation complete!');
}
diff --git a/core/models/src/icons/ItemTypeIcons.ts b/core/models/src/icons/ItemTypeIcons.ts
new file mode 100644
index 000000000..a6785b769
--- /dev/null
+++ b/core/models/src/icons/ItemTypeIcons.ts
@@ -0,0 +1,110 @@
+/**
+ * Centralized icon definitions for item types.
+ * This is the single source of truth for all item type icons across platforms.
+ *
+ * Generated platform-specific files:
+ * - C# (Blazor): apps/server/Databases/AliasClientDb/Models/ItemTypeIcons.cs
+ * - Swift (iOS): apps/mobile-app/ios/VaultModels/ItemTypeIcons.swift
+ * - Kotlin (Android): apps/mobile-app/android/.../vaultstore/models/ItemTypeIcons.kt
+ * - TypeScript: distributed via build.sh to browser-extension and mobile-app
+ *
+ * Color scheme used in icons:
+ * - Primary orange: #f49541
+ * - Dark orange: #d68338
+ * - Light yellow: #ffe096
+ * - Lighter yellow: #fbcb74
+ */
+
+/**
+ * SVG icon definitions for each item type and card brand.
+ * All icons use a 32x32 viewBox for consistency.
+ */
+export const ItemTypeIconSvgs = {
+ /**
+ * Placeholder key icon for Login/Alias items without a logo.
+ * Traditional key design with outline style.
+ */
+ Placeholder: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="10" cy="10" r="6.5" stroke="#f49541" stroke-width="2.5"/>
+ <circle cx="10" cy="10" r="2.5" stroke="#ff0000" stroke-width="2"/>
+ <path d="M15 15L27 27" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
+ <path d="M19 19L23 15" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
+ <path d="M24 24L28 20" stroke="#f49541" stroke-width="2.5" stroke-linecap="round"/>
+</svg>`,
+
+ /**
+ * Note/document icon with folded corner.
+ * Used for Note item type.
+ */
+ Note: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M8 4C6.9 4 6 4.9 6 6V26C6 27.1 6.9 28 8 28H24C25.1 28 26 27.1 26 26V11L19 4H8Z" fill="#f49541"/>
+ <path d="M19 4V11H26L19 4Z" fill="#d68338"/>
+ <rect x="10" y="14" width="12" height="1.5" rx="0.75" fill="#ffe096"/>
+ <rect x="10" y="18" width="10" height="1.5" rx="0.75" fill="#ffe096"/>
+ <rect x="10" y="22" width="8" height="1.5" rx="0.75" fill="#ffe096"/>
+</svg>`,
+
+ /**
+ * Generic credit card icon.
+ * Used when card brand cannot be detected.
+ */
+ CreditCard: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
+ <rect x="2" y="11" width="28" height="4" fill="#d68338"/>
+ <rect x="5" y="18" width="8" height="2" rx="1" fill="#ffe096"/>
+ <rect x="5" y="22" width="5" height="1.5" rx="0.75" fill="#fbcb74"/>
+</svg>`,
+
+ /**
+ * Visa card icon with brand styling.
+ */
+ Visa: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
+ <path d="M13.5 13L11.5 19H10L8.5 14.5C8.5 14.5 8.35 14 8 14C7.65 14 7 13.8 7 13.8L7.05 13.5H9.5C9.85 13.5 10.15 13.75 10.2 14.1L10.8 17L12.5 13.5H13.5V13ZM15 19H14L15 13H16L15 19ZM20 13.5C20 13.5 19.4 13.3 18.7 13.3C17.35 13.3 16.4 14 16.4 15C16.4 15.8 17.1 16.2 17.65 16.5C18.2 16.8 18.4 17 18.4 17.2C18.4 17.5 18.05 17.7 17.6 17.7C17 17.7 16.5 17.5 16.5 17.5L16.3 18.7C16.3 18.7 16.9 19 17.7 19C19.2 19 20.1 18.2 20.1 17.1C20.1 15.7 18.4 15.6 18.4 15C18.4 14.7 18.7 14.5 19.15 14.5C19.6 14.5 20.1 14.7 20.1 14.7L20.3 13.5H20V13.5ZM24 19L23.1 13.5H22C21.7 13.5 21.45 13.7 21.35 13.95L19 19H20.5L20.8 18H22.7L22.9 19H24ZM21.2 17L22 14.5L22.45 17H21.2Z" fill="#ffe096"/>
+</svg>`,
+
+ /**
+ * Mastercard icon with overlapping circles.
+ */
+ Mastercard: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
+ <circle cx="13" cy="16" r="5" fill="#d68338"/>
+ <circle cx="19" cy="16" r="5" fill="#ffe096"/>
+ <path d="M16 12.5C17.1 13.4 17.8 14.6 17.8 16C17.8 17.4 17.1 18.6 16 19.5C14.9 18.6 14.2 17.4 14.2 16C14.2 14.6 14.9 13.4 16 12.5Z" fill="#fbcb74"/>
+</svg>`,
+
+ /**
+ * American Express card icon.
+ */
+ Amex: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
+ <text x="16" y="18" text-anchor="middle" fill="#ffe096" font-size="8" font-weight="bold" font-family="Arial, sans-serif">AMEX</text>
+</svg>`,
+
+ /**
+ * Discover card icon with orange circle logo.
+ */
+ Discover: `<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="2" y="6" width="28" height="20" rx="3" fill="#f49541"/>
+ <circle cx="20" cy="16" r="4" fill="#ffe096"/>
+ <path d="M7 14H8.5C9.3 14 10 14.7 10 15.5C10 16.3 9.3 17 8.5 17H7V14Z" fill="#ffe096"/>
+ <rect x="11" y="14" width="1.5" height="3" fill="#ffe096"/>
+ <path d="M14 15C14 14.4 14.4 14 15 14C15.3 14 15.5 14.1 15.7 14.3L16.5 13.5C16.1 13.2 15.6 13 15 13C13.9 13 13 13.9 13 15C13 16.1 13.9 17 15 17C15.6 17 16.1 16.8 16.5 16.5L15.7 15.7C15.5 15.9 15.3 16 15 16C14.4 16 14 15.6 14 15Z" fill="#ffe096"/>
+</svg>`,
+} as const;
+
+export type ItemTypeIconKey = keyof typeof ItemTypeIconSvgs;
+
+/**
+ * Get SVG string for an item type icon.
+ */
+export function getItemTypeIconSvg(key: ItemTypeIconKey): string {
+ return ItemTypeIconSvgs[key];
+}
+
+/**
+ * Get all available icon keys.
+ */
+export function getAllIconKeys(): ItemTypeIconKey[] {
+ return Object.keys(ItemTypeIconSvgs) as ItemTypeIconKey[];
+}
diff --git a/core/models/src/icons/index.ts b/core/models/src/icons/index.ts
new file mode 100644
index 000000000..1126c43db
--- /dev/null
+++ b/core/models/src/icons/index.ts
@@ -0,0 +1,14 @@
+/**
+ * Icon definitions for item types.
+ * Re-exports all icon-related modules.
+ */
+
+export {
+ ItemTypeIconSvgs,
+ getItemTypeIconSvg,
+ getAllIconKeys,
+} from './ItemTypeIcons';
+
+export type {
+ ItemTypeIconKey,
+} from './ItemTypeIcons';