Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
feat(schema): sync types of Vite v2.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
brownsugar committed Jul 14, 2022
1 parent f5301e9 commit 55602ae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/schema/src/types/global/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ export interface ViteHot {
decline (): void
invalidate (): void

on: (event: 'any', cb: (payload: any) => void) => void
on (event: any, cb: (payload: any) => void): void
send (event: any, data?: any): void
}

export interface ViteGlobOptions {
as?: string
}

export interface ViteImportMeta {
/** Vite client HMR API - see https://vitejs.dev/guide/api-hmr.html */
readonly hot?: ViteHot

/** vite glob import utility - https://vitejs.dev/guide/features.html#glob-import */
glob?(pattern: string): Record<string, () => Promise<Record<string, any>>>
glob?(pattern: string, options?: ViteGlobOptions): Record<string, () => Promise<Record<string, any>>>

/** vite glob import utility - https://vitejs.dev/guide/features.html#glob-import */
globEager?(pattern: string): Record<string, Record<string, any>>
globEager?(pattern: string, options?: ViteGlobOptions): Record<string, Record<string, any>>
}

0 comments on commit 55602ae

Please sign in to comment.