Skip to content

Commit 99bb608

Browse files
committed
chore: fix typecheck against the module stub
1 parent ab7b45f commit 99bb608

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎src/assets.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { H3Event } from 'h3'
99
import { eventHandler, createEvent, createError, setResponseHeader } from 'h3'
1010
import { defu } from 'defu'
1111
import type { NitroConfig } from 'nitropack'
12+
import type { ViteDevServer } from 'vite'
1213
import { decodePath, hasProtocol, joinURL, parseURL, withoutBase, withoutLeadingSlash } from 'ufo'
1314
import { isAbsolute, join, relative } from 'pathe'
1415

@@ -130,7 +131,7 @@ export async function setupPublicAssetStrategy(storage: FontStorage, options: Mo
130131
// that are not scoped to a single one
131132
addVitePlugin({
132133
name: 'nuxt-fonts-public-assets',
133-
async configureServer(server) {
134+
async configureServer(server: ViteDevServer) {
134135
const handler = async (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => {
135136
try {
136137
const h3evt = createEvent(req, res)

‎src/subset-font.d.ts‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎src/subset.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ export async function assertSubsetter(rootDir: string, urls: string[]) {
7979
throw new Error(`Subsetting \`${urls.join('`, `')}\` requires the \`${packageName}\` package, as their provider cannot subset them for us. ${await installInstructions(rootDir)}`)
8080
}
8181

82-
let subsetter: Promise<typeof import('subset-font').default> | undefined
82+
type SubsetFont = (
83+
font: Buffer,
84+
text: string,
85+
options?: { targetFormat?: 'sfnt' | 'woff' | 'woff2', variationAxes?: Record<string, number | { min?: number, max?: number }>, preserveNameIds?: number[] },
86+
) => Promise<Buffer>
87+
88+
let subsetter: Promise<SubsetFont> | undefined
8389

8490
/**
8591
* `subset-font` is an optional peer dependency, and the harfbuzz wasm it loads is several

0 commit comments

Comments
 (0)