Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/semantic-release-12.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush Gupta committed Jan 17, 2018
2 parents 5880d2e + 28295f7 commit f492d92
Show file tree
Hide file tree
Showing 14 changed files with 429 additions and 373 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"scripts": {
"lint": "tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"prebuild": "rimraf dist",
"build": "tsc && tsc --module commonjs --outDir dist/lib && rollup -c rollup.config.ts && typedoc --out dist/docs --target es6 --excludePrivate --excludeExternals --includeDeclarations --theme minimal --mode file src --module umd",
"build": "tsc && tsc --module commonjs --outDir dist/lib && rollup -c rollup.config.ts && typedoc --out dist/docs --target es6 src --mode modules --exclude \"**/main/*.ts\" --excludeExternals --module commonjs",
"start": "tsc -w & rollup -c rollup.config.ts -w",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions src/@interfaces/aggregator-interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { AggregatorMode, Operation } from '../@enums/enum'

export interface IAggregatorModeInput {
mode: AggregatorMode
}
export interface IAggregatorArrayModeInput extends IAggregatorModeInput {
attrs: string[]
aggr: Operation[]
}

export interface IAggregatorMapModeInput extends IAggregatorModeInput {
attrToAggrMap: Map<string, Operation[]>
}
17 changes: 17 additions & 0 deletions src/@interfaces/data-worker-interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { IAggregateInterface, IExecute, IGroupInterface } from '../@types/types'

export interface IDataWorkerBase {
result: any[]
misc?: any
}

export interface IDataWorker {
group: IGroupInterface
aggregate: IAggregateInterface
execute: IExecute
}

export interface IFunctionWithArgs {
func: any
args: any[]
}
15 changes: 15 additions & 0 deletions src/@interfaces/group-interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { GroupingMode } from '../@enums/enum'
import { IAttrSortingMode } from './sorting-interface'

export interface IGroupBase {
flat: boolean
mode: GroupingMode.GROUP_SORT | GroupingMode.ONLY_GROUP
}

export interface IGroupOnlyMode extends IGroupBase {
groupOn: string[]
}

export interface IGroupSortingMode extends IGroupBase {
groupingOptions: IAttrSortingMode[]
}
6 changes: 6 additions & 0 deletions src/@interfaces/sorting-interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { SortingMode } from '../@enums/enum'

export interface IAttrSortingMode {
attribute: string
sortMode: SortingMode
}
21 changes: 21 additions & 0 deletions src/@types/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {
IAggregatorArrayModeInput,
IAggregatorMapModeInput
} from '../@interfaces/aggregator-interface'
import { IDataWorker, IDataWorkerBase } from '../@interfaces/data-worker-interface'
import { IGroupOnlyMode, IGroupSortingMode } from '../@interfaces/group-interface'

export type IGroupInterface = (options: IGroupOnlyMode | IGroupSortingMode) => IDataWorker
export type IAggregateInterface = (
aggregatorOptions: IAggregatorArrayModeInput | IAggregatorMapModeInput
) => IDataWorker
export type IExecute = (inputData: any[]) => any[]

export type IGroupInnerInterface = (
_this: IDataWorkerBase,
options: IGroupOnlyMode | IGroupSortingMode
) => IDataWorkerBase
export type IAggregateInnerInterface = (
_this: IDataWorkerBase,
aggregatorOptions: IAggregatorArrayModeInput | IAggregatorMapModeInput
) => IDataWorkerBase
Loading

0 comments on commit f492d92

Please sign in to comment.