import { AsyncIOResult } from 'happy-rusty';

/**
 * geo 坐标。
 * @since 1.7.0
 * @example
 * ```ts
 * import { lbs, type GeoPosition } from 'minigame-std';
 *
 * const result = await lbs.getCurrentPosition();
 * if (result.isOk()) {
 *     const pos: GeoPosition = result.unwrap();
 *     console.log('纬度:', pos.latitude, '经度:', pos.longitude);
 * }
 * ```
 */
interface GeoPosition {
    /**
     * 纬度。
     */
    latitude: number;
    /**
     * 经度。
     */
    longitude: number;
}

/**
 * 位置服务模块（Location Based Service），提供获取地理位置坐标的功能。
 * @module lbs
 */

/**
 * 获取当前 geo 坐标。
 * @returns 当前经纬度。
 * @since 1.7.0
 * @example
 * ```ts
 * const result = await getCurrentPosition();
 * if (result.isOk()) {
 *     const pos = result.unwrap();
 *     console.log('纬度:', pos.latitude);
 *     console.log('经度:', pos.longitude);
 * } else {
 *     console.error('获取位置失败:', result.unwrapErr());
 * }
 * ```
 */
declare function getCurrentPosition(): AsyncIOResult<GeoPosition>;

export { getCurrentPosition };
export type { GeoPosition };
