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:
@@ -23,31 +23,38 @@ export {
|
||||
normalizeGoogleFonts,
|
||||
} from './api/normalize';
|
||||
export type {
|
||||
FontFeatures,
|
||||
FontMetadata,
|
||||
FontStyleUrls,
|
||||
UnifiedFont,
|
||||
UnifiedFontVariant,
|
||||
} from './api/normalize';
|
||||
export type {
|
||||
// Domain types
|
||||
FontCategory,
|
||||
FontCollectionFilters,
|
||||
FontCollectionSort,
|
||||
// Store types
|
||||
FontCollectionState,
|
||||
FontCollectionStore,
|
||||
FontFeatures,
|
||||
FontFiles,
|
||||
FontItem,
|
||||
FontMetadata,
|
||||
FontProvider,
|
||||
FontSubset,
|
||||
} from './model/types/font';
|
||||
export type {
|
||||
// Fontshare API types
|
||||
FontshareApiModel,
|
||||
FontshareAxis,
|
||||
FontshareDesigner,
|
||||
FontshareFeature,
|
||||
FontshareFont,
|
||||
FontshareLink,
|
||||
FontsharePublisher,
|
||||
FontshareStyle,
|
||||
FontshareStyleProperties,
|
||||
FontshareTag,
|
||||
FontshareWeight,
|
||||
} from './model/types/fontshare_fonts';
|
||||
export type {
|
||||
FontFiles,
|
||||
FontItem,
|
||||
FontStyleUrls,
|
||||
FontSubset,
|
||||
FontVariant,
|
||||
FontWeight,
|
||||
FontWeightItalic,
|
||||
// Google Fonts API types
|
||||
GoogleFontsApiModel,
|
||||
} from './model/types/google_fonts';
|
||||
// Normalization types
|
||||
UnifiedFont,
|
||||
UnifiedFontVariant,
|
||||
} from './model/types';
|
||||
|
||||
Reference in New Issue
Block a user