Updates dependencies (typescript)

Fixes newly detected typescript errors
This commit is contained in:
Eric Amodio
2017-07-02 22:23:54 -04:00
parent 3d32d86998
commit 3081632815
11 changed files with 56 additions and 38 deletions

View File

@@ -7,7 +7,7 @@ import { WhitespaceController } from './whitespaceController';
export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase {
protected _blame: Promise<GitBlame>;
protected _blame: Promise<GitBlame | undefined>;
constructor(context: ExtensionContext, editor: TextEditor, decoration: TextEditorDecorationType | undefined, highlightDecoration: TextEditorDecorationType | undefined, whitespaceController: WhitespaceController | undefined, protected git: GitService, protected uri: GitUri) {
super(context, editor, decoration, highlightDecoration, whitespaceController);
@@ -63,7 +63,7 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
whitespacePromise = this.whitespaceController && this.whitespaceController.override();
}
let blame: GitBlame;
let blame: GitBlame | undefined;
if (whitespacePromise) {
[blame] = await Promise.all([this._blame, whitespacePromise]);
}
@@ -71,7 +71,7 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
blame = await this._blame;
}
if (!blame || !blame.lines.length) {
if (blame === undefined || !blame.lines.length) {
this.whitespaceController && await this.whitespaceController.restore();
return undefined;
}

View File

@@ -20,7 +20,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
// Precalculate the formatting options so we don't need to do it on each iteration
const tokenOptions = Strings.getTokensFromTemplate(cfg.format)
.reduce((map, token) => {
map[token.key] = token.options;
map[token.key] = token.options as ICommitFormatOptions;
return map;
}, {} as { [token: string]: ICommitFormatOptions });

View File

@@ -55,9 +55,9 @@ function findSystemGitWin32(basePath: string): Promise<IGit> {
}
function findGitWin32(): Promise<IGit> {
return findSystemGitWin32(process.env['ProgramW6432'])
.then(null, () => findSystemGitWin32(process.env['ProgramFiles(x86)']))
.then(null, () => findSystemGitWin32(process.env['ProgramFiles']))
return findSystemGitWin32(process.env['ProgramW6432']!)
.then(null, () => findSystemGitWin32(process.env['ProgramFiles(x86)']!))
.then(null, () => findSystemGitWin32(process.env['ProgramFiles']!))
.then(null, () => findSpecificGit('git'));
}

View File

@@ -41,7 +41,7 @@ export abstract class RemoteProvider {
return commands.executeCommand(BuiltInCommands.Open, Uri.parse(url));
}
open(resource: RemoteResource): Promise<{}> {
open(resource: RemoteResource): Promise<{} | undefined> {
switch (resource.type) {
case 'branch':
return this.openBranch(resource.branch);

View File

@@ -88,7 +88,7 @@ export class GitService extends Disposable {
private _disposable: Disposable | undefined;
private _fireGitCacheChangeDebounced: () => void;
private _fsWatcher: FileSystemWatcher | undefined;
private _gitignore: Promise<ignore.Ignore>;
private _gitignore: Promise<ignore.Ignore | undefined>;
static EmptyPromise: Promise<GitBlame | GitDiff | GitLog | undefined> = Promise.resolve(undefined);

View File

@@ -5,7 +5,7 @@ import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandA
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem, OpenFilesCommandQuickPickItem, QuickPickItem } from './common';
import { GlyphChars } from '../constants';
import { getGitStatusOcticon, GitCommit, GitLog, GitLogCommit, GitService, GitStashCommit, GitStatusFile, GitStatusFileStatus, GitUri, IGitCommitInfo, IGitStatusFile, RemoteResource } from '../gitService';
import { Keyboard, KeyNoopCommand, Keys } from '../keyboard';
import { Keyboard, KeyCommand, KeyNoopCommand, Keys } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import * as moment from 'moment';
import * as path from 'path';
@@ -203,8 +203,8 @@ export class CommitDetailsQuickPick {
items.splice(0, 0, goBackCommand);
}
let previousCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>) | undefined = undefined;
let nextCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>) | undefined = undefined;
let previousCommand: KeyCommand | (() => Promise<KeyCommand>) | undefined = undefined;
let nextCommand: KeyCommand | (() => Promise<KeyCommand>) | undefined = undefined;
if (!stash) {
// If we have the full history, we are good
if (repoLog !== undefined && !repoLog.truncated && repoLog.sha === undefined) {

View File

@@ -5,7 +5,7 @@ import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandA
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './common';
import { GlyphChars } from '../constants';
import { GitBranch, GitLog, GitLogCommit, GitService, GitUri, RemoteResource } from '../gitService';
import { Keyboard, KeyNoopCommand } from '../keyboard';
import { Keyboard, KeyCommand, KeyNoopCommand } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import * as moment from 'moment';
import * as path from 'path';
@@ -173,8 +173,8 @@ export class CommitFileDetailsQuickPick {
items.splice(0, 0, goBackCommand);
}
let previousCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>) | undefined = undefined;
let nextCommand: CommandQuickPickItem | (() => Promise<CommandQuickPickItem>) | undefined = undefined;
let previousCommand: KeyCommand | (() => Promise<KeyCommand>) | undefined = undefined;
let nextCommand: KeyCommand | (() => Promise<KeyCommand>) | undefined = undefined;
if (!stash) {
// If we have the full history, we are good
if (fileLog !== undefined && !fileLog.truncated && fileLog.sha === undefined) {
@@ -278,7 +278,7 @@ export class CommitFileDetailsQuickPick {
placeHolder: `${commit.getFormattedPath()} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${isUncommitted ? `Uncommitted ${GlyphChars.ArrowRightHollow} ` : '' }${commit.shortSha} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${commit.author}, ${moment(commit.date).fromNow()} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${commit.message}`,
ignoreFocusOut: getQuickPickIgnoreFocusOut(),
onDidSelectItem: (item: QuickPickItem) => {
scope.setKeyCommand('right', item);
scope.setKeyCommand('right', item as KeyCommand);
}
} as QuickPickOptions);

View File

@@ -22,7 +22,7 @@ export class OpenRemoteCommandQuickPickItem extends CommandQuickPickItem {
this.resource = resource;
}
async execute(): Promise<{}> {
async execute(): Promise<{} | undefined> {
return this.remote.provider!.open(this.resource);
}
}

View File

@@ -41,7 +41,7 @@ export class TelemetryReporter {
constructor(key: string) {
const diagChannelState = process.env['APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL'];
process.env['APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL'] = true;
(process.env['APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL'] as any) = true;
this.appInsights = require('applicationinsights') as ApplicationInsights;
process.env['APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL'] = diagChannelState;