UNPKG

@next/font

Version:

`@next/font` includes built-in automatic self-hosting for any font file. This means you can optimally load web fonts with zero layout shift, thanks to the underlying CSS size-adjust property used.

22 lines (21 loc) 703 B
import type { CssVariable, Display, NextFont, NextFontWithVariable } from '../types'; type LocalFont<T extends CssVariable | undefined = undefined> = { src: string | Array<{ path: string; weight?: string; style?: string; }>; display?: Display; weight?: string; style?: string; adjustFontFallback?: 'Arial' | 'Times New Roman' | false; fallback?: string[]; preload?: boolean; variable?: T; declarations?: Array<{ prop: string; value: string; }>; }; export default function localFont<T extends CssVariable | undefined = undefined>(options: LocalFont<T>): T extends undefined ? NextFont : NextFontWithVariable; export {};