refactor(font): consolidate all types into single types.ts file

- Created unified model/types.ts with all type definitions
- Consolidated domain types (FontCategory, FontProvider, FontSubset)
- Consolidated Google Fonts API types (FontItem, GoogleFontsApiModel, etc.)
- Consolidated Fontshare API types (FontshareFont, FontshareStyle, etc.)
- Consolidated normalization types (UnifiedFont, FontStyleUrls, etc.)
- Consolidated store types (FontCollectionStore, FontCollectionFilters, etc.)
- Removed duplicate type files (font.ts, google_fonts.ts, fontshare_fonts.ts)
- Updated all imports to use consolidated types
- Updated normalize module to import from /Font
- Updated API clients to re-export types for backward compatibility
- Updated store to use centralized types
- Updated Font index.ts to export all types

Benefits:
- Centralized type definitions in single location
- Cleaner imports (single import from /Font)
- Better code organization with clear sections
- Follows FSD principles (types in model layer)
- No duplicate type definitions
This commit is contained in:
Ilia Mashkov
2026-01-06 15:06:38 +03:00
parent 9abec4210c
commit 9f8b840e7a
9 changed files with 361 additions and 315 deletions

View File

@@ -1,11 +1,13 @@
import type { FontshareFont } from '$entities/Font';
import type {
FontshareFont,
GoogleFontItem,
UnifiedFont,
} from '$entities/Font';
import {
describe,
expect,
it,
} from 'vitest';
import type { GoogleFontItem } from '../google/googleFonts';
import type { UnifiedFont } from './normalize';
import {
normalizeFontshareFont,
normalizeFontshareFonts,