Skip to content

Commit

Permalink
optimize(types): Enhance compatibility of global types
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Jun 14, 2024
1 parent 02d66cb commit dc359f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
4 changes: 4 additions & 0 deletions src/typings/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@ declare namespace Env {
readonly VITE_STORAGE_PREFIX?: string;
}
}

interface ImportMeta {
readonly env: Env.ImportMeta;
}
42 changes: 21 additions & 21 deletions src/typings/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
interface Window {
/** NProgress instance */
NProgress?: import('nprogress').NProgress;
/** Ant-design-vue message instance */
$message?: import('ant-design-vue/es/message/interface').MessageInstance;
/** Ant-design-vue modal instance */
$modal?: Omit<import('ant-design-vue/es/modal/confirm').ModalStaticFunctions, 'warn'>;
/** Ant-design-vue notification instance */
$notification?: import('ant-design-vue/es/notification/interface').NotificationInstance;
}
export {};

interface ViewTransition {
ready: Promise<void>;
}
declare global {
export interface Window {
/** NProgress instance */
NProgress?: import('nprogress').NProgress;
/** Ant-design-vue message instance */
$message?: import('ant-design-vue/es/message/interface').MessageInstance;
/** Ant-design-vue modal instance */
$modal?: Omit<import('ant-design-vue/es/modal/confirm').ModalStaticFunctions, 'warn'>;
/** Ant-design-vue notification instance */
$notification?: import('ant-design-vue/es/notification/interface').NotificationInstance;
}

interface Document {
startViewTransition?: (callback: () => Promise<void> | void) => ViewTransition;
}
interface ViewTransition {
ready: Promise<void>;
}

interface ImportMeta {
readonly env: Env.ImportMeta;
}
export interface Document {
startViewTransition?: (callback: () => Promise<void> | void) => ViewTransition;
}

/** Build time of the project */
declare const BUILD_TIME: string;
/** Build time of the project */
export const BUILD_TIME: string;
}

0 comments on commit dc359f5

Please sign in to comment.