fix(types): resolve import path and type issues after consolidation

- Added GoogleFontItem type alias for backward compatibility
- Updated normalize.ts to properly type Record<string, string> values
- Fixed import paths in Font index.ts (added subdirectory paths)
- Removed unused Readable import from store
- Removed type exports from normalize and API index files
- Updated stores index.ts to import types from parent types.ts
- All tests passing (129 tests)

All imports now use centralized types from model/types.ts:
- API clients re-export types for backward compatibility
- Normalize module imports types and exports functions
- Store module imports types and exports factory
- Main index.ts exports all types from model/types.ts
This commit is contained in:
Ilia Mashkov
2026-01-06 15:11:16 +03:00
parent 9f8b840e7a
commit db814f0b93
6 changed files with 82 additions and 24 deletions

View File

@@ -15,7 +15,6 @@ import type {
FontshareFont,
GoogleFontItem,
UnifiedFont,
UnifiedFontVariant,
} from '../../model/types';
/**
@@ -128,14 +127,15 @@ export function normalizeGoogleFont(apiFont: GoogleFontItem): UnifiedFont {
// Map variant files to style URLs
const styles: FontStyleUrls = {};
for (const [variant, url] of Object.entries(apiFont.files)) {
const urlString = url as string; // Type assertion for Record<string, string>
if (variant === 'regular' || variant === '400') {
styles.regular = url;
styles.regular = urlString;
} else if (variant === 'italic' || variant === '400italic') {
styles.italic = url;
styles.italic = urlString;
} else if (variant === 'bold' || variant === '700') {
styles.bold = url;
styles.bold = urlString;
} else if (variant === 'bolditalic' || variant === '700italic') {
styles.boldItalic = url;
styles.boldItalic = urlString;
}
}