Skip to content

Commit

Permalink
dynamo: Improve exporting Query
Browse files Browse the repository at this point in the history
* dynamo: Replace default export of Query.ts with named export

* dynamo: Export Query in index
  • Loading branch information
luaneyed authored Mar 17, 2020
1 parent 82c4865 commit 463b40f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/dynamo/lib/BaseModel.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Query from './Query';
import { Query } from './Query';
export declare class BaseModel {
static dynogelsModel: any;
static setSchema(name: any, schema: any): void;
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamo/lib/Query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface RawQueryResult {
Count: number;
Items?: any[];
}
interface Query {
export interface Query {
usingIndex(index: IndexType): Query;
descending(): Query;
ascending(): Query;
Expand Down Expand Up @@ -37,4 +37,4 @@ interface Query {
expressionAttributeNames(params: any): Query;
execAsync(): Promise<RawQueryResult>;
}
export default Query;
export {};
1 change: 1 addition & 0 deletions packages/dynamo/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export * from './BaseModel';
export * from './ResultMapper';
export * from './Decorators';
export * from './Dynogels';
export * from './Query';
export * from './Types';
2 changes: 1 addition & 1 deletion packages/dynamo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/dynamo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@croquiscom/crary-dynamo",
"version": "0.1.0",
"version": "0.2.0",
"description": "Croquis's library - DynamoDB ORM",
"main": "./lib",
"types": "./lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/dynamo/src/BaseModel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as _ from 'lodash';
import * as Dynogels from './Dynogels';
import Query from './Query';
import { Query } from './Query';
import { ResultMapper } from './ResultMapper';

export class BaseModel {
Expand Down
6 changes: 2 additions & 4 deletions packages/dynamo/src/Query.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { IndexType, QueryResult, ValueTypes } from './Types';
import { IndexType, ValueTypes } from './Types';

interface RawQueryResult {
LastEvaluatedKey?: ValueTypes;
Count: number;
Items?: any[];
}

interface Query {
export interface Query {
usingIndex(index: IndexType): Query;
descending(): Query;
ascending(): Query;
Expand Down Expand Up @@ -45,5 +45,3 @@ interface Query {
expressionAttributeNames(params: any): Query;
execAsync(): Promise<RawQueryResult>;
}

export default Query;
1 change: 1 addition & 0 deletions packages/dynamo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export * from './ResultMapper';

export * from './Decorators';
export * from './Dynogels';
export * from './Query';
export * from './Types';

0 comments on commit 463b40f

Please sign in to comment.