@theia/application-package 1.48.1 → 1.48.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,173 +1,173 @@
1
- import type { BrowserWindowConstructorOptions } from 'electron';
2
- export import deepmerge = require('deepmerge');
3
- export declare type RequiredRecursive<T> = {
4
- [K in keyof T]-?: T[K] extends object ? RequiredRecursive<T[K]> : T[K];
5
- };
6
- /**
7
- * Base configuration for the Theia application.
8
- */
9
- export interface ApplicationConfig {
10
- readonly [key: string]: any;
11
- }
12
- export declare type ElectronFrontendApplicationConfig = RequiredRecursive<ElectronFrontendApplicationConfig.Partial>;
13
- export declare namespace ElectronFrontendApplicationConfig {
14
- const DEFAULT: ElectronFrontendApplicationConfig;
15
- interface Partial {
16
- /**
17
- * Override or add properties to the electron `windowOptions`.
18
- *
19
- * Defaults to `{}`.
20
- */
21
- readonly windowOptions?: BrowserWindowConstructorOptions;
22
- /**
23
- * Whether or not to show an empty Electron window as early as possible.
24
- *
25
- * Defaults to `true`.
26
- */
27
- readonly showWindowEarly?: boolean;
28
- }
29
- }
30
- export declare type DefaultTheme = string | Readonly<{
31
- light: string;
32
- dark: string;
33
- }>;
34
- export declare namespace DefaultTheme {
35
- function defaultForOSTheme(theme: DefaultTheme): string;
36
- function defaultBackgroundColor(dark?: boolean): string;
37
- }
38
- /**
39
- * Application configuration for the frontend. The following properties will be injected into the `index.html`.
40
- */
41
- export declare type FrontendApplicationConfig = RequiredRecursive<FrontendApplicationConfig.Partial>;
42
- export declare namespace FrontendApplicationConfig {
43
- const DEFAULT: FrontendApplicationConfig;
44
- interface Partial extends ApplicationConfig {
45
- /**
46
- * The default theme for the application.
47
- *
48
- * Defaults to `dark` if the OS's theme is dark. Otherwise `light`.
49
- */
50
- readonly defaultTheme?: DefaultTheme;
51
- /**
52
- * The default icon theme for the application.
53
- *
54
- * Defaults to `none`.
55
- */
56
- readonly defaultIconTheme?: string;
57
- /**
58
- * The name of the application.
59
- *
60
- * Defaults to `Eclipse Theia`.
61
- */
62
- readonly applicationName?: string;
63
- /**
64
- * Electron specific configuration.
65
- *
66
- * Defaults to `ElectronFrontendApplicationConfig.DEFAULT`.
67
- */
68
- readonly electron?: ElectronFrontendApplicationConfig.Partial;
69
- /**
70
- * The default locale for the application.
71
- *
72
- * Defaults to "".
73
- */
74
- readonly defaultLocale?: string;
75
- /**
76
- * When `true`, the application will validate the JSON schema of the preferences on start
77
- * and log warnings to the console if the schema is not valid.
78
- *
79
- * Defaults to `true`.
80
- */
81
- readonly validatePreferencesSchema?: boolean;
82
- /**
83
- * When 'true', the window will reload in case the front end reconnects to a back-end,
84
- * but the back end does not have a connection context for this front end anymore.
85
- */
86
- readonly reloadOnReconnect?: boolean;
87
- }
88
- }
89
- /**
90
- * Application configuration for the backend.
91
- */
92
- export declare type BackendApplicationConfig = RequiredRecursive<BackendApplicationConfig.Partial>;
93
- export declare namespace BackendApplicationConfig {
94
- const DEFAULT: BackendApplicationConfig;
95
- interface Partial extends ApplicationConfig {
96
- /**
97
- * If true and in Electron mode, only one instance of the application is allowed to run at a time.
98
- *
99
- * Defaults to `false`.
100
- */
101
- readonly singleInstance?: boolean;
102
- /**
103
- * The time in ms the connection context will be preserved for reconnection after a front end disconnects.
104
- */
105
- readonly frontendConnectionTimeout?: number;
106
- }
107
- }
108
- /**
109
- * Configuration for the generator.
110
- */
111
- export declare type GeneratorConfig = RequiredRecursive<GeneratorConfig.Partial>;
112
- export declare namespace GeneratorConfig {
113
- const DEFAULT: GeneratorConfig;
114
- interface Partial {
115
- /**
116
- * Template to use for extra preload content markup (file path or HTML).
117
- *
118
- * Defaults to `''`.
119
- */
120
- readonly preloadTemplate?: string;
121
- }
122
- }
123
- export interface NpmRegistryProps {
124
- /**
125
- * Defaults to `false`.
126
- */
127
- readonly next: boolean;
128
- /**
129
- * Defaults to `https://registry.npmjs.org/`.
130
- */
131
- readonly registry: string;
132
- }
133
- export declare namespace NpmRegistryProps {
134
- const DEFAULT: NpmRegistryProps;
135
- }
136
- /**
137
- * Representation of all backend and frontend related Theia extension and application properties.
138
- */
139
- export interface ApplicationProps extends NpmRegistryProps {
140
- readonly [key: string]: any;
141
- /**
142
- * Whether the extension targets the browser or electron. Defaults to `browser`.
143
- */
144
- readonly target: ApplicationProps.Target;
145
- /**
146
- * Frontend related properties.
147
- */
148
- readonly frontend: {
149
- readonly config: FrontendApplicationConfig;
150
- };
151
- /**
152
- * Backend specific properties.
153
- */
154
- readonly backend: {
155
- readonly config: BackendApplicationConfig;
156
- };
157
- /**
158
- * Generator specific properties.
159
- */
160
- readonly generator: {
161
- readonly config: GeneratorConfig;
162
- };
163
- }
164
- export declare namespace ApplicationProps {
165
- type Target = `${ApplicationTarget}`;
166
- enum ApplicationTarget {
167
- browser = "browser",
168
- electron = "electron",
169
- browserOnly = "browser-only"
170
- }
171
- const DEFAULT: ApplicationProps;
172
- }
1
+ import type { BrowserWindowConstructorOptions } from 'electron';
2
+ export import deepmerge = require('deepmerge');
3
+ export declare type RequiredRecursive<T> = {
4
+ [K in keyof T]-?: T[K] extends object ? RequiredRecursive<T[K]> : T[K];
5
+ };
6
+ /**
7
+ * Base configuration for the Theia application.
8
+ */
9
+ export interface ApplicationConfig {
10
+ readonly [key: string]: any;
11
+ }
12
+ export declare type ElectronFrontendApplicationConfig = RequiredRecursive<ElectronFrontendApplicationConfig.Partial>;
13
+ export declare namespace ElectronFrontendApplicationConfig {
14
+ const DEFAULT: ElectronFrontendApplicationConfig;
15
+ interface Partial {
16
+ /**
17
+ * Override or add properties to the electron `windowOptions`.
18
+ *
19
+ * Defaults to `{}`.
20
+ */
21
+ readonly windowOptions?: BrowserWindowConstructorOptions;
22
+ /**
23
+ * Whether or not to show an empty Electron window as early as possible.
24
+ *
25
+ * Defaults to `true`.
26
+ */
27
+ readonly showWindowEarly?: boolean;
28
+ }
29
+ }
30
+ export declare type DefaultTheme = string | Readonly<{
31
+ light: string;
32
+ dark: string;
33
+ }>;
34
+ export declare namespace DefaultTheme {
35
+ function defaultForOSTheme(theme: DefaultTheme): string;
36
+ function defaultBackgroundColor(dark?: boolean): string;
37
+ }
38
+ /**
39
+ * Application configuration for the frontend. The following properties will be injected into the `index.html`.
40
+ */
41
+ export declare type FrontendApplicationConfig = RequiredRecursive<FrontendApplicationConfig.Partial>;
42
+ export declare namespace FrontendApplicationConfig {
43
+ const DEFAULT: FrontendApplicationConfig;
44
+ interface Partial extends ApplicationConfig {
45
+ /**
46
+ * The default theme for the application.
47
+ *
48
+ * Defaults to `dark` if the OS's theme is dark. Otherwise `light`.
49
+ */
50
+ readonly defaultTheme?: DefaultTheme;
51
+ /**
52
+ * The default icon theme for the application.
53
+ *
54
+ * Defaults to `none`.
55
+ */
56
+ readonly defaultIconTheme?: string;
57
+ /**
58
+ * The name of the application.
59
+ *
60
+ * Defaults to `Eclipse Theia`.
61
+ */
62
+ readonly applicationName?: string;
63
+ /**
64
+ * Electron specific configuration.
65
+ *
66
+ * Defaults to `ElectronFrontendApplicationConfig.DEFAULT`.
67
+ */
68
+ readonly electron?: ElectronFrontendApplicationConfig.Partial;
69
+ /**
70
+ * The default locale for the application.
71
+ *
72
+ * Defaults to "".
73
+ */
74
+ readonly defaultLocale?: string;
75
+ /**
76
+ * When `true`, the application will validate the JSON schema of the preferences on start
77
+ * and log warnings to the console if the schema is not valid.
78
+ *
79
+ * Defaults to `true`.
80
+ */
81
+ readonly validatePreferencesSchema?: boolean;
82
+ /**
83
+ * When 'true', the window will reload in case the front end reconnects to a back-end,
84
+ * but the back end does not have a connection context for this front end anymore.
85
+ */
86
+ readonly reloadOnReconnect?: boolean;
87
+ }
88
+ }
89
+ /**
90
+ * Application configuration for the backend.
91
+ */
92
+ export declare type BackendApplicationConfig = RequiredRecursive<BackendApplicationConfig.Partial>;
93
+ export declare namespace BackendApplicationConfig {
94
+ const DEFAULT: BackendApplicationConfig;
95
+ interface Partial extends ApplicationConfig {
96
+ /**
97
+ * If true and in Electron mode, only one instance of the application is allowed to run at a time.
98
+ *
99
+ * Defaults to `false`.
100
+ */
101
+ readonly singleInstance?: boolean;
102
+ /**
103
+ * The time in ms the connection context will be preserved for reconnection after a front end disconnects.
104
+ */
105
+ readonly frontendConnectionTimeout?: number;
106
+ }
107
+ }
108
+ /**
109
+ * Configuration for the generator.
110
+ */
111
+ export declare type GeneratorConfig = RequiredRecursive<GeneratorConfig.Partial>;
112
+ export declare namespace GeneratorConfig {
113
+ const DEFAULT: GeneratorConfig;
114
+ interface Partial {
115
+ /**
116
+ * Template to use for extra preload content markup (file path or HTML).
117
+ *
118
+ * Defaults to `''`.
119
+ */
120
+ readonly preloadTemplate?: string;
121
+ }
122
+ }
123
+ export interface NpmRegistryProps {
124
+ /**
125
+ * Defaults to `false`.
126
+ */
127
+ readonly next: boolean;
128
+ /**
129
+ * Defaults to `https://registry.npmjs.org/`.
130
+ */
131
+ readonly registry: string;
132
+ }
133
+ export declare namespace NpmRegistryProps {
134
+ const DEFAULT: NpmRegistryProps;
135
+ }
136
+ /**
137
+ * Representation of all backend and frontend related Theia extension and application properties.
138
+ */
139
+ export interface ApplicationProps extends NpmRegistryProps {
140
+ readonly [key: string]: any;
141
+ /**
142
+ * Whether the extension targets the browser or electron. Defaults to `browser`.
143
+ */
144
+ readonly target: ApplicationProps.Target;
145
+ /**
146
+ * Frontend related properties.
147
+ */
148
+ readonly frontend: {
149
+ readonly config: FrontendApplicationConfig;
150
+ };
151
+ /**
152
+ * Backend specific properties.
153
+ */
154
+ readonly backend: {
155
+ readonly config: BackendApplicationConfig;
156
+ };
157
+ /**
158
+ * Generator specific properties.
159
+ */
160
+ readonly generator: {
161
+ readonly config: GeneratorConfig;
162
+ };
163
+ }
164
+ export declare namespace ApplicationProps {
165
+ type Target = `${ApplicationTarget}`;
166
+ enum ApplicationTarget {
167
+ browser = "browser",
168
+ electron = "electron",
169
+ browserOnly = "browser-only"
170
+ }
171
+ const DEFAULT: ApplicationProps;
172
+ }
173
173
  //# sourceMappingURL=application-props.d.ts.map
