source: trip-planner-front/node_modules/hdr-histogram-js/src/JsHistogramFactory.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 936 bytes
RevLine 
[6a3a178]1import { BitBucketSize } from "./Histogram";
2import PackedHistogram from "./PackedHistogram";
3import Int8Histogram from "./Int8Histogram";
4import Int16Histogram from "./Int16Histogram";
5import Int32Histogram from "./Int32Histogram";
6import Float64Histogram from "./Float64Histogram";
7import JsHistogram from "./JsHistogram";
8
9export interface JsHistogramConstructor {
10 new (
11 lowestDiscernibleValue: number,
12 highestTrackableValue: number,
13 numberOfSignificantValueDigits: number
14 ): JsHistogram;
15}
16
17export function constructorFromBucketSize(
18 bitBucketSize: BitBucketSize
19): JsHistogramConstructor {
20 switch (bitBucketSize) {
21 case "packed":
22 return PackedHistogram;
23 case 8:
24 return Int8Histogram;
25 case 16:
26 return Int16Histogram;
27 case 32:
28 return Int32Histogram;
29 case 64:
30 return Float64Histogram;
31 default:
32 throw new Error("Incorrect parameter bitBucketSize");
33 }
34}
Note: See TracBrowser for help on using the repository browser.