From b81c9c3a92cb4be8cefaa3e10fea73398b983d2d Mon Sep 17 00:00:00 2001 From: Lay Date: Thu, 14 Jul 2022 22:03:18 +0800 Subject: [PATCH] feat(schema): sync types of vite v2.9.x (#5896) --- packages/schema/src/types/global/vite.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/schema/src/types/global/vite.ts b/packages/schema/src/types/global/vite.ts index ab5097b4e8..eafddced7d 100644 --- a/packages/schema/src/types/global/vite.ts +++ b/packages/schema/src/types/global/vite.ts @@ -14,7 +14,12 @@ 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 { @@ -22,8 +27,8 @@ export interface ViteImportMeta { readonly hot?: ViteHot /** vite glob import utility - https://vitejs.dev/guide/features.html#glob-import */ - glob?(pattern: string): Record Promise>> + glob?(pattern: string, options?: ViteGlobOptions): Record Promise>> /** vite glob import utility - https://vitejs.dev/guide/features.html#glob-import */ - globEager?(pattern: string): Record> + globEager?(pattern: string, options?: ViteGlobOptions): Record> }