Skip to content

Commit 747960f

Browse files
Adjust types for Fontsource variable fonts
1 parent f415a11 commit 747960f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/types.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,18 @@ export interface CustomFonts {
108108
stripPrefix?: string
109109
}
110110

111-
export interface FontsourceFontFamily {
111+
interface BaseFontsourceFontFamily {
112112
name: string
113-
variables?: ('variable' | 'variable-italic' | 'variable-full' | 'variable-full-italic')[]
114-
weights: (100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900)[]
115113
styles?: ('italic' | 'normal')[]
116114
subset?: string
117115
}
116+
interface WeightsFontsourceFontFamily extends BaseFontsourceFontFamily {
117+
weights: (100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900)[]
118+
}
119+
interface VariableFontsourceFontFamily extends BaseFontsourceFontFamily {
120+
variables: ('variable' | 'variable-italic' | 'variable-full' | 'variable-full-italic')[]
121+
}
122+
export type FontsourceFontFamily = WeightsFontsourceFontFamily | VariableFontsourceFontFamily
118123
export interface FontsourceFonts {
119124
families: (string | FontsourceFontFamily)[]
120125
}

0 commit comments

Comments
 (0)