UNPKG

@itwin/measure-tools-react

Version:
43 lines 2.73 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, 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, fallbackQuantityType: 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 formatSlope(slopeInPercent: number, withSlopeRatio: boolean): string; function formatStation(station: number, stationSpec?: FormatterSpec): Promise<string>; function formatLength(length: number, lengthSpec?: FormatterSpec): Promise<string>; function formatAngle(angle: number, angleSpec?: FormatterSpec): Promise<string>; function formatArea(area: number, areaSpec?: FormatterSpec): Promise<string>; /** * @returns The bearing in radians, where 0 is North and π/2 is East. */ function calculateBearing(dx: number, dy: number): number; /** * 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