@unocss/preset-web-fonts 0.55.1 → 0.55.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +63 -0
- package/dist/index.d.mts +63 -0
- package/dist/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Preset } from '@unocss/core';
|
|
2
|
+
|
|
3
|
+
type WebFontsProviders = 'google' | 'bunny' | 'fontshare' | 'none' | Provider;
|
|
4
|
+
interface WebFontMeta {
|
|
5
|
+
name: string;
|
|
6
|
+
weights?: (string | number)[];
|
|
7
|
+
italic?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Override the provider
|
|
10
|
+
* @default <matches root config>
|
|
11
|
+
*/
|
|
12
|
+
provider?: WebFontsProviders;
|
|
13
|
+
}
|
|
14
|
+
interface ResolvedWebFontMeta extends Omit<WebFontMeta, 'provider'> {
|
|
15
|
+
provider: Provider;
|
|
16
|
+
}
|
|
17
|
+
interface WebFontsOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Provider service of the web fonts
|
|
20
|
+
* @default 'google'
|
|
21
|
+
*/
|
|
22
|
+
provider?: WebFontsProviders;
|
|
23
|
+
/**
|
|
24
|
+
* The fonts
|
|
25
|
+
*/
|
|
26
|
+
fonts?: Record<string, WebFontMeta | string | (WebFontMeta | string)[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Extend fonts to the theme object
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
extendTheme?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Key for the theme object
|
|
34
|
+
*
|
|
35
|
+
* @default 'fontFamily'
|
|
36
|
+
*/
|
|
37
|
+
themeKey?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Inline CSS @import()
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
inlineImports?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Custom fetch function
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
customFetch?: (url: string) => Promise<any>;
|
|
50
|
+
}
|
|
51
|
+
interface Provider {
|
|
52
|
+
name: WebFontsProviders;
|
|
53
|
+
getPreflight?(fonts: WebFontMeta[]): string;
|
|
54
|
+
getImportUrl?(fonts: WebFontMeta[]): string | undefined;
|
|
55
|
+
getFontName?(font: WebFontMeta): string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare function createGoogleCompatibleProvider(name: WebFontsProviders, host: string): Provider;
|
|
59
|
+
|
|
60
|
+
declare function normalizedFontMeta(meta: WebFontMeta | string, defaultProvider: WebFontsProviders): ResolvedWebFontMeta;
|
|
61
|
+
declare function preset(options?: WebFontsOptions): Preset<any>;
|
|
62
|
+
|
|
63
|
+
export { type Provider, type ResolvedWebFontMeta, type WebFontMeta, type WebFontsOptions, type WebFontsProviders, createGoogleCompatibleProvider as createGoogleProvider, preset as default, normalizedFontMeta };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Preset } from '@unocss/core';
|
|
2
|
+
|
|
3
|
+
type WebFontsProviders = 'google' | 'bunny' | 'fontshare' | 'none' | Provider;
|
|
4
|
+
interface WebFontMeta {
|
|
5
|
+
name: string;
|
|
6
|
+
weights?: (string | number)[];
|
|
7
|
+
italic?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Override the provider
|
|
10
|
+
* @default <matches root config>
|
|
11
|
+
*/
|
|
12
|
+
provider?: WebFontsProviders;
|
|
13
|
+
}
|
|
14
|
+
interface ResolvedWebFontMeta extends Omit<WebFontMeta, 'provider'> {
|
|
15
|
+
provider: Provider;
|
|
16
|
+
}
|
|
17
|
+
interface WebFontsOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Provider service of the web fonts
|
|
20
|
+
* @default 'google'
|
|
21
|
+
*/
|
|
22
|
+
provider?: WebFontsProviders;
|
|
23
|
+
/**
|
|
24
|
+
* The fonts
|
|
25
|
+
*/
|
|
26
|
+
fonts?: Record<string, WebFontMeta | string | (WebFontMeta | string)[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Extend fonts to the theme object
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
extendTheme?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Key for the theme object
|
|
34
|
+
*
|
|
35
|
+
* @default 'fontFamily'
|
|
36
|
+
*/
|
|
37
|
+
themeKey?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Inline CSS @import()
|
|
40
|
+
*
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
inlineImports?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Custom fetch function
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
customFetch?: (url: string) => Promise<any>;
|
|
50
|
+
}
|
|
51
|
+
interface Provider {
|
|
52
|
+
name: WebFontsProviders;
|
|
53
|
+
getPreflight?(fonts: WebFontMeta[]): string;
|
|
54
|
+
getImportUrl?(fonts: WebFontMeta[]): string | undefined;
|
|
55
|
+
getFontName?(font: WebFontMeta): string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare function createGoogleCompatibleProvider(name: WebFontsProviders, host: string): Provider;
|
|
59
|
+
|
|
60
|
+
declare function normalizedFontMeta(meta: WebFontMeta | string, defaultProvider: WebFontsProviders): ResolvedWebFontMeta;
|
|
61
|
+
declare function preset(options?: WebFontsOptions): Preset<any>;
|
|
62
|
+
|
|
63
|
+
export { type Provider, type ResolvedWebFontMeta, type WebFontMeta, type WebFontsOptions, type WebFontsProviders, createGoogleCompatibleProvider as createGoogleProvider, preset as default, normalizedFontMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -60,4 +60,4 @@ declare function createGoogleCompatibleProvider(name: WebFontsProviders, host: s
|
|
|
60
60
|
declare function normalizedFontMeta(meta: WebFontMeta | string, defaultProvider: WebFontsProviders): ResolvedWebFontMeta;
|
|
61
61
|
declare function preset(options?: WebFontsOptions): Preset<any>;
|
|
62
62
|
|
|
63
|
-
export { Provider, ResolvedWebFontMeta, WebFontMeta, WebFontsOptions, WebFontsProviders, createGoogleCompatibleProvider as createGoogleProvider, preset as default, normalizedFontMeta };
|
|
63
|
+
export { type Provider, type ResolvedWebFontMeta, type WebFontMeta, type WebFontsOptions, type WebFontsProviders, createGoogleCompatibleProvider as createGoogleProvider, preset as default, normalizedFontMeta };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-web-fonts",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.3",
|
|
4
4
|
"description": "Web Fonts support for Uno CSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"*.css"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"ofetch": "^1.
|
|
41
|
-
"@unocss/core": "0.55.
|
|
40
|
+
"ofetch": "^1.3.3",
|
|
41
|
+
"@unocss/core": "0.55.3"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|