Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typings #2960

Merged
merged 5 commits into from Jan 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions types/knex.d.ts
Expand Up @@ -216,7 +216,7 @@ declare namespace Knex {
}

interface Select extends ColumnNameQueryBuilder {
(aliases: { [alias: string]: string }): QueryBuilder;
(aliases: { [alias: string]: string | Knex.Raw }): QueryBuilder;
}

interface Table {
Expand All @@ -233,24 +233,24 @@ declare namespace Knex {

interface Join {
(raw: Raw): QueryBuilder;
(tableName: TableName | QueryCallback, clause: JoinCallback): QueryBuilder;
(tableName: TableName | Identifier | QueryCallback, clause: JoinCallback): QueryBuilder;
(
tableName: TableName | QueryCallback,
tableName: TableName | Identifier | QueryCallback,
columns: { [key: string]: string | number | Raw }
): QueryBuilder;
(tableName: TableName | QueryCallback, raw: Raw): QueryBuilder;
(tableName: TableName | Identifier | QueryCallback, raw: Raw): QueryBuilder;
(
tableName: TableName | QueryCallback,
tableName: TableName | Identifier | QueryCallback,
column1: string,
column2: string
): QueryBuilder;
(
tableName: TableName | QueryCallback,
tableName: TableName | Identifier | QueryCallback,
column1: string,
raw: Raw
): QueryBuilder;
(
tableName: TableName | QueryCallback,
tableName: TableName | Identifier | QueryCallback,
column1: string,
operator: string,
column2: string
Expand Down Expand Up @@ -307,13 +307,13 @@ declare namespace Knex {
}

interface JoinRaw {
(tableName: string, binding?: Value): QueryBuilder;
(tableName: string, binding?: Value | ValueMap): QueryBuilder;
}

interface With extends WithRaw, WithWrapped {}

interface WithRaw {
(alias: string, raw: Raw): QueryBuilder;
(alias: string, raw: Raw | QueryBuilder): QueryBuilder;
(alias: string, sql: string, bindings?: Value[] | Object): QueryBuilder;
}

Expand Down Expand Up @@ -432,6 +432,7 @@ declare namespace Knex {

interface Raw extends events.EventEmitter, ChainableInterface {
wrap(before: string, after: string): Raw;
toSQL(): Sql;
}

interface RawBuilder {
Expand Down