index.d.ts 865 B

1234567891011121314151617181920
  1. /// <reference types="vite/client" />
  2. type ViteHotContext = Exclude<ImportMeta['hot'], undefined>;
  3. interface ViteClient {
  4. createHotContext: (path: string) => ViteHotContext;
  5. }
  6. /**
  7. * Get the module of `/@vite/client`
  8. */
  9. declare function getViteClient(base?: string, warning?: boolean): Promise<ViteClient | undefined>;
  10. declare function createHotContext(path?: string, base?: string): Promise<ViteHotContext | undefined>;
  11. /**
  12. * Guess the vite client provided bases from the current pathname.
  13. */
  14. declare function guessBasesFromPathname(pathname?: string): string[];
  15. /**
  16. * Try to resolve the vite client provided bases.
  17. */
  18. declare function tryCreateHotContext(path?: string, bases?: string[]): Promise<ViteHotContext | undefined>;
  19. export { type ViteClient, type ViteHotContext, createHotContext, getViteClient, guessBasesFromPathname, tryCreateHotContext };