-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathenv.d.ts
More file actions
50 lines (47 loc) · 1.38 KB
/
env.d.ts
File metadata and controls
50 lines (47 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/// <reference types="./env-webview.d.ts" />
import type { WebviewHtmlOptions } from 'virtual:vscode';
// Make this a module
export {};
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_WEBVIEW_DIST?: string;
}
}
/**
* Gets the html of webview. It's deprecated. Please use `import { getWebviewHtml } from 'virtual:vscode';`.
*
* @example
* import type { ExtensionContext, Webview } from 'vscode';
* import { getWebviewHtml } from 'virtual:vscode';
* import { window } from 'vscode';
*
* export class WebviewHelper {
* public static setupHtml(webview: Webview, context: ExtensionContext) {
* return getWebviewHtml({
* serverUrl: process.env.VITE_DEV_SERVER_URL,
* webview,
* context,
* injectCode: `<script>window.__FLAG1__=666;window.__FLAG2__=888;</script>`,
* });
* }
*
* @deprecated
*/
function __getWebviewHtml__(options?: WebviewHtmlOptions): string;
}