chore(Font): move font types related to weight to common types

This commit is contained in:
Ilia Mashkov
2026-02-05 11:38:38 +03:00
parent 2b7f21711b
commit 40346aa9aa
2 changed files with 26 additions and 24 deletions

View File

@@ -32,3 +32,27 @@ export interface FontFilters {
export type CheckboxFilter = 'providers' | 'categories' | 'subsets'; export type CheckboxFilter = 'providers' | 'categories' | 'subsets';
export type FilterType = CheckboxFilter | 'searchQuery'; export type FilterType = CheckboxFilter | 'searchQuery';
/**
* Standard font weights
*/
export type FontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
/**
* Italic variant format: e.g., "100italic", "400italic", "700italic"
*/
export type FontWeightItalic = `${FontWeight}italic`;
/**
* All possible font variants
* - Numeric weights: "400", "700", etc.
* - Italic variants: "400italic", "700italic", etc.
* - Legacy names: "regular", "italic", "bold", "bolditalic"
*/
export type FontVariant =
| FontWeight
| FontWeightItalic
| 'regular'
| 'italic'
| 'bold'
| 'bolditalic';

View File

@@ -4,6 +4,8 @@
* ============================================================================ * ============================================================================
*/ */
import type { FontVariant } from './common';
export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace'; export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace';
/** /**
@@ -86,30 +88,6 @@ export interface FontItem {
*/ */
export type GoogleFontItem = FontItem; export type GoogleFontItem = FontItem;
/**
* Standard font weights that can appear in Google Fonts API
*/
export type FontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
/**
* Italic variant format: e.g., "100italic", "400italic", "700italic"
*/
export type FontWeightItalic = `${FontWeight}italic`;
/**
* All possible font variants in Google Fonts API
* - Numeric weights: "400", "700", etc.
* - Italic variants: "400italic", "700italic", etc.
* - Legacy names: "regular", "italic", "bold", "bolditalic"
*/
export type FontVariant =
| FontWeight
| FontWeightItalic
| 'regular'
| 'italic'
| 'bold'
| 'bolditalic';
/** /**
* Google Fonts API file mapping * Google Fonts API file mapping
* Dynamic keys that match the variants array * Dynamic keys that match the variants array