@codingame/monaco-vscode-lifecycle-service-override 21.3.4 → 21.5.0

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.
Files changed (3) hide show
  1. package/index.d.ts +12 -1
  2. package/index.js +20 -2
  3. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1,2 +1,13 @@
1
1
  import { type IEditorOverrideServices } from "@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices";
2
- export default function getServiceOverride(): IEditorOverrideServices;
2
+ import { StartupKind } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle";
3
+ interface StartupKindResolver {
4
+ (resolveDefault: () => StartupKind | undefined): StartupKind | undefined;
5
+ }
6
+ export interface LifecycleServiceParams {
7
+ /**
8
+ * Allows to force the startup kind
9
+ */
10
+ resolveStartupKind?: StartupKindResolver;
11
+ }
12
+ export default function getServiceOverride(options?: LifecycleServiceParams): IEditorOverrideServices;
13
+ export { StartupKind };
package/index.js CHANGED
@@ -1,14 +1,32 @@
1
1
 
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
2
3
  import '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices';
3
4
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
5
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
6
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
4
7
  import { BrowserLifecycleService } from './vscode/src/vs/workbench/services/lifecycle/browser/lifecycleService.js';
8
+ export { StartupKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
5
9
  import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
6
10
  import { TimerService } from './vscode/src/vs/workbench/services/timer/browser/timerService.js';
7
11
  import { ITimerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/timer/browser/timerService.service';
8
12
 
9
- function getServiceOverride() {
13
+ const DEFAULT_RESOLVE_STARTUP_KIND = (resolveDefault) => resolveDefault();
14
+ let BrowserLifecycleServiceOverride = class BrowserLifecycleServiceOverride extends BrowserLifecycleService {
15
+ constructor(params, logService, storageService) {
16
+ super(logService, storageService);
17
+ this.params = params;
18
+ }
19
+ doResolveStartupKind() {
20
+ return (this.params.resolveStartupKind ?? DEFAULT_RESOLVE_STARTUP_KIND)(() => super.doResolveStartupKind());
21
+ }
22
+ };
23
+ BrowserLifecycleServiceOverride = __decorate([
24
+ __param(1, ILogService),
25
+ __param(2, IStorageService)
26
+ ], BrowserLifecycleServiceOverride);
27
+ function getServiceOverride(options = {}) {
10
28
  return {
11
- [ILifecycleService.toString()]: new SyncDescriptor(BrowserLifecycleService),
29
+ [ILifecycleService.toString()]: new SyncDescriptor(BrowserLifecycleServiceOverride, [options]),
12
30
  [ITimerService.toString()]: new SyncDescriptor(TimerService)
13
31
  };
14
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-lifecycle-service-override",
3
- "version": "21.3.4",
3
+ "version": "21.5.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - lifecycle service-override",
6
6
  "keywords": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "21.3.4"
18
+ "@codingame/monaco-vscode-api": "21.5.0"
19
19
  },
20
20
  "main": "index.js",
21
21
  "module": "index.js",