From d39051f4a56bbd4b2b48500f08198efddef5b94d Mon Sep 17 00:00:00 2001 From: Sam Adams <107990625+sam-super@users.noreply.github.com> Date: Tue, 27 Sep 2022 22:25:12 +0100 Subject: [PATCH] fix: add missing type for 'expirationChecker' on PgConnectionConfig (#5334) Co-authored-by: Igor Savin --- test-tsd/pg-config.test-d.ts | 28 ++++++++++++++++++++++++++++ types/index.d.ts | 1 + 2 files changed, 29 insertions(+) create mode 100644 test-tsd/pg-config.test-d.ts diff --git a/test-tsd/pg-config.test-d.ts b/test-tsd/pg-config.test-d.ts new file mode 100644 index 0000000000..7f6a26f442 --- /dev/null +++ b/test-tsd/pg-config.test-d.ts @@ -0,0 +1,28 @@ +import { expectAssignable } from 'tsd'; + +import {Knex} from '../types'; +import * as stream from "stream"; + +expectAssignable({ + user: '', + database: '', + password: '', + port: 1, + host: '', + connectionString: '', + keepAlive: true, + stream: new stream.Duplex(), + statement_timeout: false, + parseInputDatesAsUTC: false, + ssl: true, + query_timeout: 2, + keepAliveInitialDelayMillis: 3, + idle_in_transaction_session_timeout: 4, + application_name: '', + connectionTimeoutMillis: 5, + types: { + getTypeParser: () => {}, + }, + options: '', + expirationChecker: () => {return true;}, +}); diff --git a/types/index.d.ts b/types/index.d.ts index a0e308f499..70f93ee87e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -3025,6 +3025,7 @@ export declare namespace Knex { connectionTimeoutMillis?: number; types?: PgCustomTypesConfig; options?: string; + expirationChecker?(): boolean; } type PgGetTypeParser = (oid: number, format: string) => any;