diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 33ac650937a..1961c4ea5fc 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -431,6 +431,7 @@ "./vs/platform/update/node/update.config.contribution.ts", "./vs/platform/url/common/url.ts", "./vs/platform/url/common/urlService.ts", + "./vs/platform/windows/common/windows.ts", "./vs/platform/workbench/common/contextkeys.ts", "./vs/platform/workspace/common/workspace.ts", "./vs/platform/workspace/test/common/testWorkspace.ts", diff --git a/src/vs/platform/storage/common/storage.ts b/src/vs/platform/storage/common/storage.ts index fb6e3fd3a0c..913e2f0610a 100644 --- a/src/vs/platform/storage/common/storage.ts +++ b/src/vs/platform/storage/common/storage.ts @@ -30,7 +30,7 @@ export interface IStorageService { * The scope argument allows to define the scope of the storage * operation to either the current workspace only or all workspaces. */ - get(key: string, scope: StorageScope, fallbackValue?: string): string | undefined; + get(key: string, scope: StorageScope, fallbackValue?: R): R; /** * Retrieve an element stored with the given key from storage. Use @@ -40,7 +40,7 @@ export interface IStorageService { * The scope argument allows to define the scope of the storage * operation to either the current workspace only or all workspaces. */ - getBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined; + getBoolean(key: string, scope: StorageScope, fallbackValue?: R): R; /** * Retrieve an element stored with the given key from storage. Use @@ -50,7 +50,7 @@ export interface IStorageService { * The scope argument allows to define the scope of the storage * operation to either the current workspace only or all workspaces. */ - getInteger(key: string, scope: StorageScope, fallbackValue?: number): number | undefined; + getInteger(key: string, scope: StorageScope, fallbackValue?: R): R; /** * Store a string value under the given key to storage. The value will @@ -94,16 +94,16 @@ export const NullStorageService: IStorageService = { onDidChangeStorage: Event.None, onWillSaveState: Event.None, - get(key: string, scope: StorageScope, fallbackValue?: string): string | undefined { - return fallbackValue; + get(key: string, scope: StorageScope, fallbackValue?: R): R { + return fallbackValue as R; }, - getBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined { - return fallbackValue; + getBoolean(key: string, scope: StorageScope, fallbackValue?: R): R { + return fallbackValue as R; }, - getInteger(key: string, scope: StorageScope, fallbackValue?: number): number | undefined { - return fallbackValue; + getInteger(key: string, scope: StorageScope, fallbackValue?: R): R { + return fallbackValue as R; }, store(key: string, value: any, scope: StorageScope): Promise { diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index facb0567866..7b0472e8d94 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -379,7 +379,7 @@ export class ActiveWindowManager implements IDisposable { .then(id => (typeof this._activeWindowId === 'undefined') && this.setActiveWindow(id)); } - private setActiveWindow(windowId: number) { + private setActiveWindow(windowId: number | undefined) { if (this.firstActiveWindowIdPromise) { this.firstActiveWindowIdPromise = null; }