Skip to content

Commit

Permalink
fix(types): export CommonQueryMethodsType (#224)
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 31, 2020
1 parent 849453b commit 9b16320
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
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
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
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 9b16320

Please sign in to comment.