diff --git a/env.d.ts b/env.d.ts index 11abdf6..242da4e 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1,21 +1,31 @@ -/** - * fix code hint - */ -type UnionType = T | (string & {}); +export {}; // Make this a module -declare namespace NodeJS { - interface ProcessEnv { - /** - * Node.js environment - */ - NODE_ENV: UnionType<'development' | 'production'>; - /** - * development mode. The url of the vite dev server. - */ - VITE_DEV_SERVER_URL?: string; - /** - * production mode. All js files in the dist directory, excluding index.js. It's to be a json string. - */ - VITE_DIST_FILES?: string; +declare global { + /** + * fix code hint + */ + type UnionType = T | (string & {}); + + namespace NodeJS { + interface ProcessEnv { + /** + * Node.js environment + */ + NODE_ENV: UnionType<'development' | 'production'>; + /** + * `[vite serve]` The url of the vite dev server. + */ + VITE_DEV_SERVER_URL?: string; + /** + * `[vite build]` All js files in the dist directory, excluding index.js. It's to be a json string. + */ + VITE_DIST_FILES?: string; + } } + + /** + * `[vite serve]` Get the html of the development webview. + * @param options serverUrl: The url of the vite dev server. + */ + function __getWebviewHtml__(options?: string | { serverUrl: string }): string; }