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

feat(schema): sync types of vite v2.9.x #5896

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>>
}