Skip to content

Commit

Permalink
fix(types): export CommonQueryMethodsType
Browse files Browse the repository at this point in the history
This was exported in the separate type declarations, and it's a useful helper.
  • Loading branch information
mmkal committed Oct 30, 2020
1 parent 46e4b8f commit 0f1af1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type {
BinarySqlTokenType,
ClientConfigurationInputType,
ClientConfigurationType,
CommonQueryMethodsType,
ConnectionTypeType,
DatabaseConnectionType,
DatabasePoolConnectionType,
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export type QueryCopyFromBinaryFunctionType = (
columnTypes: ReadonlyArray<TypeNameIdentifierType>,
) => Promise<null | object>; // bindPoolConnection returns an object

type CommonQueryMethodsType = {
export type CommonQueryMethodsType = {
readonly any: QueryAnyFunctionType;
readonly anyFirst: QueryAnyFirstFunctionType;
readonly exists: QueryExistsFunctionType;
Expand Down
5 changes: 5 additions & 0 deletions test/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,8 @@ const samplesFromDocs = async () => {

// end samples from readme
};

const exportedTypes = () => {
// make sure CommonQueryMethodsType is exported by package
expectTypeOf<import('../src').CommonQueryMethodsType>().toHaveProperty('any').toBeCallableWith(sql`select 1`);
};

0 comments on commit 0f1af1f

Please sign in to comment.