From 163f4438dfaa49e1fc28da9293ee6f1e784f8461 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Sun, 4 Jun 2017 22:03:03 -0700 Subject: [PATCH] Fix weak type errors (#16845) * Fix first round of weak type errors Done through griddle-react * 95% done with weak type fixes * Fix last couple of weak type errors * Remove some lint from mithril tests * mithril's Lifecycle is not a weak type any more Restore the Lifecycle constraints in the rest of the definitions. * Fix react-redux tests after #16652 broke them * Remove package-lock.json --- types/alt/alt-tests.ts | 2 +- types/angular/angular-tests.ts | 2 +- .../angularlocalstorage-tests.ts | 2 + .../backbone.paginator-tests.ts | 38 +++++++------------ types/bookshelf/index.d.ts | 3 +- types/bufferstream/postbuffer.d.ts | 2 +- types/bunyan/index.d.ts | 4 +- types/electron/test/renderer.ts | 4 +- types/enzyme/enzyme-tests.tsx | 4 +- types/eyes/eyes-tests.ts | 2 +- types/eyes/index.d.ts | 2 +- .../fs-extra-promise-tests.ts | 8 ++-- types/fs-extra/fs-extra-tests.ts | 2 +- types/gapi.analytics/gapi.analytics-tests.ts | 14 +++---- types/gapi.analytics/index.d.ts | 21 ++++++---- types/gulp-coffeeify/index.d.ts | 8 ++-- types/highcharts/index.d.ts | 2 +- types/isotope-layout/isotope-layout-tests.ts | 2 +- types/js-data/js-data-tests.ts | 4 +- types/js-yaml/index.d.ts | 3 +- types/kendo-ui/index.d.ts | 12 +++--- types/mapbox-gl/index.d.ts | 8 ++-- types/mapbox-gl/mapbox-gl-tests.ts | 4 +- types/markitup/index.d.ts | 3 ++ types/materialize-css/index.d.ts | 4 +- types/mithril/index.d.ts | 1 + types/mithril/test/test-route.ts | 4 +- types/mongoose/index.d.ts | 3 +- types/ngmap/ngmap-tests.ts | 6 ++- types/pinterest-sdk/index.d.ts | 9 ++++- types/polymer-ts/index.d.ts | 3 +- types/react-leaflet/index.d.ts | 2 +- types/react-mdl/index.d.ts | 2 +- types/react-native/index.d.ts | 1 + types/react-redux/package.json | 2 +- types/react-redux/react-redux-tests.tsx | 4 +- types/react/index.d.ts | 2 +- types/recompose/recompose-tests.tsx | 2 +- types/rx.wamp/rx.wamp-tests.ts | 4 +- types/s3-uploader/index.d.ts | 2 +- types/sequelize/index.d.ts | 2 + types/sequelize/sequelize-tests.ts | 1 - types/sharepoint/sharepoint-tests.ts | 13 +++++-- types/slickgrid/test/index.ts | 6 +-- .../test/slick.checkboxselectcolumn.ts | 4 +- types/uglify-js/index.d.ts | 2 +- types/vinyl-paths/index.d.ts | 3 +- types/vinyl-paths/vinyl-paths-tests.ts | 2 +- types/yfiles/yfiles-tests.ts | 2 +- 49 files changed, 133 insertions(+), 109 deletions(-) diff --git a/types/alt/alt-tests.ts b/types/alt/alt-tests.ts index 8d1108ada3..3556e3a167 100644 --- a/types/alt/alt-tests.ts +++ b/types/alt/alt-tests.ts @@ -119,7 +119,7 @@ interface ExtendedTestStore extends AltJS.AltStore { split():Array; } -var testStore = alt.createStore(TestStore); +var testStore = alt.createStore(new TestStore()); function testCallback(state:AltTestState) { console.log(state); diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index d01dbd25b8..d77c18fa37 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -591,7 +591,7 @@ namespace TestPromise { assertPromiseType(promise.catch((err) => anyOf2(tresult, reject))); assertPromiseType(promise.catch((err) => anyOf3(tresult, tresultPromise, reject))); assertPromiseType(promise.catch((err) => tresultPromise)); - assertPromiseType>(promise.catch((err) => tresultHttpPromise)); + assertPromiseType>(promise.catch((err) => tresultHttpPromise)); assertPromiseType(promise.catch((err) => tother)); assertPromiseType(promise.catch((err) => totherPromise)); assertPromiseType>(promise.catch((err) => totherHttpPromise)); diff --git a/types/angularlocalstorage/angularlocalstorage-tests.ts b/types/angularlocalstorage/angularlocalstorage-tests.ts index f62b38c897..22d71f8b5d 100644 --- a/types/angularlocalstorage/angularlocalstorage-tests.ts +++ b/types/angularlocalstorage/angularlocalstorage-tests.ts @@ -15,6 +15,8 @@ class TestController { storage.clearAll(); } + $onInit() { + } } var app = angular.module('angularLocalStorageTests', ['angularLocalStorage']); diff --git a/types/backbone.paginator/backbone.paginator-tests.ts b/types/backbone.paginator/backbone.paginator-tests.ts index f4f5765988..f24e2855f5 100644 --- a/types/backbone.paginator/backbone.paginator-tests.ts +++ b/types/backbone.paginator/backbone.paginator-tests.ts @@ -107,60 +107,48 @@ namespace Paging { testCollection.getFirstPage(options); - // 'silent's type is boolean. (structural subtyping) - testCollection.getFirstPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getFirstPage({url: true}); + testCollection.getFirstPage({silent: false}); + testCollection.getFirstPage({url: 'zombocom'}); result = testCollection.getLastPage(); testCollection.getLastPage(options); - // 'silent's type is boolean. (structural subtyping) - testCollection.getLastPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getLastPage({url: true}); + testCollection.getLastPage({silent: true}); + testCollection.getLastPage({url: 'chickensnack'}); result = testCollection.getNextPage(); testCollection.getNextPage(options); - // 'silent's type is boolean. (structural subtyping) - testCollection.getNextPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getNextPage({url: true}); + testCollection.getNextPage({silent: false}); + testCollection.getNextPage({url: 'hampsterdance'}); result = testCollection.getPage(1); testCollection.getPage("1", options); - // 'silent's type is boolean. (structural subtyping) - testCollection.getPage(1, {silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getPage(1, {url: true}); + testCollection.getPage(1, {silent: true}); + testCollection.getPage(1, {url: 'badcandy'}); result = testCollection.getPageByOffset(1); testCollection.getPageByOffset(1, options); - // 'silent's type is boolean. (structural subtyping) - testCollection.getPageByOffset(1, {silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getPageByOffset(1, {url: true}); + testCollection.getPageByOffset(1, {silent: false}); + testCollection.getPageByOffset(1, {url: 'oldmanmurray'}); result = testCollection.getPreviousPage(); testCollection.getPreviousPage(options); - // 'silent's type is boolean. (structural subtyping) - testCollection.getPreviousPage({silent: 'aa'}); - // 'url's type is string. (structural subtyping) - testCollection.getPreviousPage({url: true}); + testCollection.getPreviousPage({silent: false}); + testCollection.getPreviousPage({url: 'uncyclopedia'}); var hasPage:boolean = testCollection.hasNextPage(); @@ -231,7 +219,7 @@ namespace Setting { var result2:TestCollection - = testCollection.setSorting('id', 1, options); + = testCollection.setSorting('id', 1, { full: true}); result1 = testCollection.switchMode( 'server', diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index 86176ed2e8..a7c0a90536 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -40,7 +40,8 @@ declare namespace Bookshelf { tableName?: string; } - abstract class ModelBase> extends Events> implements IModelBase { + interface ModelBase> extends IModelBase { } + abstract class ModelBase> extends Events> { /** If overriding, must use a getter instead of a plain property. */ idAttribute: string; diff --git a/types/bufferstream/postbuffer.d.ts b/types/bufferstream/postbuffer.d.ts index f8591771cc..bd348b84db 100644 --- a/types/bufferstream/postbuffer.d.ts +++ b/types/bufferstream/postbuffer.d.ts @@ -8,5 +8,5 @@ declare class PostBuffer extends BufferStream { /** set a callback to get all post data from a http server request */ onEnd(callback: (data: any) => void): void; /** pumps data into another stream to allow incoming streams given options will be passed to Stream.pipe */ - pipe(stream: NodeJS.WritableStream, options?: BufferStream.Opts): NodeJS.ReadableStream; + pipe(stream: NodeJS.WritableStream, options?: { end?: boolean }): NodeJS.ReadableStream; } diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index 060fa8eaa3..f3c739a992 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -263,13 +263,13 @@ declare namespace Logger { limit?: number; } - class RingBuffer extends EventEmitter { + class RingBuffer extends EventEmitter implements NodeJS.WritableStream { constructor(options: RingBufferOptions); writable: boolean; records: any[]; - write(record: any): void; + write(record: any): boolean; end(record?: any): void; destroy(): void; destroySoon(): void; diff --git a/types/electron/test/renderer.ts b/types/electron/test/renderer.ts index 8394f59d24..9779765e6f 100644 --- a/types/electron/test/renderer.ts +++ b/types/electron/test/renderer.ts @@ -273,7 +273,7 @@ ipcRenderer.on('ping', function() { // showOpenDialog // https://electron.atom.io/docs/api/dialog/#dialogshowopendialogbrowserwindow-options-callback -remote.dialog.showOpenDialog(win); +remote.dialog.showOpenDialog({ title: 'foo' }); remote.dialog.showOpenDialog(win, {}, fileNames => fileNames); remote.dialog.showOpenDialog(win, { title: 'foo', @@ -293,7 +293,7 @@ remote.dialog.showOpenDialog(win, { // showSaveDialog // https://electron.atom.io/docs/api/dialog/#dialogshowsavedialogbrowserwindow-options-callback -remote.dialog.showSaveDialog(win); +remote.dialog.showSaveDialog({ title: 'foo' }); remote.dialog.showSaveDialog(win, {}, fileNames => fileNames); remote.dialog.showSaveDialog(win, { title: 'foo', diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 2dc9e98c87..083cee54b2 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -70,7 +70,7 @@ function ShallowWrapperTest() { shallowWrapper = shallowWrapper.filter(MyComponent); statelessWrapper = statelessWrapper.filter(MyStatelessComponent); shallowWrapper = shallowWrapper.filter({ numberProp: 12 }); - elementWrapper = shallowWrapper.filter('.selector'); + shallowWrapper = shallowWrapper.filter('.selector'); } function test_filterWhere() { @@ -422,7 +422,7 @@ function ReactWrapperTest() { reactWrapper = reactWrapper.filter(MyComponent); statelessWrapper = statelessWrapper.filter(MyStatelessComponent); reactWrapper = reactWrapper.filter({ numberProp: 12 }); - elementWrapper = reactWrapper.filter('.selector'); + reactWrapper = reactWrapper.filter('.selector'); } function test_filterWhere() { diff --git a/types/eyes/eyes-tests.ts b/types/eyes/eyes-tests.ts index 2775aff7c4..c0ca4bc846 100644 --- a/types/eyes/eyes-tests.ts +++ b/types/eyes/eyes-tests.ts @@ -27,7 +27,7 @@ var options = { maxLength: 120 } -var result = eyes.inspector(testObj) +var result = eyes.inspector(options) diff --git a/types/eyes/index.d.ts b/types/eyes/index.d.ts index 3307d9d484..219d13c0fe 100644 --- a/types/eyes/index.d.ts +++ b/types/eyes/index.d.ts @@ -43,7 +43,7 @@ export interface EyesOptions { /** Don't output functions at all */ hideFunctions?: boolean; /** Stream to write to, or null */ - stream?: stream.Writable; + stream?: NodeJS.WritableStream; /** Truncate output if longer */ maxLength?: number; } diff --git a/types/fs-extra-promise/fs-extra-promise-tests.ts b/types/fs-extra-promise/fs-extra-promise-tests.ts index cd17429fe4..ef8de43ad3 100644 --- a/types/fs-extra-promise/fs-extra-promise-tests.ts +++ b/types/fs-extra-promise/fs-extra-promise-tests.ts @@ -180,17 +180,17 @@ str = fs.readFileSync(filename, encoding); buf = fs.readFileSync(filename, openOpts); fs.writeFile(filename, data, errorCallback); -fs.writeFile(filename, data, encoding, errorCallback); +fs.writeFile(filename, data, { encoding }, errorCallback); fs.writeFile(filename, data, writeOpts, errorCallback); fs.writeFileSync(filename, data); -fs.writeFileSync(filename, data, encoding); +fs.writeFileSync(filename, data, { encoding }); fs.writeFileSync(filename, data, writeOpts); fs.appendFile(filename, data, errorCallback); -fs.appendFile(filename, data, encoding, errorCallback); +fs.appendFile(filename, data, { encoding }, errorCallback); fs.appendFile(filename, data, writeOpts, errorCallback); fs.appendFileSync(filename, data); -fs.appendFileSync(filename, data, encoding); +fs.appendFileSync(filename, data, { encoding }); fs.appendFileSync(filename, data, writeOpts); fs.watchFile(filename, watchListener); diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index ce18de35c8..39f3a9d37a 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -62,7 +62,7 @@ fs.copy(src, dest, ); fs.copySync(src, dest); fs.copySync(src, dest, (src: string) => false); -fs.copySync(src, dest, /.*/); +fs.copySync(src, dest, { filter: /.*/ }); fs.copySync(src, dest, { overwrite: true, diff --git a/types/gapi.analytics/gapi.analytics-tests.ts b/types/gapi.analytics/gapi.analytics-tests.ts index 2c35403d10..767a3f8657 100644 --- a/types/gapi.analytics/gapi.analytics-tests.ts +++ b/types/gapi.analytics/gapi.analytics-tests.ts @@ -19,19 +19,19 @@ function test_namespace() { "enumDescriptions" ?: string[]; "location" ?: string; } - var kBI : AnalyticsParameter = gapi.client.analytics.kB.parameters.alt; + var kBI : AnalyticsParameter = new gapi.client.analytics.kB.parameters.alt(); var kB = !!kBI; - kBI = gapi.client.analytics.kB.parameters.fields; + kBI = new gapi.client.analytics.kB.parameters.fields(); kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.key; + kBI = new gapi.client.analytics.kB.parameters.key(); kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.oauth_token; + kBI = new gapi.client.analytics.kB.parameters.oauth_token(); kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.prettyPrint; + kBI = new gapi.client.analytics.kB.parameters.prettyPrint(); kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.quotaUser; + kBI = new gapi.client.analytics.kB.parameters.quotaUser(); kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.userIP; + kBI = new gapi.client.analytics.kB.parameters.userIP(); kB = kB && !!kBI; analytics = analytics && kB; diff --git a/types/gapi.analytics/index.d.ts b/types/gapi.analytics/index.d.ts index 31bbd1a83b..873c40a767 100644 --- a/types/gapi.analytics/index.d.ts +++ b/types/gapi.analytics/index.d.ts @@ -47,13 +47,20 @@ declare namespace gapi.client.analytics.kB.parameters { "enumDescriptions" ?: string[]; "location" ?: string; } - export class alt implements AnalyticsParameter {} - export class fields implements AnalyticsParameter {} - export class key implements AnalyticsParameter {} - export class oauth_token implements AnalyticsParameter {} - export class prettyPrint implements AnalyticsParameter {} - export class quotaUser implements AnalyticsParameter {} - export class userIP implements AnalyticsParameter {} + export interface alt extends AnalyticsParameter {} + export class alt {} + export interface fields extends AnalyticsParameter {} + export class fields {} + export interface key extends AnalyticsParameter {} + export class key {} + export interface oauth_token extends AnalyticsParameter {} + export class oauth_token {} + export interface prettyPrint extends AnalyticsParameter {} + export class prettyPrint {} + export interface quotaUser extends AnalyticsParameter {} + export class quotaUser {} + export interface userIP extends AnalyticsParameter {} + export class userIP {} } interface View { diff --git a/types/gulp-coffeeify/index.d.ts b/types/gulp-coffeeify/index.d.ts index 161eb9376d..2fe2e1d497 100644 --- a/types/gulp-coffeeify/index.d.ts +++ b/types/gulp-coffeeify/index.d.ts @@ -26,15 +26,15 @@ declare namespace coffeeify { transforms?: Transforms; } - interface Aliases { + type Aliases = Array<{ cwd?: string; base?: string; - } + }>; - interface Transforms { + type Transforms = Array<{ ext?: string; transform?(data: string): string; - } + }>; } declare var coffeeify: coffeeify.Coffeeify; diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index 8cc623b680..b71610f6b7 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -5012,7 +5012,7 @@ declare namespace Highcharts { * color: '#FF00FF' * }] */ - data?: number[] | Array<[number, number]> | Array<[string, number]> | DataPoint[]; + data?: Array; /** * An id for the series. This can be used after render time to get a pointer to the series object through * chart.get(). diff --git a/types/isotope-layout/isotope-layout-tests.ts b/types/isotope-layout/isotope-layout-tests.ts index 8f20d52fcc..648ba507ce 100644 --- a/types/isotope-layout/isotope-layout-tests.ts +++ b/types/isotope-layout/isotope-layout-tests.ts @@ -101,7 +101,7 @@ let iso: Isotope = $grid.data('isotope'); iso = new Isotope('.grid'); iso.addItems($('.items')); iso.appended(new HTMLElement()); -iso.arrange(new HTMLElement()); +iso.arrange({ cellsByColumn: { columnWidth: 101, rowHeight: 12 } }); iso.destroy(); elements = iso.getFilteredItemElements(); elements = iso.getItemElements(); diff --git a/types/js-data/js-data-tests.ts b/types/js-data/js-data-tests.ts index 9b77da72ac..12ebc9026d 100644 --- a/types/js-data/js-data-tests.ts +++ b/types/js-data/js-data-tests.ts @@ -30,7 +30,7 @@ User.find(1).then(function (user:IUser) { var user:IUser = User.createInstance({name: 'John'}); var store = new JSData.DS(); -var User2 = store.defineResource('user'); +var User2 = store.defineResource('user'); var user:IUser = User2.inject({id: 1, name: 'John'}); var user2:IUser = User2.inject({id: 1, age: 30}); @@ -601,4 +601,4 @@ customActionResourceInstance.on("DS.change", myEvtHandler); customActionResourceInstance.off("DS.change", myEvtHandler); customActionResourceInstance.emit("DS.change", customActionResource, customActionResourceInstance); -JSData.DSUtils.Promise = Promise; \ No newline at end of file +JSData.DSUtils.Promise = Promise; diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 7f19fb32eb..d19f10a61c 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -7,7 +7,8 @@ declare namespace jsyaml { export function safeLoad(str: string, opts?: LoadOptions): any; export function load(str: string, opts?: LoadOptions): any; - export class Type implements TypeConstructorOptions { + export interface Type extends TypeConstructorOptions { } + export class Type { constructor(tag: string, opts?: TypeConstructorOptions); tag: string; } diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 53a5a36602..855a096f3d 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1592,11 +1592,11 @@ declare namespace kendo.ui { } - interface AlertMessages { + interface AlertMessages extends DialogMessages { okText?: string; } - interface AlertOptions { + interface AlertOptions extends DialogOptions { name?: string; messages?: AlertMessages; } @@ -2104,12 +2104,12 @@ declare namespace kendo.ui { } - interface ConfirmMessages { + interface ConfirmMessages extends DialogMessages { okText?: string; cancel?: string; } - interface ConfirmOptions { + interface ConfirmOptions extends DialogOptions { name?: string; messages?: ConfirmMessages; } @@ -5267,12 +5267,12 @@ declare namespace kendo.ui { } - interface PromptMessages { + interface PromptMessages extends DialogMessages { okText?: string; cancel?: string; } - interface PromptOptions { + interface PromptOptions extends DialogOptions { name?: string; messages?: PromptMessages; } diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index d8274be070..41c7f84d98 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -513,7 +513,8 @@ declare namespace mapboxgl { /** * VideoSource */ - export class VideoSource implements Source, VideoSourceOptions { + export interface VideoSource extends VideoSourceOptions { } + export class VideoSource implements Source { type: "video"; constructor(options?: mapboxgl.VideoSourceOptions); @@ -532,7 +533,8 @@ declare namespace mapboxgl { /** * ImageSource */ - export class ImageSource implements Source, ImageSourceOptions { + export interface ImageSource extends ImageSourceOptions { } + export class ImageSource implements Source { type: "image"; constructor(options?: mapboxgl.ImageSourceOptions); @@ -1038,7 +1040,7 @@ declare namespace mapboxgl { export interface CirclePaint { "circle-radius"?: number | StyleFunction; "circle-radius-transition"?: Transition; - "circle-color"?: number | StyleFunction; + "circle-color"?: string; "circle-blur"?: number | StyleFunction; "circle-opacity"?: number | StyleFunction; "circle-translate"?: number[]; diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index 9e7b715968..12fbac9010 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -51,7 +51,7 @@ map.on('load', function(){ } }); - var layers = [ + var layers: [number, string][] = [ [150, '#f28cb1'], [20, '#f1f075'], [0, '#51bbd6'] @@ -369,4 +369,4 @@ let marker = new mapboxgl.Marker(null,{offset: [10, 0]}) .setLngLat([-50,50]) .addTo(map); -marker.remove(); \ No newline at end of file +marker.remove(); diff --git a/types/markitup/index.d.ts b/types/markitup/index.d.ts index d7884021a8..8fca131109 100644 --- a/types/markitup/index.d.ts +++ b/types/markitup/index.d.ts @@ -219,6 +219,9 @@ declare namespace MarkItUp { * Returns true if the Alt key is pressed when the callback is fired. */ altKey?: boolean; + + /** Not documented on the markitup site, but present in the tests */ + separator?: string; } interface Static { diff --git a/types/materialize-css/index.d.ts b/types/materialize-css/index.d.ts index 8b4c610e13..12dbeb5aa0 100644 --- a/types/materialize-css/index.d.ts +++ b/types/materialize-css/index.d.ts @@ -317,7 +317,7 @@ declare namespace Materialize { * It will only be called once. * Example: 'console.log("hello, world!")'; */ - callback?: Function; + callback?: string; } interface TabOptions { @@ -393,7 +393,7 @@ declare namespace Materialize { * * @name options optional parameter with scroll fire options */ - scrollFire(options?: ScrollFireOptions): void; + scrollFire(options?: ScrollFireOptions[]): void; /** * A staggered reveal effect for any UL Tag with list items diff --git a/types/mithril/index.d.ts b/types/mithril/index.d.ts index e17064abfc..1179db4fbc 100644 --- a/types/mithril/index.d.ts +++ b/types/mithril/index.d.ts @@ -44,6 +44,7 @@ declare namespace Mithril { onbeforeupdate?(this: State, vnode: Vnode, old: VnodeDOM): boolean | void; /** The onremove hook is called before a DOM element is removed from the document. */ onupdate?(this: State, vnode: VnodeDOM): any; + [s: string]: any; } interface Hyperscript { diff --git a/types/mithril/test/test-route.ts b/types/mithril/test/test-route.ts index b18a92212c..e3ca4e4aa6 100644 --- a/types/mithril/test/test-route.ts +++ b/types/mithril/test/test-route.ts @@ -59,7 +59,7 @@ route(document.body, '/', { return h(component1); } }, - 'test3': { + test3: { onmatch(args, path) { return component2; }, @@ -67,7 +67,7 @@ route(document.body, '/', { return ['abc', 123, null, h(component2), ['nested', h('p', 123)]]; } }, - 'test4': { + test4: { onmatch(args, path) { // Must provide a Promise type if we want type checking return new Promise>((resolve, reject) => { diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 548852405b..8f5d6bdad6 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -914,7 +914,8 @@ declare module "mongoose" { * section document.js * http://mongoosejs.com/docs/api.html#document-js */ - class MongooseDocument implements MongooseDocumentOptionals { + interface MongooseDocument extends MongooseDocumentOptionals { } + class MongooseDocument { /** Checks if a path is set to its default. */ $isDefault(path?: string): boolean; diff --git a/types/ngmap/ngmap-tests.ts b/types/ngmap/ngmap-tests.ts index b78ff9071a..ca9cc1acfb 100644 --- a/types/ngmap/ngmap-tests.ts +++ b/types/ngmap/ngmap-tests.ts @@ -1,4 +1,4 @@ -class NgMapTestController { +class NgMapTestController implements ng.IController { constructor(public $scope: ng.IScope, public $window: ng.IWindowService, public NgMap: angular.map.INgMap) { this.showMap(); } @@ -8,6 +8,8 @@ class NgMapTestController { console.log(map.getCenter()); }); } + $onInit() { + } } var app = angular.module('angularLocalStorageTests', ['ngMap']); @@ -21,4 +23,4 @@ app.config(function(NgMapProvider: angular.map.INgMapProvider) { }); app.controller('testCtrl', ['$scope', '$window', 'ngMap', - ($scope: ng.IScope, $window: ng.IWindowService, NgMap: angular.map.INgMap) => new NgMapTestController($scope, $window, NgMap)]); \ No newline at end of file + ($scope: ng.IScope, $window: ng.IWindowService, NgMap: angular.map.INgMap) => new NgMapTestController($scope, $window, NgMap)]); diff --git a/types/pinterest-sdk/index.d.ts b/types/pinterest-sdk/index.d.ts index b24e4bee7b..bc5aed2627 100644 --- a/types/pinterest-sdk/index.d.ts +++ b/types/pinterest-sdk/index.d.ts @@ -40,6 +40,13 @@ declare namespace PDK { session?: OauthSession; } + interface PinData { + board: string; + note: string; + link: string; + image_url: string; + } + /** * Get information on the currently authenticated user * @param cb the callback export function to handle the response @@ -69,7 +76,7 @@ declare namespace PDK { * @param path URL path * @param httpMethod HTTP verb */ - export function request(path: string, httpMethod?: string|HttpMethod, params?: OAuthRequestParams, callback?: Function): void; + export function request(path: string, httpMethod?: string|HttpMethod, data?: PinData, callback?: Function): void; /** * Show user login dialog, and save access token diff --git a/types/polymer-ts/index.d.ts b/types/polymer-ts/index.d.ts index b14ff58c4c..d5c91f4e80 100644 --- a/types/polymer-ts/index.d.ts +++ b/types/polymer-ts/index.d.ts @@ -105,7 +105,8 @@ declare namespace polymer { computed?: string; observer?: string; } - class Base extends polymer.PolymerBase implements polymer.Element { + interface Base extends polymer.Element { } + class Base extends polymer.PolymerBase { static create(...args: any[]): T; static register(): void; is: string; diff --git a/types/react-leaflet/index.d.ts b/types/react-leaflet/index.d.ts index da829ff2cc..7b14e0ec1f 100644 --- a/types/react-leaflet/index.d.ts +++ b/types/react-leaflet/index.d.ts @@ -228,7 +228,7 @@ export class Marker

extends Map getChildContext(): { popupContainer: E }; } -export interface PathProps extends PathEvents, Leaflet.PathOptions { } +export interface PathProps extends PathEvents, Leaflet.PathOptions, MapLayerProps { } export abstract class Path

