Attempts to fix remaining errors.

```
knex/knex-tests.ts(502,9): error TS2345: Argument of type '(names: string) => void' is not assignable to parameter of type '(value: string[]) => void | PromiseLike<void>'.
  Types of parameters 'names' and 'value' are incompatible.
    Type 'string' is not assignable to type 'string[]'.
knex/knex-tests.ts(522,4): error TS2339: Property 'bind' does not exist on type 'QueryBuilder'.
knex/knex-tests.ts(533,35): error TS2339: Property 'return' does not exist on type 'QueryBuilder'.
```

https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/119593429
This commit is contained in:
Ryan Smith
2016-03-30 18:29:30 +01:00
parent ff6d2d2b90
commit 84ae09b624

View File

@@ -499,7 +499,7 @@ knex.select('name').from('users').limit(10).then(function (rows: any[]): string[
return rows.map(function (row: any): string {
return row.name;
});
}).then(function(names: string) {
}).then(function(names: string[]) {
console.log(names);
}).catch(function(e: Error) {
console.error(e);
@@ -519,19 +519,16 @@ knex.select('name').from('users').limit(10).then(function (rows: any[]) {
knex.select('name').from('users')
.limit(10)
.bind(console)
.then(console.log)
.catch(console.error);
.then(console.log.bind(console))
.catch(console.error.bind(console));
var values: any[];
// Without return:
knex.insert(values).into('users')
.then(function() {
return {inserted: true};
});
knex.insert(values).into('users').return({inserted: true});
knex.select('name').from('users')
.where('id', '>', 20)
.andWhere('id', '<', 200)