Skip to content

Commit

Permalink
fix: add env.d.ts to npm files
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed Jan 15, 2024
1 parent a25e6b6 commit 39f3c1e
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
/**
* fix code hint
*/
type UnionType<T> = 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> = 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;
}

0 comments on commit 39f3c1e

Please sign in to comment.