1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
use core::ffi::{c_char, c_void};
pub type AsyncCb =
unsafe extern "C" fn(*const c_void, *const c_char, *mut c_void);
extern "C" {
/// `WeatherService.weather(for:)` async → `WKBox<Weather>`
pub fn wk_weather_service_weather_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .current)` async → `WKBox<CurrentWeather>`
pub fn wk_weather_service_current_weather_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .hourly)` async → `WKBox<Forecast<HourWeather>>`
///
/// Pass `has_range = 1` and valid `start_seconds`/`end_seconds` for a date-ranged query.
pub fn wk_weather_service_hourly_forecast_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
has_range: i32,
start_seconds: f64,
end_seconds: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .daily)` async → `WKBox<Forecast<DayWeather>>`
///
/// Pass `has_range = 1` and valid `start_seconds`/`end_seconds` for a date-ranged query.
pub fn wk_weather_service_daily_forecast_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
has_range: i32,
start_seconds: f64,
end_seconds: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .minute)` async → `WKBox<Forecast<MinuteWeather>?>`
pub fn wk_weather_service_minute_forecast_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .alerts)` async → `WKBox<[WeatherAlert]>`
pub fn wk_weather_service_weather_alerts_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .availability)` async → `WKBox<WeatherAvailability>`
pub fn wk_weather_service_availability_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.attribution` async → `WKBox<WeatherAttribution>`
pub fn wk_weather_service_attribution_async(
handle: *mut c_void,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .changes)` async → `WKBox<String>` (JSON)
///
/// Uses `wk_json_handle_copy_json` / `wk_json_handle_release`. macOS 15.0+ only.
pub fn wk_weather_service_weather_changes_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
/// `WeatherService.weather(for: including: .historicalComparisons)` async → `WKBox<String>` (JSON)
///
/// Uses `wk_json_handle_copy_json` / `wk_json_handle_release`. macOS 15.0+ only.
pub fn wk_weather_service_historical_comparisons_async(
handle: *mut c_void,
latitude: f64,
longitude: f64,
cb: AsyncCb,
ctx: *mut c_void,
);
}