/
index.ts
29 lines (27 loc) · 1013 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { AverageAggregator } from "./AverageAggregator";
import { CountAggregator } from "./CountAggregator";
import { MaxAggregator } from "./MaxAggregator";
import { MinAggregator } from "./MinAggregator";
import { SumAggregator } from "./SumAggregator";
import { StaticValueAggregator } from "./StaticValueAggregator";
import { AggregateType } from "../../request/ErrorResponse";
export function createAggregator(aggregateType: AggregateType) {
switch (aggregateType) {
case "Average":
return new AverageAggregator();
case "Count":
return new CountAggregator();
case "Max":
return new MaxAggregator();
case "Min":
return new MinAggregator();
case "Sum":
return new SumAggregator();
default:
return new StaticValueAggregator();
}
}
export { AverageAggregator, CountAggregator, MaxAggregator, MinAggregator, SumAggregator };
export { Aggregator } from "./Aggregator";