extends MapLayer { getChildContext(): { popupContainer: E }; getPathOptions(props: P): Leaflet.PathOptions; diff --git a/types/react-mdl/index.d.ts b/types/react-mdl/index.d.ts index 6265f11ec1..2733a40573 100644 --- a/types/react-mdl/index.d.ts +++ b/types/react-mdl/index.d.ts @@ -11,7 +11,7 @@ export = __ReactMDL; declare namespace __ReactMDL { type __MDLClassProps = React.ClassAttributes; type __MDLOtherProps = React.HTMLProps; - class __MDLComponent

extends React.Component { } + class __MDLComponent

extends React.Component { } class __MDLBasicComponent extends __MDLComponent<__MDLOtherProps> { } interface ShadowedComponent { diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index c049c2aa5f..22930ea00c 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4494,6 +4494,7 @@ export interface SceneConfig { export interface JumpSceneConfig extends SceneConfig { gestures: { + pop?: LeftToRightGesture jumpBack: JumpGesture jumpForward: JumpGesture } diff --git a/types/react-redux/package.json b/types/react-redux/package.json index e52256ea90..36ce503807 100644 --- a/types/react-redux/package.json +++ b/types/react-redux/package.json @@ -2,4 +2,4 @@ "dependencies": { "redux": "^3.6.0" } -} \ No newline at end of file +} diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 555b50ecf9..d6742a3e43 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -370,13 +370,13 @@ namespace TestTOwnPropsInference { // React.createElement(ConnectedWithoutOwnProps, { anything: 'goes!' }); // This compiles, as expected. - React.createElement(ConnectedWithOwnProps, { own: 'string' }); + React.createElement(ConnectedWithOwnProps, { state: 'string', own: 'string' }); // This should not compile, which is good. // React.createElement(ConnectedWithOwnProps, { anything: 'goes!' }); // This compiles, as expected. - React.createElement(ConnectedWithTypeHint, { own: 'string' }); + React.createElement(ConnectedWithTypeHint, { state: 'string', own: 'string' }); // This should not compile, which is good. // React.createElement(ConnectedWithTypeHint, { anything: 'goes!' }); diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 979870febb..7d71c2d183 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -264,7 +264,7 @@ declare namespace React { } interface Mixin extends ComponentLifecycle { - mixins?: Mixin; + mixins?: Mixin[]; statics?: { [key: string]: any; }; diff --git a/types/recompose/recompose-tests.tsx b/types/recompose/recompose-tests.tsx index 1d645f412d..a698de6ffa 100644 --- a/types/recompose/recompose-tests.tsx +++ b/types/recompose/recompose-tests.tsx @@ -87,7 +87,7 @@ function testDefaultProps() { const innerComponent = ({a, b}: Props) =>

{a}, {b}
; const enhancer = defaultProps({ a: "answer", b: 42 }); - const enhanced: React.StatelessComponent = enhancer(innerComponent); + const enhanced: React.StatelessComponent = enhancer JSX.Element>(innerComponent); } function testRenameProp() { diff --git a/types/rx.wamp/rx.wamp-tests.ts b/types/rx.wamp/rx.wamp-tests.ts index 3bd6ddbffb..178c8d5e14 100644 --- a/types/rx.wamp/rx.wamp-tests.ts +++ b/types/rx.wamp/rx.wamp-tests.ts @@ -32,7 +32,7 @@ function subscribe_to_topics(session: autobahn.Session, options: autobahn.ISubsc } function new_in_version3(onResult: Rx.Observer) { - Rx.Observable.subscribeAsObservable(Rx.Observable.fromConnection("ws://myconnectionurl:9090"), "wamp.my.foo", onResult); + Rx.Observable.subscribeAsObservable(Rx.Observable.fromConnection("ws://myconnectionurl:9090"), "wamp.my.foo", undefined, onResult); } function new_in_version5(fooObserver: Rx.Observer) { @@ -184,4 +184,4 @@ function weather_station_monitor(session: autobahn.Session) { // => (2 + 3) * (3 + 4) = 35 console.log("Result was %d", value); }); -} \ No newline at end of file +} diff --git a/types/s3-uploader/index.d.ts b/types/s3-uploader/index.d.ts index 166d98a663..d8e4501e19 100644 --- a/types/s3-uploader/index.d.ts +++ b/types/s3-uploader/index.d.ts @@ -29,7 +29,7 @@ declare namespace Upload { tmpDir?: string; workers?: number; url?: string; - versions?: S3UploaderVersion; + versions?: S3UploaderVersion[]; } interface Meta { diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 47eb708e25..ff6a55e4b3 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -3171,6 +3171,8 @@ declare namespace sequelize { * be returned. Only applies if `options.paranoid` is true for the model. */ paranoid?: boolean; + + all?: boolean | string; } /** diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 4363de9580..0fa370a62a 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -923,7 +923,6 @@ User.findOne( { where : { id : 1 }, attributes : ['id', ['username', 'name']] } User.findOne( { where : { id : 1 }, attributes : ['id'] } ); User.findOne( { where : { username : 'foo' }, logging : function( ) { } } ); User.findOne( { limit : 10 } ); -User.findOne( { include : [1] } ); User.findOne( { where : { title : 'homework' }, include : [User] } ); User.findOne( { where : { name : 'environment' }, include : [{ model : User, as : 'PrivateDomain' }] } ); User.findOne( { where : { username : 'foo' }, transaction : t } ).then( ( p ) => p ); diff --git a/types/sharepoint/sharepoint-tests.ts b/types/sharepoint/sharepoint-tests.ts index d3635caa19..20555d0cd5 100644 --- a/types/sharepoint/sharepoint-tests.ts +++ b/types/sharepoint/sharepoint-tests.ts @@ -658,7 +658,11 @@ namespace CSR { } export function getFieldTemplate(field: SPClientTemplates.FieldSchema, mode: SPClientTemplates.ClientControlMode): SPClientTemplates.FieldCallback { - const ctx = { ListSchema: { Field: [field] }, FieldControlModes: {} }; + const ctx = { + ListTemplateType: 1, + FieldControlModes: {}, + ListSchema: { Field: [field] }, + }; ctx.FieldControlModes[field.Name] = mode; const templates = SPClientTemplates.TemplateManager.GetTemplates(ctx); return templates.Fields[field.Name]; @@ -2332,7 +2336,7 @@ namespace App { activate(): void; } - class appcontroller implements Iappcontroller { + class appcontroller implements Iappcontroller, ng.IController { title: string = "appcontroller"; lists: SP.List[]; @@ -2350,9 +2354,12 @@ namespace App { .catch((e: string) => this.$n.show(e, true)) .finally(() => this.$n.remove(loading)); } + + $onInit() { + } } - angular.module("app").controller("appcontroller", appcontroller); + angular.module("app").controller("appcontroller", [appcontroller]); } namespace App { diff --git a/types/slickgrid/test/index.ts b/types/slickgrid/test/index.ts index d87bc2240c..d0ee85a23c 100644 --- a/types/slickgrid/test/index.ts +++ b/types/slickgrid/test/index.ts @@ -101,7 +101,7 @@ sortable ? console.log("It's sortable!") : console.log("It's not sortable!"); var data2 = grid.getColumns(); data2[0].name = "First"; -grid.setColumns(data); +grid.setColumns(data2); grid.updateColumnHeader("FirstName", "A First Name"); @@ -120,14 +120,14 @@ grid.canCellBeActive(5, 10); grid.canCellBeSelected(5, 10); grid.editActiveCell(new Slick.Editors.Date({ - column: cols, + column: cols[0], container: undefined, grid: grid })); grid.setActiveCell(0, 0); grid.editActiveCell(new Slick.Editors.Date({ - column: cols, + column: cols[0], container: undefined, grid: grid })); diff --git a/types/slickgrid/test/slick.checkboxselectcolumn.ts b/types/slickgrid/test/slick.checkboxselectcolumn.ts index c0f08bb2af..4006bfcf75 100644 --- a/types/slickgrid/test/slick.checkboxselectcolumn.ts +++ b/types/slickgrid/test/slick.checkboxselectcolumn.ts @@ -34,6 +34,6 @@ grid = new Slick.Grid("#myGrid", data, columns, options); grid.setSelectionModel(new Slick.RowSelectionModel({ selectActiveRow: false })); grid.registerPlugin(checkboxSelector); - var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, options); + var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, { fadeSpeed: 1 }); }) -})(); \ No newline at end of file +})(); diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index d87c80aff6..d9410070a9 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -174,7 +174,7 @@ declare namespace UglifyJS { /** * Output a source map */ - source_map?: SourceMapOptions; + source_map?: SourceMap; /** * Use brackets every time? diff --git a/types/vinyl-paths/index.d.ts b/types/vinyl-paths/index.d.ts index 26878a2ac6..d4116e5ae1 100644 --- a/types/vinyl-paths/index.d.ts +++ b/types/vinyl-paths/index.d.ts @@ -23,8 +23,7 @@ declare namespace paths { } interface Callback { - //TODO: Function is gulp.ITaskCallback, which is currently invisible - (path: string, callback: Function): any; + (path: string): any; } } diff --git a/types/vinyl-paths/vinyl-paths-tests.ts b/types/vinyl-paths/vinyl-paths-tests.ts index 30e6a1c874..3e66d44e3a 100644 --- a/types/vinyl-paths/vinyl-paths-tests.ts +++ b/types/vinyl-paths/vinyl-paths-tests.ts @@ -15,7 +15,7 @@ gulp.task('delete2', function (cb: Function) { .pipe(vp) .pipe(gulp.dest('dist')) .on('end', function () { - del(vp.paths, cb); + del(vp.paths); }); }); diff --git a/types/yfiles/yfiles-tests.ts b/types/yfiles/yfiles-tests.ts index 05e284529c..1bcaefe8c9 100644 --- a/types/yfiles/yfiles-tests.ts +++ b/types/yfiles/yfiles-tests.ts @@ -19,7 +19,7 @@ class BasicTest { this.graphComponent.inputMode = graphEditorInputMode; - this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle(yfiles.view.Fill.ORANGE); + this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle({ fill: yfiles.view.Fill.ORANGE }); this.graphComponent.graph.createNode(new yfiles.geometry.Rect(0, 0, 10, 10), new MyNodeStyle());