From 9b16320b12a4f71be29877e0f67e44186026f86b Mon Sep 17 00:00:00 2001 From: Misha Kaletsky <15040698+mmkal@users.noreply.github.com> Date: Fri, 30 Oct 2020 22:33:59 -0400 Subject: [PATCH] fix(types): export CommonQueryMethodsType (#224) This was exported in the separate type declarations, and it's a useful helper. --- src/index.ts | 1 + src/types.ts | 2 +- test/dts.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6970731a..3fecf684 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,6 +9,7 @@ export type { BinarySqlTokenType, ClientConfigurationInputType, ClientConfigurationType, + CommonQueryMethodsType, ConnectionTypeType, DatabaseConnectionType, DatabasePoolConnectionType, diff --git a/src/types.ts b/src/types.ts index f656dfc8..d23e2caa 100644 --- a/src/types.ts +++ b/src/types.ts @@ -132,7 +132,7 @@ export type QueryCopyFromBinaryFunctionType = ( columnTypes: ReadonlyArray, ) => Promise; // bindPoolConnection returns an object -type CommonQueryMethodsType = { +export type CommonQueryMethodsType = { readonly any: QueryAnyFunctionType; readonly anyFirst: QueryAnyFirstFunctionType; readonly exists: QueryExistsFunctionType; diff --git a/test/dts.ts b/test/dts.ts index b00d4bb5..1ea02847 100644 --- a/test/dts.ts +++ b/test/dts.ts @@ -408,3 +408,8 @@ const samplesFromDocs = async () => { // end samples from readme }; + +const exportedTypes = () => { + // make sure CommonQueryMethodsType is exported by package + expectTypeOf().toHaveProperty('any').toBeCallableWith(sql`select 1`); +};