diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index f98091cb13..eecfde8774 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -5,6 +5,7 @@ // Pablo Rodríguez // Matt R. Wilson // Satana Charuwichitratana +// Shrey Jain // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -524,6 +525,8 @@ declare namespace Knex { MySqlConnectionConfig | MsSqlConnectionConfig | Sqlite3ConnectionConfig | SocketConnectionConfig; pool?: PoolConfig; migrations?: MigratorConfig; + postProcessResponse?: (result: any, queryContext: any) => any; + wrapIdentifier?: (value: string, origImpl: (value: string) => string, queryContext: any) => string; seeds?: SeedsConfig; acquireConnectionTimeout?: number; useNullAsDefault?: boolean; diff --git a/types/knex/knex-tests.ts b/types/knex/knex-tests.ts index c76f0d404f..3e8e798212 100644 --- a/types/knex/knex-tests.ts +++ b/types/knex/knex-tests.ts @@ -126,6 +126,22 @@ var knex = Knex({ searchPath: ['public', 'private'], }); +// postProcessResponse +var knex = Knex({ + client: 'pg', + postProcessResponse: function(result, queryContext){ + return result; + } +}); + +// wrapIdentifier +var knex = Knex({ + client: 'pg', + wrapIdentifier: function(value, origImpl, queryContext){ + return origImpl(value + 'foo'); + } +}); + // useNullAsDefault var knex = Knex({ client: 'sqlite',