@epigraph/epigraph-std-lib 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export declare let ConversionFactors: Record<string, number>;
@@ -0,0 +1,18 @@
1
+ export declare enum UnitTypes {
2
+ RAW = "raw",
3
+ DISTANCE = "distance",
4
+ WEIGHT = "weight"
5
+ }
6
+ export declare enum DistanceUnits {
7
+ millimeter = "mm",
8
+ centimeter = "cm",
9
+ decimeter = "dm",
10
+ meter = "m",
11
+ decameter = "dam",
12
+ hectometer = "hm",
13
+ kilometer = "km",
14
+ inch = "in",
15
+ foot = "ft",
16
+ yard = "yd",
17
+ mile = "mi"
18
+ }
@@ -0,0 +1,30 @@
1
+ import { DistanceUnits, UnitTypes } from "./Enums";
2
+ import { IConvertedUnitResult } from "./Interfaces";
3
+ /**
4
+ * USAGE: Initialise this class with an initial value of the distance with it's unit.
5
+ * Then use the exposed methods to get the value of the initial value in*() various units supported.
6
+ */
7
+ declare class Distance {
8
+ private _type;
9
+ private _rawValue;
10
+ private _rawValueUnit;
11
+ constructor(initialValue: number, initialValueUnit: DistanceUnits);
12
+ get type(): UnitTypes;
13
+ static buildConvertedUnitResult(convertedValue: number, convertedValueUnit: DistanceUnits): IConvertedUnitResult;
14
+ static convert(value: number, fromUnit: DistanceUnits, toUnit: DistanceUnits): IConvertedUnitResult;
15
+ /** ----------------- METRIC UNITS ----------------- */
16
+ get inMillimeters(): IConvertedUnitResult;
17
+ get inCentimeters(): IConvertedUnitResult;
18
+ get inDecimeters(): IConvertedUnitResult;
19
+ get inMeters(): IConvertedUnitResult;
20
+ get inDecameters(): IConvertedUnitResult;
21
+ get inHectometers(): IConvertedUnitResult;
22
+ get inKilometers(): IConvertedUnitResult;
23
+ /** ----------------- METRIC UNITS ----------------- */
24
+ get inInches(): IConvertedUnitResult;
25
+ get inFeet(): IConvertedUnitResult;
26
+ get inYard(): IConvertedUnitResult;
27
+ get inMiles(): IConvertedUnitResult;
28
+ }
29
+ export type { IConvertedUnitResult };
30
+ export { DistanceUnits, UnitTypes, Distance };
@@ -0,0 +1,6 @@
1
+ import { DistanceUnits } from "./Enums";
2
+ export interface IConvertedUnitResult {
3
+ value: number;
4
+ valueUnit: DistanceUnits;
5
+ valueWithUnit: string;
6
+ }
@@ -1,18 +1,22 @@
1
1
  export * from "three";
2
2
  export * as ModelViewer from "@google/model-viewer";
3
3
  export * as MODEL_VIEWER_CONSTANTS from "@google/model-viewer/lib/constants";
4
- export * from "./EpigraphLogger/epigraph-logger";
4
+ export * from "./EpigraphLibs/EpigraphLogger/epigraph-logger";
5
5
  export * from "qr-creator";
6
6
  export * as ThreeWebGLCompatibility from "three/examples/jsm/capabilities/WebGL";
7
+ import * as EpgUnitsConverter from "./EpigraphLibs/EpigraphUnitsConverter/EpigraphUnitsConverter";
7
8
  import { EpigraphAnalytics } from '@epigraph/epigraph-analytics';
8
9
  import { AnalyticsEvent } from '@epigraph/epigraph-analytics';
9
10
  import { GA3AnalyticsPlugin } from '@epigraph/epigraph-analytics';
10
11
  import { GA4AnalyticsPlugin } from '@epigraph/epigraph-analytics';
11
12
  import { ConsentPluginNames } from "@epigraph/epigraph-analytics";
12
13
  import { OneTrustConsentPlugin } from "@epigraph/epigraph-analytics";
14
+ import { NexusAnalyticsPlugin } from "@epigraph/epigraph-analytics";
13
15
  export { EpigraphAnalytics };
14
16
  export type { AnalyticsEvent };
15
17
  export { GA3AnalyticsPlugin };
16
18
  export { GA4AnalyticsPlugin };
17
19
  export { OneTrustConsentPlugin };
20
+ export { NexusAnalyticsPlugin };
18
21
  export { ConsentPluginNames };
22
+ export { EpgUnitsConverter };