Skip to content

Commit 934856c

Browse files
committed
fix: more consistent type name
1 parent 7234729 commit 934856c

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
import type { GoogleProviderOptions } from './providers/google'
2+
import type { GoogleiconsProviderOptions } from './providers/googleicons'
3+
14
export * as providers from './providers'
25
export type { AdobeProviderOptions } from './providers/adobe'
3-
export type { GoogleFamilyOptions, GoogleOptions } from './providers/google'
4-
export type { GoogleiconsFamilyOptions, GoogleiconsOptions } from './providers/googleicons'
6+
export type { GoogleFamilyOptions, GoogleProviderOptions } from './providers/google'
7+
export type { GoogleiconsFamilyOptions, GoogleiconsProviderOptions } from './providers/googleicons'
58
export type { FontFaceData, FontFaceMeta, FontStyles, InitializedProvider, LocalFontSource, Provider, ProviderContext, ProviderDefinition, ProviderFactory, RemoteFontSource, ResolveFontOptions, ResolveFontResult } from './types'
69
export type { Unifont, UnifontOptions } from './unifont'
710

811
export { createUnifont, defaultResolveOptions } from './unifont'
912
export { defineFontProvider } from './utils'
13+
14+
/** @deprecated */
15+
export type GoogleOptions = GoogleProviderOptions
16+
/** @deprecated */
17+
export type GoogleiconsOptions = GoogleiconsProviderOptions

src/providers/google.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { cleanFontFaces, defineFontProvider, prepareWeights, splitCssIntoSubsets
77

88
type VariableAxis = 'opsz' | 'slnt' | 'wdth' | (string & {})
99

10-
export interface GoogleOptions {
10+
export interface GoogleProviderOptions {
1111
experimental?: {
1212
/**
1313
* Experimental: Setting variable axis configuration on a per-font basis.
@@ -47,7 +47,7 @@ export const userAgents: Partial<Record<FontFormat, string>> = {
4747
woff2: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
4848
}
4949

50-
export default defineFontProvider('google', async (providerOptions: GoogleOptions, ctx) => {
50+
export default defineFontProvider('google', async (providerOptions: GoogleProviderOptions, ctx) => {
5151
const googleFonts = await ctx.storage.getItem('google:meta.json', () => $fetch<{ familyMetadataList: FontIndexMeta[] }>('https://fonts.google.com/metadata/fonts', { responseType: 'json' }).then(r => r.familyMetadataList))
5252

5353
const styleMap = {

src/providers/googleicons.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { $fetch } from '../fetch'
55
import { cleanFontFaces, defineFontProvider } from '../utils'
66
import { userAgents } from './google'
77

8-
export interface GoogleiconsOptions {
8+
export interface GoogleiconsProviderOptions {
99
experimental?: {
1010
/**
1111
* Experimental: Specifying a list of icons to be included in the font for each font family.
@@ -31,7 +31,7 @@ export interface GoogleiconsFamilyOptions {
3131
}
3232
}
3333

34-
export default defineFontProvider('googleicons', async (providerOptions: GoogleiconsOptions, ctx) => {
34+
export default defineFontProvider('googleicons', async (providerOptions: GoogleiconsProviderOptions, ctx) => {
3535
const googleIcons = await ctx.storage.getItem('googleicons:meta.json', async () => {
3636
const data = await $fetch<string>(
3737
'https://fonts.google.com/metadata/icons?key=material_symbols&incomplete=true',

0 commit comments

Comments
 (0)