/
types.ts
52 lines (45 loc) · 996 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
export type WebFontsProviders = 'google' | 'bunny' | 'fontshare' | 'none'
export interface WebFontMeta {
name: string
weights?: (string | number)[]
italic?: boolean
/**
* Override the provider
* @default <matches root config>
*/
provider?: WebFontsProviders
}
export interface WebFontsOptions {
/**
* Provider service of the web fonts
* @default 'google'
*/
provider?: WebFontsProviders
/**
* The fonts
*/
fonts?: Record<string, WebFontMeta | string | (WebFontMeta | string)[]>
/**
* Extend the theme object
* @default true
*/
extendTheme?: boolean
/**
* Key for the theme object
*
* @default 'fontFamily'
*/
themeKey?: string
/**
* Inline CSS @import()
*
* @default true
*/
inlineImports?: boolean
}
export interface Provider {
name: WebFontsProviders
getPreflight?(fonts: WebFontMeta[]): string
getImportUrl?(fonts: WebFontMeta[]): string | undefined
getFontName(font: WebFontMeta): string
}