feat(FontCategory): separate types for font categories from different providers
This commit is contained in:
@@ -3,11 +3,13 @@
|
|||||||
* DOMAIN TYPES
|
* DOMAIN TYPES
|
||||||
* ============================================================================
|
* ============================================================================
|
||||||
*/
|
*/
|
||||||
|
import type { FontCategory as FontshareFontCategory } from './fontshare';
|
||||||
|
import type { FontCategory as GoogleFontCategory } from './google';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Font category
|
* Font category
|
||||||
*/
|
*/
|
||||||
export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace';
|
export type FontCategory = GoogleFontCategory | FontshareFontCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Font provider
|
* Font provider
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import type { CollectionApiModel } from '$shared/types/collection';
|
|||||||
|
|
||||||
export const FONTSHARE_API_URL = 'https://api.fontshare.com/v2' as const;
|
export const FONTSHARE_API_URL = 'https://api.fontshare.com/v2' as const;
|
||||||
|
|
||||||
|
export type FontCategory = 'sans' | 'serif' | 'slab' | 'display' | 'handwritten' | 'script';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model of Fontshare API response
|
* Model of Fontshare API response
|
||||||
* @see https://fontshare.com
|
* @see https://fontshare.com
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
* ============================================================================
|
* ============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model of google fonts api response
|
* Model of google fonts api response
|
||||||
*/
|
*/
|
||||||
@@ -29,7 +31,7 @@ export interface FontItem {
|
|||||||
* Font category classification (e.g., "sans-serif", "serif", "display", "handwriting", "monospace")
|
* Font category classification (e.g., "sans-serif", "serif", "display", "handwriting", "monospace")
|
||||||
* Useful for grouping and filtering fonts by style
|
* Useful for grouping and filtering fonts by style
|
||||||
*/
|
*/
|
||||||
category: string;
|
category: FontCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Available font variants for this font family
|
* Available font variants for this font family
|
||||||
|
|||||||
Reference in New Issue
Block a user