mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge pull request #8214 from DefinitelyTyped/switch-to-1.8
switch to tsc 1.8.2
This commit is contained in:
+1
-1
@@ -41,8 +41,8 @@ class AbstractStoreModel<S> implements AltJS.StoreModel<S> {
|
||||
|
||||
class GenerateActionsClass extends AbstractActions {
|
||||
constructor(config:AltJS.Alt) {
|
||||
this.generateActions("notifyTest");
|
||||
super(config);
|
||||
this.generateActions("notifyTest");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ module Backbone.Associations.Tests {
|
||||
module OneToOne {
|
||||
class EmployeeWithManager extends Backbone.AssociatedModel {
|
||||
constructor(options?) {
|
||||
super(options);
|
||||
this.relations = [
|
||||
{
|
||||
type: Backbone.One, //nature of the relationship
|
||||
@@ -14,7 +15,6 @@ module Backbone.Associations.Tests {
|
||||
relatedModel: 'Employee' //AssociatedModel for attribute key
|
||||
}
|
||||
];
|
||||
super(options);
|
||||
}
|
||||
|
||||
defaults() {
|
||||
@@ -48,6 +48,7 @@ module Backbone.Associations.Tests {
|
||||
|
||||
class Project extends Backbone.AssociatedModel {
|
||||
constructor(options?) {
|
||||
super(options);
|
||||
this.relations = [
|
||||
{
|
||||
type: Backbone.Many, //nature of the relation
|
||||
@@ -56,7 +57,6 @@ module Backbone.Associations.Tests {
|
||||
relatedModel: Location //Optional
|
||||
}
|
||||
];
|
||||
super(options);
|
||||
}
|
||||
|
||||
defaults() {
|
||||
|
||||
@@ -29,11 +29,11 @@ class SettingDefaults extends Backbone.Model {
|
||||
}
|
||||
|
||||
constructor(attributes?: any, options?: any) {
|
||||
super(attributes, options); // error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
|
||||
this.defaults = <any>{
|
||||
name: "Joe"
|
||||
}
|
||||
// super has to come last
|
||||
super(attributes, options);
|
||||
}
|
||||
|
||||
// or set it like this
|
||||
|
||||
@@ -30,11 +30,11 @@ class SettingDefaults extends Backbone.Model {
|
||||
}
|
||||
|
||||
constructor(attributes?: any, options?: any) {
|
||||
super(attributes, options); // TODO error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
|
||||
this.defaults = <any>{
|
||||
name: "Joe"
|
||||
}
|
||||
// super has to come last
|
||||
super(attributes, options);
|
||||
}
|
||||
|
||||
// or set it like this
|
||||
|
||||
@@ -26,8 +26,8 @@ class TestModel extends Backbone.Model {
|
||||
class TestCollection extends Backbone.Collection<TestModel> {
|
||||
|
||||
constructor(models?: any, options?: any) {
|
||||
this.model = TestModel;
|
||||
super(models, options);
|
||||
this.model = TestModel;
|
||||
}
|
||||
|
||||
initialize() {
|
||||
@@ -46,6 +46,7 @@ class TestView extends Backbone.View<TestModel> {
|
||||
testCollection: TestCollection;
|
||||
|
||||
constructor(viewOptions?: Backbone.ViewOptions<TestModel>) {
|
||||
super(viewOptions);
|
||||
this.testCollection = new TestCollection();
|
||||
this.gridView = new Backgrid.Grid({
|
||||
columns: [new Backgrid.Column({name: "FirstName", cell: "string", label: "First Name"}),
|
||||
@@ -54,7 +55,6 @@ class TestView extends Backbone.View<TestModel> {
|
||||
collection:this.testCollection,
|
||||
});
|
||||
|
||||
super(viewOptions);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ function CreatingStreams() {
|
||||
var stream = Bacon.fromBinder(sink => {
|
||||
sink("first value");
|
||||
sink([new Bacon.Next("2nd"), new Bacon.Next("3rd")]);
|
||||
sink(new Bacon.Next(() => {
|
||||
sink(new Bacon.Next((): string => {
|
||||
return "This one will be evaluated lazily"
|
||||
}));
|
||||
sink(new Bacon.Error("oops, an error"));
|
||||
@@ -88,7 +88,7 @@ function CreatingStreams() {
|
||||
}
|
||||
|
||||
new Bacon.Next("value");
|
||||
new Bacon.Next(() => "value");
|
||||
new Bacon.Next((): string => "value");
|
||||
}
|
||||
|
||||
function CommonMethodsInEventStreamsAndProperties() {
|
||||
@@ -296,7 +296,7 @@ function CombiningMultipleStreamsAndProperties() {
|
||||
|
||||
function $Event() {
|
||||
new Bacon.Next("value");
|
||||
new Bacon.Next(() => "value");
|
||||
new Bacon.Next((): string => "value");
|
||||
}
|
||||
|
||||
function Errors() {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
--target es5 --noImplicitAny
|
||||
@@ -0,0 +1 @@
|
||||
--target es5 --noImplicitAny
|
||||
@@ -6,10 +6,10 @@ class User extends Giraffe.Model {
|
||||
class MainView extends Giraffe.View<User> {
|
||||
|
||||
constructor(options?) {
|
||||
super(options);
|
||||
this.appEvents = {
|
||||
'startup': 'app_onStartup'
|
||||
}
|
||||
super(options);
|
||||
}
|
||||
|
||||
app_onStartup() {
|
||||
@@ -20,10 +20,10 @@ class MainView extends Giraffe.View<User> {
|
||||
|
||||
class MyApp extends Giraffe.App {
|
||||
constructor() {
|
||||
super();
|
||||
this.routes= {
|
||||
'': 'home'
|
||||
}
|
||||
super();
|
||||
}
|
||||
|
||||
home() {
|
||||
|
||||
@@ -114,6 +114,8 @@ module Marionette.Tests {
|
||||
behaviors: any;
|
||||
|
||||
constructor(model: MyModel) {
|
||||
super({ model: model });
|
||||
|
||||
this.ui = {
|
||||
destroy: '.destroy'
|
||||
};
|
||||
@@ -123,9 +125,6 @@ module Marionette.Tests {
|
||||
message: 'hello'
|
||||
}
|
||||
};
|
||||
|
||||
super({ model: model });
|
||||
|
||||
}
|
||||
|
||||
template() {
|
||||
@@ -136,8 +135,8 @@ module Marionette.Tests {
|
||||
|
||||
class MainRegion extends Marionette.Region {
|
||||
constructor() {
|
||||
this.el = '#main';
|
||||
super();
|
||||
this.el = '#main';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,13 +146,13 @@ module Marionette.Tests {
|
||||
options: any;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.name = 'Adam';
|
||||
|
||||
this.options = {
|
||||
name: 'Foo'
|
||||
};
|
||||
|
||||
super();
|
||||
this.on("before:destroy", () => {
|
||||
console.log("before:destroy");
|
||||
});
|
||||
@@ -166,27 +165,28 @@ module Marionette.Tests {
|
||||
|
||||
class MyRegion extends Marionette.Region {
|
||||
constructor() {
|
||||
this.el = '#main-nav';
|
||||
super();
|
||||
this.el = '#main-nav';
|
||||
}
|
||||
}
|
||||
|
||||
class MyJQueryRegion extends Marionette.Region {
|
||||
constructor() {
|
||||
this.el = $('#main-nav');
|
||||
super();
|
||||
this.el = $('#main-nav');
|
||||
}
|
||||
}
|
||||
|
||||
class MyHtmlElRegion extends Marionette.Region {
|
||||
constructor() {
|
||||
this.el = document.querySelector("body");
|
||||
super();
|
||||
this.el = document.querySelector("body");
|
||||
}
|
||||
}
|
||||
|
||||
class MyCollectionView extends Marionette.CollectionView<MyModel, MyView> {
|
||||
constructor() {
|
||||
super();
|
||||
this.childView = MyView;
|
||||
this.childEvents = {
|
||||
render: function () {
|
||||
@@ -208,8 +208,6 @@ module Marionette.Tests {
|
||||
|
||||
this.childViewEventPrefix = "some:prefix";
|
||||
|
||||
super();
|
||||
|
||||
this.on('some:prefix:render', function () {
|
||||
|
||||
});
|
||||
|
||||
@@ -34,15 +34,15 @@ var todo = {
|
||||
view: function(ctrl: any) {
|
||||
return m("html", [
|
||||
m("body", [
|
||||
m("input", {onchange: m.withAttr("value", ctrl.description), value: ctrl.description()}),
|
||||
m("button", {onclick: ctrl.add}, "Add"),
|
||||
m("input", {onchange: m.withAttr("value", ctrl.description), value: ctrl.description()} as any /* TODO remove `as any` */),
|
||||
m("button", {onclick: ctrl.add} as any /* TODO remove `as any` */, "Add"),
|
||||
m("table", [
|
||||
ctrl.list.map(function(task: any) {
|
||||
return m("tr", [
|
||||
m("td", [
|
||||
m("input[type=checkbox]", {onclick: m.withAttr("checked", task.done), checked: task.done()})
|
||||
m("input[type=checkbox]", {onclick: m.withAttr("checked", task.done), checked: task.done()} as any /* TODO remove `as any` */)
|
||||
]),
|
||||
m("td", {style: {textDecoration: task.done() ? "line-through" : "none"}}, task.description()),
|
||||
m("td", {style: {textDecoration: task.done() ? "line-through" : "none"}} as any /* TODO remove `as any` */, task.description()),
|
||||
])
|
||||
})
|
||||
])
|
||||
|
||||
Generated
+16
-16
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "DefinitelyTyped",
|
||||
"name": "definitely-typed",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"assertion-error": {
|
||||
@@ -13,14 +13,14 @@
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz"
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.2.2",
|
||||
"from": "bluebird@>=3.1.2 <4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.2.2.tgz"
|
||||
"version": "3.3.1",
|
||||
"from": "bluebird@>=3.3.1 <4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.3.1.tgz"
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"from": "brace-expansion@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz"
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz"
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
@@ -38,8 +38,8 @@
|
||||
"resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.3.0.tgz"
|
||||
},
|
||||
"definition-tester": {
|
||||
"version": "0.5.0",
|
||||
"from": "definition-tester@0.5.0"
|
||||
"version": "0.5.1",
|
||||
"from": "definition-tester@0.5.1"
|
||||
},
|
||||
"findup-sync": {
|
||||
"version": "0.3.0",
|
||||
@@ -59,9 +59,9 @@
|
||||
"resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz"
|
||||
},
|
||||
"glob": {
|
||||
"version": "6.0.4",
|
||||
"from": "glob@>=6.0.4 <7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
|
||||
"version": "7.0.0",
|
||||
"from": "glob@>=7.0.0 <8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.0.0.tgz"
|
||||
},
|
||||
"hoek": {
|
||||
"version": "3.0.4",
|
||||
@@ -89,9 +89,9 @@
|
||||
"resolved": "https://registry.npmjs.org/isemail/-/isemail-2.1.0.tgz"
|
||||
},
|
||||
"joi": {
|
||||
"version": "7.2.3",
|
||||
"version": "7.3.0",
|
||||
"from": "joi@>=7.2.2 <8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/joi/-/joi-7.2.3.tgz"
|
||||
"resolved": "https://registry.npmjs.org/joi/-/joi-7.3.0.tgz"
|
||||
},
|
||||
"joi-assert": {
|
||||
"version": "0.0.3",
|
||||
@@ -196,9 +196,9 @@
|
||||
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz"
|
||||
},
|
||||
"typescript": {
|
||||
"version": "1.7.5",
|
||||
"from": "typescript@1.7.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.5.tgz"
|
||||
"version": "1.8.2",
|
||||
"from": "typescript@1.8.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.8.2.tgz"
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "0.0.3",
|
||||
|
||||
@@ -41,7 +41,7 @@ angular.module('app').controller(['$ocLazyLoadProvider', function ($ocLazyLoad:
|
||||
'bower_components/bootstrap/dist/js/bootstrap.js'
|
||||
],
|
||||
cache: false,
|
||||
kjdf: false
|
||||
// kjdf: false
|
||||
},
|
||||
{
|
||||
files: ['anotherModule.js'],
|
||||
|
||||
+8
-14
@@ -1,20 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "DefinitelyTyped",
|
||||
"name": "definitely-typed",
|
||||
"version": "0.0.1",
|
||||
"homepage": "https://github.com/borisyankov/DefinitelyTyped",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/borisyankov/DefinitelyTyped.git"
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/borisyankov/DefinitelyTyped/blob/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/borisyankov/DefinitelyTyped/issues"
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.12.0"
|
||||
@@ -32,10 +27,9 @@
|
||||
"refmap": "dt --dry --print-refmap",
|
||||
"help": "dt -h"
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"definition-tester": "0.5.0",
|
||||
"typescript": "1.7.5"
|
||||
"definition-tester": "0.5.1",
|
||||
"typescript": "1.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1300,7 +1300,7 @@ s.define( 'ProductWithSettersAndGetters2', {
|
||||
s.define( 'post', {
|
||||
title : Sequelize.STRING,
|
||||
authorId : { type : Sequelize.INTEGER, references : testModel, referencesKey : 'id' }
|
||||
} );
|
||||
} as any /* TODO please remove `as any` */);
|
||||
s.define( 'post', {
|
||||
title : Sequelize.STRING,
|
||||
authorId : { type : Sequelize.INTEGER, references : { model : testModel, key : 'id' } }
|
||||
|
||||
@@ -995,7 +995,7 @@ module CSR {
|
||||
function GetCurrentLookupValue() {
|
||||
if (_dropdownElt == null)
|
||||
return '';
|
||||
return _dropdownElt.value == '0' || _dropdownElt.value == '' ? '' : _dropdownElt.value + ';#' + _dropdownElt.options[_dropdownElt.selectedIndex].text;
|
||||
return _dropdownElt.value == '0' || _dropdownElt.value == '' ? '' : _dropdownElt.value + ';#' + (_dropdownElt.options[_dropdownElt.selectedIndex] as any /* TODO remove `as any` */).text;
|
||||
}
|
||||
|
||||
function stripBraces(input: string): string {
|
||||
@@ -1093,12 +1093,12 @@ module CSR {
|
||||
var selected = false;
|
||||
|
||||
while (_dropdownElt.options.length) {
|
||||
_dropdownElt.options.remove(0);
|
||||
(_dropdownElt.options as any /* TODO remove `as any` */).remove(0);
|
||||
}
|
||||
|
||||
if (!_schema.Required) {
|
||||
var defaultOpt = new Option(Strings.STS.L_LookupFieldNoneOption, '0', selected, selected);
|
||||
_dropdownElt.options.add(defaultOpt);
|
||||
(_dropdownElt.options as any /* TODO remove `as any` */).add(defaultOpt);
|
||||
selected = _selectedValue == 0;
|
||||
}
|
||||
var isEmptyList = true;
|
||||
@@ -1122,7 +1122,7 @@ module CSR {
|
||||
selected = true;
|
||||
}
|
||||
var opt = new Option(text, id.toString(), isSelected, isSelected);
|
||||
_dropdownElt.options.add(opt);
|
||||
(_dropdownElt.options as any /* TODO remove `as any` */).add(opt);
|
||||
isEmptyList = false;
|
||||
}
|
||||
pendingLoads--;
|
||||
|
||||
@@ -47,10 +47,10 @@ function test_apis() {
|
||||
var apis: basem.ClientApiBase[] = [buildapi, coreapi, filecontainerapi, galleryapi, gitapi, taskapi, agentapi, testapi, tfvcapi, witapi];
|
||||
var qapis: basem.QClientApiBase[] = [qbuildapi, qcoreapi, qfilecontainerapi, qgalleryapi, qgitapi, qtaskapi, qagentapi, qtestapi, qtfvcapi, qwitapi];
|
||||
|
||||
for(var api in apis) {
|
||||
for(var api of apis) {
|
||||
console.log('API user agent name: ' + api.userAgent);
|
||||
}
|
||||
for(var qapi in qapis) {
|
||||
for(var qapi of qapis) {
|
||||
console.log('Q API user agent name: ' + qapi.api.userAgent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ module XDate_Test
|
||||
//var xdate = new XDate(YEAR, MONTH, DATE, true);
|
||||
var xdate = new XDate(YEAR, MONTH, DATE);
|
||||
xdate.setUTCMode(true);
|
||||
return xdate.getUTCMode()
|
||||
return xdate.getUTCMode() &&
|
||||
xdate.getFullYear() == YEAR &&
|
||||
xdate.getMonth() == MONTH &&
|
||||
xdate.getDate() == DATE &&
|
||||
|
||||
@@ -139,6 +139,9 @@ module yfilesTest {
|
||||
}
|
||||
|
||||
class MyNodeStyle extends yfiles.drawing.SimpleAbstractNodeStyle<yfiles.drawing.RectVisual> {
|
||||
constructor() {
|
||||
super(null);
|
||||
}
|
||||
createVisual(node:yfiles.graph.INode, renderContext:yfiles.drawing.IRenderContext):yfiles.drawing.RectVisual {
|
||||
return new yfiles.drawing.RectVisual.FromRectangle(new yfiles.geometry.Rectangle(0, 0, 10, 10));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user