提交 c80efd22 编写于 作者: J Johannes Rieken

debt - fix more ts 2.4.1 compile issues

上级 6fdfe2f0
......@@ -88,10 +88,10 @@ interface NodeModule {
// Same as module.exports
declare var exports: any;
declare var SlowBuffer: {
new (str: string, encoding?: string): Buffer;
new (size: number): Buffer;
new (size: Uint8Array): Buffer;
new (array: any[]): Buffer;
new(str: string, encoding?: string): Buffer;
new(size: number): Buffer;
new(size: Uint8Array): Buffer;
new(array: any[]): Buffer;
prototype: Buffer;
isBuffer(obj: any): boolean;
byteLength(string: string, encoding?: string): number;
......@@ -115,19 +115,19 @@ declare var Buffer: {
* @param str String to store in buffer.
* @param encoding encoding to use, optional. Default is 'utf8'
*/
new (str: string, encoding?: string): Buffer;
new(str: string, encoding?: string): Buffer;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
*/
new (size: number): Buffer;
new(size: number): Buffer;
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
new (array: Uint8Array): Buffer;
new(array: Uint8Array): Buffer;
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}.
......@@ -135,19 +135,19 @@ declare var Buffer: {
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
*/
new (arrayBuffer: ArrayBuffer): Buffer;
new(arrayBuffer: ArrayBuffer): Buffer;
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
new (array: any[]): Buffer;
new(array: any[]): Buffer;
/**
* Copies the passed {buffer} data onto a new {Buffer} instance.
*
* @param buffer The buffer to copy.
*/
new (buffer: Buffer): Buffer;
new(buffer: Buffer): Buffer;
prototype: Buffer;
/**
* Allocates a new Buffer using an {array} of octets.
......@@ -250,7 +250,7 @@ declare var Buffer: {
declare namespace NodeJS {
export var Console: {
prototype: Console;
new (stdout: WritableStream, stderr?: WritableStream): Console;
new(stdout: WritableStream, stderr?: WritableStream): Console;
}
export interface ErrnoException extends Error {
......@@ -1324,7 +1324,7 @@ declare module "https" {
}
export var Agent: {
new (options?: AgentOptions): Agent;
new(options?: AgentOptions): Agent;
};
export interface Server extends tls.Server { }
export function createServer(options: ServerOptions, requestListener?: Function): Server;
......@@ -1959,7 +1959,7 @@ declare module "net" {
}
export var Socket: {
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
new(options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
};
export interface ListenOptions {
......@@ -2464,6 +2464,7 @@ declare module "fs" {
*/
export function readFileSync(filename: string, options?: { flag?: string; }): Buffer;
export function writeFile(filename: string | number, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(filename: string | number, data: any, options: string, callback?: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(filename: string | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(filename: string | number, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
......@@ -2780,7 +2781,7 @@ declare module "string_decoder" {
end(buffer?: Buffer): string;
}
export var StringDecoder: {
new (encoding?: string): NodeStringDecoder;
new(encoding?: string): NodeStringDecoder;
};
}
......@@ -3184,7 +3185,7 @@ declare module "crypto" {
verifySpkac(spkac: Buffer): boolean;
}
export var Certificate: {
new (): Certificate;
new(): Certificate;
(): Certificate;
}
......@@ -4128,6 +4129,6 @@ declare module "_debugger" {
}
export var Client: {
new (): ClientInstance
new(): ClientInstance
}
}
......@@ -409,11 +409,11 @@ class ChainableEvent<T> implements IChainableEvent<T> {
constructor(private _event: Event<T>) { }
map(fn) {
map<O>(fn: (i: T) => O): IChainableEvent<O> {
return new ChainableEvent(mapEvent(this._event, fn));
}
filter(fn) {
filter(fn: (e: T) => boolean): IChainableEvent<T> {
return new ChainableEvent(filterEvent(this._event, fn));
}
......
......@@ -451,4 +451,4 @@ export function realpath(path: string, callback: (error: Error, realpath: string
function normalizePath(path: string): string {
return strings.rtrim(paths.normalize(path), paths.sep);
}
\ No newline at end of file
}
......@@ -149,7 +149,7 @@ export class DefinitionAction extends EditorAction {
revealIfVisible: !sideBySide
}
}, sideBySide).then(editor => {
return editor && <editorCommon.IEditor>editor.getControl();
return editor && <editorCommon.ICommonCodeEditor>editor.getControl();
});
}
......
......@@ -6,7 +6,6 @@
'use strict';
import 'vs/css!./messageController';
import { any } from 'vs/base/common/event';
import { setDisposableTimeout } from 'vs/base/common/async';
import { KeyCode } from 'vs/base/common/keyCodes';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
......@@ -62,12 +61,10 @@ export class MessageController {
this._messageWidget = new MessageWidget(this._editor, position, message);
// close on blur, cursor, model change, dispose
this._messageListeners.push(any<any>(
this._editor.onDidBlurEditorText,
this._editor.onDidChangeCursorPosition,
this._editor.onDidDispose,
this._editor.onDidChangeModel
)(this.closeMessage, this));
this._messageListeners.push(this._editor.onDidBlurEditorText(() => this.closeMessage()));
this._messageListeners.push(this._editor.onDidChangeCursorPosition(() => this.closeMessage()));
this._messageListeners.push(this._editor.onDidDispose(() => this.closeMessage()));
this._messageListeners.push(this._editor.onDidChangeModel(() => this.closeMessage()));
// close after 3s
this._messageListeners.push(setDisposableTimeout(() => this.closeMessage(), 3000));
......@@ -184,4 +181,4 @@ registerThemingParticipant((theme, collector) => {
if (background) {
collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`);
}
});
\ No newline at end of file
});
......@@ -234,22 +234,22 @@ namespace schema {
},
icon: {
description: localize('vscode.extension.contributes.commandType.icon', '(Optional) Icon which is used to represent the command in the UI. Either a file path or a themable configuration'),
anyOf: [
'string',
{
type: 'object',
properties: {
light: {
description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'),
type: 'string'
},
dark: {
description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'),
type: 'string'
}
anyOf: [{
type: 'string'
},
{
type: 'object',
properties: {
light: {
description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'),
type: 'string'
},
dark: {
description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'),
type: 'string'
}
}
]
}]
}
}
};
......
......@@ -129,7 +129,7 @@ export class ProgressService2 implements IProgressService2 {
}
}
private _withViewletProgress(viewletId: string, task: (progress: IProgress<number>) => TPromise<any>): void {
private _withViewletProgress(viewletId: string, task: (progress: IProgress<{ message?: string, percentage?: number }>) => TPromise<any>): void {
const promise = task(emptyProgress);
......
......@@ -29,7 +29,7 @@ suite('ExtHostCommands', function () {
};
const commands = new ExtHostCommands(OneGetThreadService(shape), undefined);
commands.registerCommand('foo', () => { }).dispose();
commands.registerCommand('foo', (): any => { }).dispose();
assert.equal(lastUnregister, 'foo');
assert.equal(CommandsRegistry.getCommand('foo'), undefined);
......@@ -50,7 +50,7 @@ suite('ExtHostCommands', function () {
};
const commands = new ExtHostCommands(OneGetThreadService(shape), undefined);
const reg = commands.registerCommand('foo', () => { });
const reg = commands.registerCommand('foo', (): any => { });
reg.dispose();
reg.dispose();
reg.dispose();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册