Merge pull request #2932 from borisyankov/switch-to-1.1.0-1

[WIP] start switch to tsc 1.1.0-1
This commit is contained in:
Masahiro Wakame 2014-10-08 01:43:24 +09:00
commit 64677fc78d
18 changed files with 29210 additions and 33 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('./tsc.js')

File diff suppressed because one or more lines are too long

6
dojo/dijit.d.ts vendored
View File

@ -101908,7 +101908,7 @@ declare module dijit {
* @param callback
* @param onError
*/
getChildren(parentItem: dojo.data.api.Item, callback: {(items:any[])}, onError: Function): void;
getChildren(parentItem: dojo.data.api.Item, callback: {(items:any[]):any;}, onError: Function): void;
/**
*
* @param item
@ -102160,7 +102160,7 @@ declare module dijit {
* @param onComplete
* @param onError
*/
getChildren(parentItem: Object, onComplete: {(items:any[])}, onError: Function): void;
getChildren(parentItem: Object, onComplete: {(items:any[]):any;}, onError: Function): void;
/**
*
* @param item
@ -102331,7 +102331,7 @@ declare module dijit {
* @param onComplete
* @param onError
*/
getChildren(parentItem: dojo.data.api.Item, onComplete: {(items:any[])}, onError: Function): void;
getChildren(parentItem: dojo.data.api.Item, onComplete: {(items:any[]):any;}, onError: Function): void;
/**
*
* @param item

View File

@ -7381,7 +7381,7 @@ declare module dojox {
* @param onError
* @param queryObj
*/
getChildren(parentItem: dojo.data.api.Item, onComplete: {(items:Object[], size?:number)}, onError: Function, queryObj?: Object): void;
getChildren(parentItem: dojo.data.api.Item, onComplete: {(items:Object[], size?:number): any;}, onError: Function, queryObj?: Object): void;
/**
*
* @param item
@ -21624,19 +21624,19 @@ declare module dojox {
* @param searchArgs
* @param onSearched
*/
searchRow(searchArgs: Object, onSearched: {(index:number,item:Object)}): void;
searchRow(searchArgs: Object, onSearched: {(index:number,item:Object): any;}): void;
/**
*
* @param searchArgs
* @param onSearched
*/
searchRow(searchArgs: RegExp, onSearched: {(index:number,item:Object)}): void;
searchRow(searchArgs: RegExp, onSearched: {(index:number,item:Object): any;}): void;
/**
*
* @param searchArgs
* @param onSearched
*/
searchRow(searchArgs: String, onSearched: {(index:number,item:Object)}): void;
searchRow(searchArgs: String, onSearched: {(index:number,item:Object): any;}): void;
/**
* Subscribes to the specified topic and calls the specified method
* of this object.

View File

@ -145,9 +145,9 @@ fs.readdir(path, (err: Error, files: string[]) => {
strArr = fs.readdirSync(path);
fs.close(fd, errorCallback);
fs.closeSync(fd);
fs.open(path, flags, modeStr, (err: Error, fd: number) => [
]);
fs.open(path, flags, modeStr, (err: Error, fd: number) => {
});
num = fs.openSync(path, flags, modeStr);
fs.utimes(path, atime, mtime, errorCallback);
fs.utimesSync(path, atime, mtime);

View File

@ -12,10 +12,12 @@ var insight = new Insight({
packageVersion: pkg.version
});
// ask for permission the first time
if (insight.optOut === undefined) {
return insight.askPermission();
}
(()=> {
// ask for permission the first time
if (insight.optOut === undefined) {
return insight.askPermission();
}
insight.track('foo', 'bar');
// recorded in Analytics as `/foo/bar`
insight.track('foo', 'bar');
// recorded in Analytics as `/foo/bar`
})();

1
jest/jest.d.ts vendored
View File

@ -63,6 +63,7 @@ declare module jest {
interface Mock<T> {
new(): T;
(...args:any[]): any; // TODO please fix this line! added for TypeScript 1.1.0-1 https://github.com/borisyankov/DefinitelyTyped/pull/2932
mock: MockContext<T>;
mockClear(): void;
mockImplementation(fn: Function): Mock<T>;

4
joi/joi.d.ts vendored
View File

@ -459,10 +459,10 @@ declare module 'joi' {
/**
* Validates a value using the given schema and options.
*/
export function validate<T>(value: T, schema: Schema, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Schema, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
export function validate<T>(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
/**
* Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object).

View File

@ -21,7 +21,7 @@ var sample = new Sample();
var unwrappedProperties = ko.utils.unwrapProperties(sample);
var kts: KnockoutTemplateSources;
var stringTemplate = kts.stringTemplate('string-template');
var stringTemplate = new kts.stringTemplate('string-template');
var stname = stringTemplate.templateName;
ko.stringTemplateEngine.instance.allowTemplateRewriting = true;

View File

@ -667,7 +667,7 @@ result = <Function>_.curry(function (a: any, b: any, c: any) {
console.log(a + b + c);
});
result = <_.LoDashObjectWrapper<Function>>_(function (a, b, c) {
result = <_.LoDashObjectWrapper<Function>>_(function (a: any, b: any, c: any) {
console.log(a + b + c);
}).curry();
@ -694,7 +694,7 @@ source.addEventListener('message', <_.LoDashObjectWrapper<Function>>_(function (
'maxWait': 1000
}), false);
var returnedDebounce = _.throttle(function (a) { return a * 5; }, 5);
var returnedDebounce = _.throttle(function (a: any) { return a * 5; }, 5);
returnedThrottled(4);
result = <number>_.defer(function () { console.log('deferred'); });
@ -704,7 +704,7 @@ var log = _.bind(console.log, console);
result = <number>_.delay(log, 1000, 'logged later');
result = <_.LoDashWrapper<number>>_(log).delay(1000, 'logged later');
var fibonacci = <Function>_.memoize(function (n) {
var fibonacci = <Function>_.memoize(function (n: any) {
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
});
@ -716,13 +716,13 @@ var data: { [index: string]: { name: string; age: number; } } = {
var stooge = _.memoize(function (name: string) { return data[name]; }, _.identity);
stooge('curly');
var returnedMemoize = _.throttle(function (a) { return a * 5; }, 5);
var returnedMemoize = _.throttle(function (a: any) { return a * 5; }, 5);
returnedMemoize(4);
var initialize = _.once(function () { });
initialize();
initialize();''
var returnedOnce = _.throttle(function (a) { return a * 5; }, 5);
var returnedOnce = _.throttle(function (a: any) { return a * 5; }, 5);
returnedOnce(4);
var greetPartial = function (greeting: string, name: string) { return greeting + ' ' + name; };
@ -745,7 +745,7 @@ jQuery('.interactive').on('click', _.throttle(function () { }, 300000, {
'trailing': false
}));
var returnedThrottled = _.throttle(function (a) { return a * 5; }, 5);
var returnedThrottled = _.throttle(function (a: any) { return a * 5; }, 5);
returnedThrottled(4);
var helloWrap = function (name: string) { return 'hello ' + name; };

View File

@ -246,7 +246,7 @@ interface Array<T> {
/**
* Inserts a value at the specified location in an Array object.
*/
insert(array: any[], index: number, item: any);
insert(array: any[], index: number, item: any): any;
/**
* Creates an Array object from a string representation.
*/

View File

@ -24,7 +24,7 @@ var todo = {
this.add = function() {
if (this.description()) {
this.list.push(new todo.Todo({description: this.description()}));
this.list.push(new (<any>todo.Todo)({description: this.description()}));
this.description("");
}
}.bind(this);

View File

@ -0,0 +1 @@
""

View File

@ -255,7 +255,7 @@ declare module "mongodb" {
// Documentation : http://mongodb.github.io/node-mongodb-native/api-generated/collection.html
export interface Collection {
new (db: Db, collectionName: string, pkFactory?: Object, options?: CollectionCreateOptions);
new (db: Db, collectionName: string, pkFactory?: Object, options?: CollectionCreateOptions): Collection; // is this right?
insert(query: any, callback: (err: Error, result: any) => void): void;
insert(query: any, options: { safe?: any; continueOnError?: boolean; keepGoing?: boolean; serializeFunctions?: boolean; }, callback: (err: Error, result: any) => void): void;

View File

@ -1,2 +1 @@
""

View File

@ -49,7 +49,7 @@ declare module "winston" {
export interface LoggerStatic {
new (options?: LoggerOptions);
new (options?: LoggerOptions): LoggerInstance;
}
export interface LoggerInstance extends NodeJS.EventEmitter {

View File

@ -218,8 +218,8 @@ console.log(xmlDocStr);
var xmlDocStr = x2js.json2xml_str(
{
MyRoot: {
MyNullChild: null,
MyNullChild2: undefined,
MyNullChild: <any>null,
MyNullChild2: <any>undefined,
MyAnotherChild: 10,
MyEmptyChild: {
_attr: "test"