From 6440670f0a5b545e2ae83b531bfd7742262810f2 Mon Sep 17 00:00:00 2001 From: "Siddharth Gelera (reaper)" Date: Sun, 6 Oct 2024 21:15:44 +0530 Subject: [PATCH] feat(types): export the `FontStyles` type (#30) --- src/index.ts | 2 +- src/types.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9952fe6..319dec7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import type { InitializedProvider, Provider, ResolveFontOptions, ResolveFontResu import { createAsyncStorage, memoryStorage, type Storage } from './cache' export * as providers from './providers' -export type { FontFaceData, LocalFontSource, Provider, ProviderContext, ProviderDefinition, ProviderFactory, RemoteFontSource, ResolveFontOptions } from './types' +export type { FontFaceData, FontStyles, LocalFontSource, Provider, ProviderContext, ProviderDefinition, ProviderFactory, RemoteFontSource, ResolveFontOptions } from './types' export { defineFontProvider } from './utils' export interface UnifontOptions { diff --git a/src/types.ts b/src/types.ts index 4237c43..ebcc8a3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,9 +10,11 @@ export interface ProviderContext { } } +export type FontStyles = 'normal' | 'italic' | 'oblique' + export interface ResolveFontOptions { weights: string[] - styles: Array<'normal' | 'italic' | 'oblique'> + styles: FontStyles[] // TODO: improve support and support unicode range subsets: string[] fallbacks?: string[]