More fixes for 2.4. Not all for weak types:

2.4 also has been inference for generics, which finds more errors as
well.
This commit is contained in:
Nathan Shively-Sanders
2017-06-19 13:00:47 -07:00
parent 8aff840533
commit 1119ad2d81
7 changed files with 45 additions and 25 deletions
+4
View File
@@ -1846,6 +1846,10 @@ declare namespace angular {
* different in Angular 1 there is no direct mapping and care should be taken when upgrading.
*/
$postLink?(): void;
// IController implementations frequently do not implement any of its methods.
// A string indexer indicates to TypeScript not to issue a weak type error in this case.
[s: string]: any;
}
/**
+21 -12
View File
@@ -36,13 +36,22 @@ interface FileOptions {
// for each file in a bundle.
type InputFile = string | NodeJS.ReadableStream | FileOptions;
/**
* Core options pertaining to a Browserify instance, extended by user options
*/
interface CustomOptions {
/**
* Custom properties can be defined on Options.
* These options are forwarded along to module-deps and browser-pack directly.
*/
[propName: string]: any;
/** the directory that Browserify starts bundling from for filenames that start with .. */
basedir?: string;
}
/**
* Options pertaining to a Browserify instance.
*/
interface Options {
// Custom properties can be defined on Options.
// These options are forwarded along to module-deps and browser-pack directly.
[propName: string]: any;
interface Options extends CustomOptions {
// String, file object, or array of those types (they may be mixed) specifying entry file(s).
entries?: InputFile | InputFile[];
// an array which will skip all require() and global parsing for each file in the array.
@@ -115,32 +124,32 @@ interface BrowserifyObject extends NodeJS.EventEmitter {
* If file is an array, each item in file will be externalized.
* If file is another bundle, that bundle's contents will be read and excluded from the current bundle as the bundle in file gets bundled.
*/
external(file: string[], opts?: { basedir?: string }): BrowserifyObject;
external(file: string, opts?: { basedir?: string }): BrowserifyObject;
external(file: string[], opts?: CustomOptions): BrowserifyObject;
external(file: string, opts?: CustomOptions): BrowserifyObject;
external(file: BrowserifyObject): BrowserifyObject;
/**
* Prevent the module name or file at file from showing up in the output bundle.
* Instead you will get a file with module.exports = {}.
*/
ignore(file: string, opts?: { basedir?: string }): BrowserifyObject;
ignore(file: string, opts?: CustomOptions): BrowserifyObject;
/**
* Prevent the module name or file at file from showing up in the output bundle.
* If your code tries to require() that file it will throw unless you've provided another mechanism for loading it.
*/
exclude(file: string, opts?: { basedir?: string }): BrowserifyObject;
exclude(file: string, opts?: CustomOptions): BrowserifyObject;
/**
* Transform source code before parsing it for require() calls with the transform function or module name tr.
* If tr is a function, it will be called with tr(file) and it should return a through-stream that takes the raw file contents and produces the transformed source.
* If tr is a string, it should be a module name or file path of a transform module
*/
transform<T extends { basedir?: string }>(tr: string, opts?: T): BrowserifyObject;
transform<T extends { basedir?: string }>(tr: (file: string, opts: T) => NodeJS.ReadWriteStream, opts?: T): BrowserifyObject;
transform<T extends CustomOptions>(tr: string, opts?: T): BrowserifyObject;
transform<T extends CustomOptions>(tr: (file: string, opts: T) => NodeJS.ReadWriteStream, opts?: T): BrowserifyObject;
/**
* Register a plugin with opts. Plugins can be a string module name or a function the same as transforms.
* plugin(b, opts) is called with the Browserify instance b.
*/
plugin<T extends { basedir?: string }>(plugin: string, opts?: T): BrowserifyObject;
plugin<T extends { basedir?: string }>(plugin: (b: BrowserifyObject, opts: T) => any, opts?: T): BrowserifyObject;
plugin<T extends CustomOptions>(plugin: string, opts?: T): BrowserifyObject;
plugin<T extends CustomOptions>(plugin: (b: BrowserifyObject, opts: T) => any, opts?: T): BrowserifyObject;
/**
* Reset the pipeline back to a normal state. This function is called automatically when bundle() is called multiple times.
* This function triggers a 'reset' event.
+18 -1
View File
@@ -7,6 +7,23 @@
declare module "bunyan-config" {
import * as bunyan from "bunyan";
interface StreamConfiguration {
name: string,
params?: {
host: string,
port: number
}
}
interface Stream {
type?: string;
level?: bunyan.LogLevel;
path?: string;
stream?: string | StreamConfiguration
closeOnExit?: boolean;
period?: string;
count?: number;
}
/**
* Configuration.
@@ -14,7 +31,7 @@ declare module "bunyan-config" {
*/
interface Configuration {
name: string;
streams?: bunyan.Stream[];
streams?: Stream[];
level?: string | number;
stream?: NodeJS.WritableStream;
serializers?: {};
-10
View File
@@ -124,15 +124,5 @@ server.route([{
}
}]);
// Implict handler
server.route({
method: 'GET',
path: '/hello6',
handler: function (request, reply) {
request.log('info', { route: '/hello' }, Date.now());
reply('hello world');
}
});
// Start the server
server.start();
+1 -1
View File
@@ -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<IUser>('user');
var user:IUser = User2.inject({id: 1, name: 'John'});
var user2:IUser = User2.inject({id: 1, age: 30});
+1
View File
@@ -3130,6 +3130,7 @@ declare namespace sequelize {
*/
include?: Array<Model<any, any> | IncludeOptions>;
all?: boolean | string;
}
/**
-1
View File
@@ -904,7 +904,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 );