UNPKG

@itwin/measure-tools-react

Version:
51 lines 3.56 kB
import type { Point3d, XAndY } from "@itwin/core-geometry"; import type { Cartographic } from "@itwin/core-common"; import { QuantityType } from "@itwin/core-frontend"; import type { FormatProps, FormatSpecHandle, FormatterSpec } from "@itwin/core-quantity"; export declare namespace FormatterUtils { /** * Gets a FormatterSpec by KoQ string with fallback to QuantityType. * @param koqString The Kind of Quantity string to look up. * @param fallbackQuantityType The QuantityType to use if KoQ lookup fails. * @returns A FormatterSpec or undefined if both lookups fail. */ function getFormatterSpecWithFallback(koqString: string, persistenceUnitName: string, fallbackQuantityType: QuantityType): FormatterSpec | undefined; /** Returns the handle's formatterSpec, falling back to QuantityType if the handle couldn't resolve its KoQ. */ function getSpecFromHandle(handle: FormatSpecHandle, fallback: QuantityType): FormatterSpec | undefined; function formatCoordinates(point: Point3d): Promise<string>; function formatCoordinatesImmediate(point: Point3d, coordSpec?: FormatterSpec): string; function formatCoordinatesXY(point: XAndY): Promise<string>; function formatCoordinatesXYImmediate(point: XAndY, coordSpec?: FormatterSpec): string; /** Formats the input angle into DD°MM'SS.SS" format. * NOTE: uses the same symbols as the IModelApp's quantityFormatter for minute and second. * The minute symbol is an apostrophe ' while it should be a prime (\u2032) * The second symbol is a quotation mark " while it should be a double prime (\u2033) */ function formatAngleToDMS(angleInDegrees: number): string; function formatCartographicToLatLongDMS(c: Cartographic): string; function formatCartographicToLatLong(c: Cartographic, angleSpec?: FormatterSpec): Promise<string>; function formatCartographicToLatLongImmediate(c: Cartographic, angleSpec?: FormatterSpec): string; function formatSlope(slopeInPercent: number, withSlopeRatio: boolean): string; function formatStation(station: number, stationSpec?: FormatterSpec): Promise<string>; function formatStationImmediate(station: number, stationSpec?: FormatterSpec): string; function formatLength(length: number, lengthSpec?: FormatterSpec): Promise<string>; function formatLengthImmediate(length: number, lengthSpec?: FormatterSpec): string; function formatAngle(angle: number, angleSpec?: FormatterSpec): Promise<string>; function formatAngleImmediate(angle: number, angleSpec?: FormatterSpec): string; function formatArea(area: number, areaSpec?: FormatterSpec): Promise<string>; function formatAreaImmediate(area: number, areaSpec?: FormatterSpec): string; /** * @returns The bearing in radians, where 0 is North and π/2 is East. */ function calculateBearing(dx: number, dy: number): number; function ensureBearingFormatSpecsRegistered(bearingKoQ: string, persistenceUnitName: string): Promise<void>; /** * Creates a FormatterSpec for bearing using the provided KoQ string with fallback to default bearing format. * @param bearingKoQ The Kind of Quantity string for bearing. * @param persistenceUnitName The persistence unit name for the bearing. * @returns A FormatterSpec for bearing formatting. */ function getBearingFormatterSpec(bearingKoQ: string, persistenceUnitName: string): Promise<FormatterSpec | undefined>; function getDefaultBearingFormatProps(): FormatProps; } //# sourceMappingURL=FormatterUtils.d.ts.map