提交 2d0b37f0 编写于 作者: M Matt Bierner

Strict function work

#81574
上级 028e009e
......@@ -6,7 +6,7 @@
import 'vs/css!./menu';
import * as nls from 'vs/nls';
import * as strings from 'vs/base/common/strings';
import { IActionRunner, IAction, Action } from 'vs/base/common/actions';
import { IActionRunner, IAction, Action, IActionViewItem } from 'vs/base/common/actions';
import { ActionBar, IActionViewItemProvider, ActionsOrientation, Separator, ActionViewItem, IActionViewItemOptions, BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes';
import { addClass, EventType, EventHelper, EventLike, removeTabIndexAndUpdateFocus, isAncestor, hasClass, addDisposableListener, removeClass, append, $, addClasses, removeClasses } from 'vs/base/browser/dom';
......@@ -205,8 +205,8 @@ export class Menu extends ActionBar {
container.appendChild(this.scrollableElement.getDomNode());
this.scrollableElement.scanDomNode();
this.viewItems.filter(item => !(item instanceof MenuSeparatorActionViewItem)).forEach((item: BaseMenuActionViewItem, index: number, array: any[]) => {
item.updatePositionInSet(index + 1, array.length);
this.viewItems.filter(item => !(item instanceof MenuSeparatorActionViewItem)).forEach((item: IActionViewItem, index: number, array: any[]) => {
(item as BaseMenuActionViewItem).updatePositionInSet(index + 1, array.length);
});
}
......
......@@ -52,7 +52,7 @@ export class ToolBar extends Disposable {
orientation: options.orientation,
ariaLabel: options.ariaLabel,
actionRunner: options.actionRunner,
actionViewItemProvider: (action: Action) => {
actionViewItemProvider: (action: IAction) => {
// Return special action item for the toggle menu action
if (action.id === ToggleMenuAction.ID) {
......
......@@ -271,7 +271,7 @@ export interface INavigator<T> extends INextIterator<T> {
export class MappedNavigator<T, R> extends MappedIterator<T, R> implements INavigator<R> {
constructor(protected navigator: INavigator<T>, fn: (item: T) => R) {
constructor(protected navigator: INavigator<T>, fn: (item: T | null) => R) {
super(navigator, fn);
}
......
......@@ -553,7 +553,7 @@ export class ChannelClient implements IChannelClient, IDisposable {
}
});
const handler: IHandler = (res: IRawEventFireResponse) => emitter.fire(res.data);
const handler: IHandler = (res: IRawResponse) => emitter.fire((res as IRawEventFireResponse).data);
this.handlers.set(id, handler);
return emitter.event;
......
......@@ -294,7 +294,7 @@ suite('SQLite Storage Library', () => {
return set;
}
async function testDBBasics(path: string, logError?: (error: Error) => void) {
async function testDBBasics(path: string, logError?: (error: Error | string) => void) {
let options!: ISQLiteStorageDatabaseOptions;
if (logError) {
options = {
......
......@@ -377,7 +377,7 @@ class EditorContributionRegistry {
}
public registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }): void {
this.editorContributions.push({ id, ctor });
this.editorContributions.push({ id, ctor: ctor as IEditorContributionCtor });
}
public getEditorContributions(): IEditorContributionDescription[] {
......@@ -385,7 +385,7 @@ class EditorContributionRegistry {
}
public registerDiffEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: IDiffEditor, ...services: Services): IEditorContribution }): void {
this.diffEditorContributions.push({ id, ctor });
this.diffEditorContributions.push({ id, ctor: ctor as IDiffEditorContributionCtor });
}
public getDiffEditorContributions(): IDiffEditorContributionDescription[] {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册