@@ -1,103 +1,103 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ApplicationProps = exports.NpmRegistryProps = exports.GeneratorConfig = exports.BackendApplicationConfig = exports.FrontendApplicationConfig = exports.DefaultTheme = exports.ElectronFrontendApplicationConfig = void 0;
19
- exports.deepmerge = require("deepmerge");
20
- var ElectronFrontendApplicationConfig;
21
- (function (ElectronFrontendApplicationConfig) {
22
- ElectronFrontendApplicationConfig.DEFAULT = {
23
- windowOptions: {},
24
- showWindowEarly: true
25
- };
26
- })(ElectronFrontendApplicationConfig = exports.ElectronFrontendApplicationConfig || (exports.ElectronFrontendApplicationConfig = {}));
27
- var DefaultTheme;
28
- (function (DefaultTheme) {
29
- function defaultForOSTheme(theme) {
30
- if (typeof theme === 'string') {
31
- return theme;
32
- }
33
- if (typeof window !== 'undefined' &&
34
- window.matchMedia &&
35
- window.matchMedia('(prefers-color-scheme: dark)').matches) {
36
- return theme.dark;
37
- }
38
- return theme.light;
39
- }
40
- DefaultTheme.defaultForOSTheme = defaultForOSTheme;
41
- function defaultBackgroundColor(dark) {
42
- // The default light background color is based on the `colors#editor.background` value from
43
- // `packages/monaco/data/monaco-themes/vscode/dark_vs.json` and the dark background comes from the `light_vs.json`.
44
- return dark ? '#1E1E1E' : '#FFFFFF';
45
- }
46
- DefaultTheme.defaultBackgroundColor = defaultBackgroundColor;
47
- })(DefaultTheme = exports.DefaultTheme || (exports.DefaultTheme = {}));
48
- var FrontendApplicationConfig;
49
- (function (FrontendApplicationConfig) {
50
- FrontendApplicationConfig.DEFAULT = {
51
- applicationName: 'Eclipse Theia',
52
- defaultTheme: { light: 'light', dark: 'dark' },
53
- defaultIconTheme: 'theia-file-icons',
54
- electron: ElectronFrontendApplicationConfig.DEFAULT,
55
- defaultLocale: '',
56
- validatePreferencesSchema: true,
57
- reloadOnReconnect: false
58
- };
59
- })(FrontendApplicationConfig = exports.FrontendApplicationConfig || (exports.FrontendApplicationConfig = {}));
60
- var BackendApplicationConfig;
61
- (function (BackendApplicationConfig) {
62
- BackendApplicationConfig.DEFAULT = {
63
- singleInstance: false,
64
- frontendConnectionTimeout: 0
65
- };
66
- })(BackendApplicationConfig = exports.BackendApplicationConfig || (exports.BackendApplicationConfig = {}));
67
- var GeneratorConfig;
68
- (function (GeneratorConfig) {
69
- GeneratorConfig.DEFAULT = {
70
- preloadTemplate: ''
71
- };
72
- })(GeneratorConfig = exports.GeneratorConfig || (exports.GeneratorConfig = {}));
73
- var NpmRegistryProps;
74
- (function (NpmRegistryProps) {
75
- NpmRegistryProps.DEFAULT = {
76
- next: false,
77
- registry: 'https://registry.npmjs.org/'
78
- };
79
- })(NpmRegistryProps = exports.NpmRegistryProps || (exports.NpmRegistryProps = {}));
80
- var ApplicationProps;
81
- (function (ApplicationProps) {
82
- let ApplicationTarget;
83
- (function (ApplicationTarget) {
84
- ApplicationTarget["browser"] = "browser";
85
- ApplicationTarget["electron"] = "electron";
86
- ApplicationTarget["browserOnly"] = "browser-only";
87
- })(ApplicationTarget = ApplicationProps.ApplicationTarget || (ApplicationProps.ApplicationTarget = {}));
88
- ;
89
- ApplicationProps.DEFAULT = {
90
- ...NpmRegistryProps.DEFAULT,
91
- target: 'browser',
92
- backend: {
93
- config: BackendApplicationConfig.DEFAULT
94
- },
95
- frontend: {
96
- config: FrontendApplicationConfig.DEFAULT
97
- },
98
- generator: {
99
- config: GeneratorConfig.DEFAULT
100
- }
101
- };
102
- })(ApplicationProps = exports.ApplicationProps || (exports.ApplicationProps = {}));
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ApplicationProps = exports.NpmRegistryProps = exports.GeneratorConfig = exports.BackendApplicationConfig = exports.FrontendApplicationConfig = exports.DefaultTheme = exports.ElectronFrontendApplicationConfig = void 0;
19
+ exports.deepmerge = require("deepmerge");
20
+ var ElectronFrontendApplicationConfig;
21
+ (function (ElectronFrontendApplicationConfig) {
22
+ ElectronFrontendApplicationConfig.DEFAULT = {
23
+ windowOptions: {},
24
+ showWindowEarly: true
25
+ };
26
+ })(ElectronFrontendApplicationConfig = exports.ElectronFrontendApplicationConfig || (exports.ElectronFrontendApplicationConfig = {}));
27
+ var DefaultTheme;
28
+ (function (DefaultTheme) {
29
+ function defaultForOSTheme(theme) {
30
+ if (typeof theme === 'string') {
31
+ return theme;
32
+ }
33
+ if (typeof window !== 'undefined' &&
34
+ window.matchMedia &&
35
+ window.matchMedia('(prefers-color-scheme: dark)').matches) {
36
+ return theme.dark;
37
+ }
38
+ return theme.light;
39
+ }
40
+ DefaultTheme.defaultForOSTheme = defaultForOSTheme;
41
+ function defaultBackgroundColor(dark) {
42
+ // The default light background color is based on the `colors#editor.background` value from
43
+ // `packages/monaco/data/monaco-themes/vscode/dark_vs.json` and the dark background comes from the `light_vs.json`.
44
+ return dark ? '#1E1E1E' : '#FFFFFF';
45
+ }
46
+ DefaultTheme.defaultBackgroundColor = defaultBackgroundColor;
47
+ })(DefaultTheme = exports.DefaultTheme || (exports.DefaultTheme = {}));
48
+ var FrontendApplicationConfig;
49
+ (function (FrontendApplicationConfig) {
50
+ FrontendApplicationConfig.DEFAULT = {
51
+ applicationName: 'Eclipse Theia',
52
+ defaultTheme: { light: 'light', dark: 'dark' },
53
+ defaultIconTheme: 'theia-file-icons',
54
+ electron: ElectronFrontendApplicationConfig.DEFAULT,
55
+ defaultLocale: '',
56
+ validatePreferencesSchema: true,
57
+ reloadOnReconnect: false
58
+ };
59
+ })(FrontendApplicationConfig = exports.FrontendApplicationConfig || (exports.FrontendApplicationConfig = {}));
60
+ var BackendApplicationConfig;
61
+ (function (BackendApplicationConfig) {
62
+ BackendApplicationConfig.DEFAULT = {
63
+ singleInstance: false,
64
+ frontendConnectionTimeout: 0
65
+ };
66
+ })(BackendApplicationConfig = exports.BackendApplicationConfig || (exports.BackendApplicationConfig = {}));
67
+ var GeneratorConfig;
68
+ (function (GeneratorConfig) {
69
+ GeneratorConfig.DEFAULT = {
70
+ preloadTemplate: ''
71
+ };
72
+ })(GeneratorConfig = exports.GeneratorConfig || (exports.GeneratorConfig = {}));
73
+ var NpmRegistryProps;
74
+ (function (NpmRegistryProps) {
75
+ NpmRegistryProps.DEFAULT = {
76
+ next: false,
77
+ registry: 'https://registry.npmjs.org/'
78
+ };
79
+ })(NpmRegistryProps = exports.NpmRegistryProps || (exports.NpmRegistryProps = {}));
80
+ var ApplicationProps;
81
+ (function (ApplicationProps) {
82
+ let ApplicationTarget;
83
+ (function (ApplicationTarget) {
84
+ ApplicationTarget["browser"] = "browser";
85
+ ApplicationTarget["electron"] = "electron";
86
+ ApplicationTarget["browserOnly"] = "browser-only";
87
+ })(ApplicationTarget = ApplicationProps.ApplicationTarget || (ApplicationProps.ApplicationTarget = {}));
88
+ ;
89
+ ApplicationProps.DEFAULT = {
90
+ ...NpmRegistryProps.DEFAULT,
91
+ target: 'browser',
92
+ backend: {
93
+ config: BackendApplicationConfig.DEFAULT
94
+ },
95
+ frontend: {
96
+ config: FrontendApplicationConfig.DEFAULT
97
+ },
98
+ generator: {
99
+ config: GeneratorConfig.DEFAULT
100
+ }
101
+ };
102
+ })(ApplicationProps = exports.ApplicationProps || (exports.ApplicationProps = {}));
103
103
  //# sourceMappingURL=application-props.js.map
