UNPKG

@patricksurry/g3

Version:

A flexible Javascript framework for building steam gauge instrument panels that display live external metrics from flight (or other) simulators like XPlane or MS FS2020

9 lines (8 loc) • 817 B
export declare const convertUnits: (value?: number) => import("convert-units").Converter<import("convert-units/definitions/all").AllMeasures, import("convert-units/definitions/all").AllMeasuresSystems, import("convert-units/definitions/all").AllMeasuresUnits, number>, knownUnits: import("convert-units/definitions/all").AllMeasuresUnits[]; /** Convert v between units when both are given, reviving string-serialized dates otherwise. */ export declare function maybeConvert(v: any, fromUnit?: string, toUnit?: string): any; /** * Resolve a metric key to the longest dot-separated prefix of itself among the known metrics, * e.g. `fuel.left` resolves to `fuel.left` if known, otherwise `fuel`, otherwise undefined. */ export declare function resolveKey(key: string, known: Record<string, any>): string | undefined;