@@ -1,40 +1,40 @@
1
- /**
2
- * The electron specific environment.
3
- */
4
- declare class ElectronEnv {
5
- /**
6
- * Environment variable that can be accessed on the `process` to check if running in electron or not.
7
- */
8
- readonly THEIA_ELECTRON_VERSION = "THEIA_ELECTRON_VERSION";
9
- /**
10
- * `true` if running in electron. Otherwise, `false`.
11
- *
12
- * Can be called from both the `main` and the render process. Also works for forked cluster workers.
13
- */
14
- is(): boolean;
15
- /**
16
- * `true` if running in Electron in development mode. Otherwise, `false`.
17
- *
18
- * Cannot be used from the browser. From the browser, it is always `false`.
19
- */
20
- isDevMode(): boolean;
21
- /**
22
- * Creates and return with a new environment object which always contains the `ELECTRON_RUN_AS_NODE: 1` property pair.
23
- * This should be used to `spawn` and `fork` a new Node.js process from the Node.js shipped with Electron. Otherwise, a new Electron
24
- * process will be spawned which [has side-effects](https://github.com/eclipse-theia/theia/issues/5385).
25
- *
26
- * If called from the backend and the `env` argument is not defined, it falls back to `process.env` such as Node.js behaves
27
- * with the [`SpawnOptions`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).
28
- * If `env` is defined, it will be shallow-copied.
29
- *
30
- * Calling this function from the frontend does not make any sense, hence throw an error.
31
- */
32
- runAsNodeEnv(env?: any): any & {
33
- ELECTRON_RUN_AS_NODE: 1;
34
- };
35
- }
36
- declare const environment: Readonly<{
37
- electron: ElectronEnv;
38
- }>;
39
- export { environment };
1
+ /**
2
+ * The electron specific environment.
3
+ */
4
+ declare class ElectronEnv {
5
+ /**
6
+ * Environment variable that can be accessed on the `process` to check if running in electron or not.
7
+ */
8
+ readonly THEIA_ELECTRON_VERSION = "THEIA_ELECTRON_VERSION";
9
+ /**
10
+ * `true` if running in electron. Otherwise, `false`.
11
+ *
12
+ * Can be called from both the `main` and the render process. Also works for forked cluster workers.
13
+ */
14
+ is(): boolean;
15
+ /**
16
+ * `true` if running in Electron in development mode. Otherwise, `false`.
17
+ *
18
+ * Cannot be used from the browser. From the browser, it is always `false`.
19
+ */
20
+ isDevMode(): boolean;
21
+ /**
22
+ * Creates and return with a new environment object which always contains the `ELECTRON_RUN_AS_NODE: 1` property pair.
23
+ * This should be used to `spawn` and `fork` a new Node.js process from the Node.js shipped with Electron. Otherwise, a new Electron
24
+ * process will be spawned which [has side-effects](https://github.com/eclipse-theia/theia/issues/5385).
25
+ *
26
+ * If called from the backend and the `env` argument is not defined, it falls back to `process.env` such as Node.js behaves
27
+ * with the [`SpawnOptions`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).
28
+ * If `env` is defined, it will be shallow-copied.
29
+ *
30
+ * Calling this function from the frontend does not make any sense, hence throw an error.
31
+ */
32
+ runAsNodeEnv(env?: any): any & {
33
+ ELECTRON_RUN_AS_NODE: 1;
34
+ };
35
+ }
36
+ declare const environment: Readonly<{
37
+ electron: ElectronEnv;
38
+ }>;
39
+ export { environment };
40
40
  //# sourceMappingURL=environment.d.ts.map