/// Auto-generated interfaces from domain: device
///
/// AUTO-GENERATED by: scripts/generate_browser_wit.py
/// DO NOT EDIT MANUALLY — changes will be overwritten.
///
/// Source: wit/generated/device.wit
/// Regenerate with: just wit-gen
interface navigator {
/// Opaque handle to a host-side `Navigator` instance.
type navigator-handle = u64;
/// `getBattery()` operation.
get-battery: func() -> u64;
/// `clipboard` attribute — getter.
get-clipboard: func() -> u64;
/// `credentials` attribute — getter.
get-credentials: func() -> u64;
/// `getGamepads()` operation.
get-gamepads: func() -> list<option<u64>>;
/// `geolocation` attribute — getter.
get-geolocation: func() -> u64;
/// `userActivation` attribute — getter.
get-user-activation: func() -> u64;
/// `mediaCapabilities` attribute — getter.
get-media-capabilities: func() -> u64;
/// `mediaDevices` attribute — getter.
get-media-devices: func() -> u64;
/// `mediaSession` attribute — getter.
get-media-session: func() -> u64;
/// `permissions` attribute — getter.
get-permissions: func() -> u64;
/// `maxTouchPoints` attribute — getter.
get-max-touch-points: func() -> s32;
/// `serviceWorker` attribute — getter.
get-service-worker: func() -> u64;
/// `vibrate()` operation.
vibrate: func(pattern: u64) -> bool;
}
interface battery-manager {
/// Opaque handle to a host-side `BatteryManager` instance.
type battery-manager-handle = u64;
/// `charging` attribute — getter.
get-charging: func(self: battery-manager-handle) -> bool;
/// `chargingTime` attribute — getter.
get-charging-time: func(self: battery-manager-handle) -> f64;
/// `dischargingTime` attribute — getter.
get-discharging-time: func(self: battery-manager-handle) -> f64;
/// `level` attribute — getter.
get-level: func(self: battery-manager-handle) -> f64;
/// `onchargingchange` attribute — getter.
get-onchargingchange: func(self: battery-manager-handle) -> u64;
/// `onchargingchange` attribute — setter.
set-onchargingchange: func(self: battery-manager-handle, value: u64);
/// `onchargingtimechange` attribute — getter.
get-onchargingtimechange: func(self: battery-manager-handle) -> u64;
/// `onchargingtimechange` attribute — setter.
set-onchargingtimechange: func(self: battery-manager-handle, value: u64);
/// `ondischargingtimechange` attribute — getter.
get-ondischargingtimechange: func(self: battery-manager-handle) -> u64;
/// `ondischargingtimechange` attribute — setter.
set-ondischargingtimechange: func(self: battery-manager-handle, value: u64);
/// `onlevelchange` attribute — getter.
get-onlevelchange: func(self: battery-manager-handle) -> u64;
/// `onlevelchange` attribute — setter.
set-onlevelchange: func(self: battery-manager-handle, value: u64);
}
interface gamepad {
/// Opaque handle to a host-side `Gamepad` instance.
type gamepad-handle = u64;
/// `id` attribute — getter.
get-id: func(self: gamepad-handle) -> string;
/// `index` attribute — getter.
get-index: func(self: gamepad-handle) -> s32;
/// `connected` attribute — getter.
get-connected: func(self: gamepad-handle) -> bool;
/// `timestamp` attribute — getter.
get-timestamp: func(self: gamepad-handle) -> f64;
/// `mapping` attribute — getter.
get-mapping: func(self: gamepad-handle) -> u64;
/// `axes` attribute — getter.
get-axes: func(self: gamepad-handle) -> list<f64>;
/// `buttons` attribute — getter.
get-buttons: func(self: gamepad-handle) -> list<u64>;
/// `touches` attribute — getter.
get-touches: func(self: gamepad-handle) -> list<u64>;
/// `vibrationActuator` attribute — getter.
get-vibration-actuator: func(self: gamepad-handle) -> u64;
}
interface gamepad-button {
/// Opaque handle to a host-side `GamepadButton` instance.
type gamepad-button-handle = u64;
/// `pressed` attribute — getter.
get-pressed: func(self: gamepad-button-handle) -> bool;
/// `touched` attribute — getter.
get-touched: func(self: gamepad-button-handle) -> bool;
/// `value` attribute — getter.
get-value: func(self: gamepad-button-handle) -> f64;
}
interface gamepad-haptic-actuator {
/// Opaque handle to a host-side `GamepadHapticActuator` instance.
type gamepad-haptic-actuator-handle = u64;
/// `effects` attribute — getter.
get-effects: func(self: gamepad-haptic-actuator-handle) -> list<u64>;
/// `playEffect()` operation.
play-effect: func(self: gamepad-haptic-actuator-handle, %type: u64, params: option<u64>) -> u64;
/// `reset()` operation.
reset: func(self: gamepad-haptic-actuator-handle) -> u64;
}
interface gamepad-event {
/// Opaque handle to a host-side `GamepadEvent` instance.
type gamepad-event-handle = u64;
/// `gamepad` attribute — getter.
get-gamepad: func(self: gamepad-event-handle) -> u64;
}
interface window-event-handlers {
/// Opaque handle to a host-side `WindowEventHandlers` instance.
type window-event-handlers-handle = u64;
/// `ongamepadconnected` attribute — getter.
get-ongamepadconnected: func(self: window-event-handlers-handle) -> u64;
/// `ongamepadconnected` attribute — setter.
set-ongamepadconnected: func(self: window-event-handlers-handle, value: u64);
/// `ongamepaddisconnected` attribute — getter.
get-ongamepaddisconnected: func(self: window-event-handlers-handle) -> u64;
/// `ongamepaddisconnected` attribute — setter.
set-ongamepaddisconnected: func(self: window-event-handlers-handle, value: u64);
/// `onafterprint` attribute — getter.
get-onafterprint: func(self: window-event-handlers-handle) -> u64;
/// `onafterprint` attribute — setter.
set-onafterprint: func(self: window-event-handlers-handle, value: u64);
/// `onbeforeprint` attribute — getter.
get-onbeforeprint: func(self: window-event-handlers-handle) -> u64;
/// `onbeforeprint` attribute — setter.
set-onbeforeprint: func(self: window-event-handlers-handle, value: u64);
/// `onbeforeunload` attribute — getter.
get-onbeforeunload: func(self: window-event-handlers-handle) -> u64;
/// `onbeforeunload` attribute — setter.
set-onbeforeunload: func(self: window-event-handlers-handle, value: u64);
/// `onhashchange` attribute — getter.
get-onhashchange: func(self: window-event-handlers-handle) -> u64;
/// `onhashchange` attribute — setter.
set-onhashchange: func(self: window-event-handlers-handle, value: u64);
/// `onlanguagechange` attribute — getter.
get-onlanguagechange: func(self: window-event-handlers-handle) -> u64;
/// `onlanguagechange` attribute — setter.
set-onlanguagechange: func(self: window-event-handlers-handle, value: u64);
/// `onmessage` attribute — getter.
get-onmessage: func(self: window-event-handlers-handle) -> u64;
/// `onmessage` attribute — setter.
set-onmessage: func(self: window-event-handlers-handle, value: u64);
/// `onmessageerror` attribute — getter.
get-onmessageerror: func(self: window-event-handlers-handle) -> u64;
/// `onmessageerror` attribute — setter.
set-onmessageerror: func(self: window-event-handlers-handle, value: u64);
/// `onoffline` attribute — getter.
get-onoffline: func(self: window-event-handlers-handle) -> u64;
/// `onoffline` attribute — setter.
set-onoffline: func(self: window-event-handlers-handle, value: u64);
/// `ononline` attribute — getter.
get-ononline: func(self: window-event-handlers-handle) -> u64;
/// `ononline` attribute — setter.
set-ononline: func(self: window-event-handlers-handle, value: u64);
/// `onpagehide` attribute — getter.
get-onpagehide: func(self: window-event-handlers-handle) -> u64;
/// `onpagehide` attribute — setter.
set-onpagehide: func(self: window-event-handlers-handle, value: u64);
/// `onpagereveal` attribute — getter.
get-onpagereveal: func(self: window-event-handlers-handle) -> u64;
/// `onpagereveal` attribute — setter.
set-onpagereveal: func(self: window-event-handlers-handle, value: u64);
/// `onpageshow` attribute — getter.
get-onpageshow: func(self: window-event-handlers-handle) -> u64;
/// `onpageshow` attribute — setter.
set-onpageshow: func(self: window-event-handlers-handle, value: u64);
/// `onpageswap` attribute — getter.
get-onpageswap: func(self: window-event-handlers-handle) -> u64;
/// `onpageswap` attribute — setter.
set-onpageswap: func(self: window-event-handlers-handle, value: u64);
/// `onpopstate` attribute — getter.
get-onpopstate: func(self: window-event-handlers-handle) -> u64;
/// `onpopstate` attribute — setter.
set-onpopstate: func(self: window-event-handlers-handle, value: u64);
/// `onrejectionhandled` attribute — getter.
get-onrejectionhandled: func(self: window-event-handlers-handle) -> u64;
/// `onrejectionhandled` attribute — setter.
set-onrejectionhandled: func(self: window-event-handlers-handle, value: u64);
/// `onstorage` attribute — getter.
get-onstorage: func(self: window-event-handlers-handle) -> u64;
/// `onstorage` attribute — setter.
set-onstorage: func(self: window-event-handlers-handle, value: u64);
/// `onunhandledrejection` attribute — getter.
get-onunhandledrejection: func(self: window-event-handlers-handle) -> u64;
/// `onunhandledrejection` attribute — setter.
set-onunhandledrejection: func(self: window-event-handlers-handle, value: u64);
/// `onunload` attribute — getter.
get-onunload: func(self: window-event-handlers-handle) -> u64;
/// `onunload` attribute — setter.
set-onunload: func(self: window-event-handlers-handle, value: u64);
}
interface geolocation {
/// Opaque handle to a host-side `Geolocation` instance.
type geolocation-handle = u64;
/// `getCurrentPosition()` operation.
get-current-position: func(self: geolocation-handle, success-callback: u64, error-callback: option<u64>, options: option<u64>);
/// `watchPosition()` operation.
watch-position: func(self: geolocation-handle, success-callback: u64, error-callback: option<u64>, options: option<u64>) -> s32;
/// `clearWatch()` operation.
clear-watch: func(self: geolocation-handle, watch-id: s32);
}
interface geolocation-position {
/// Opaque handle to a host-side `GeolocationPosition` instance.
type geolocation-position-handle = u64;
/// `coords` attribute — getter.
get-coords: func(self: geolocation-position-handle) -> u64;
/// `timestamp` attribute — getter.
get-timestamp: func(self: geolocation-position-handle) -> u64;
/// `toJSON()` operation.
to-json: func(self: geolocation-position-handle) -> u64;
}
interface geolocation-coordinates {
/// Opaque handle to a host-side `GeolocationCoordinates` instance.
type geolocation-coordinates-handle = u64;
/// `accuracy` attribute — getter.
get-accuracy: func(self: geolocation-coordinates-handle) -> f64;
/// `latitude` attribute — getter.
get-latitude: func(self: geolocation-coordinates-handle) -> f64;
/// `longitude` attribute — getter.
get-longitude: func(self: geolocation-coordinates-handle) -> f64;
/// `altitude` attribute — getter.
get-altitude: func(self: geolocation-coordinates-handle) -> option<f64>;
/// `altitudeAccuracy` attribute — getter.
get-altitude-accuracy: func(self: geolocation-coordinates-handle) -> option<f64>;
/// `heading` attribute — getter.
get-heading: func(self: geolocation-coordinates-handle) -> option<f64>;
/// `speed` attribute — getter.
get-speed: func(self: geolocation-coordinates-handle) -> option<f64>;
/// `toJSON()` operation.
to-json: func(self: geolocation-coordinates-handle) -> u64;
}
interface geolocation-position-error {
/// Opaque handle to a host-side `GeolocationPositionError` instance.
type geolocation-position-error-handle = u64;
/// `code` attribute — getter.
get-code: func(self: geolocation-position-error-handle) -> u16;
/// `message` attribute — getter.
get-message: func(self: geolocation-position-error-handle) -> string;
}
interface screen-orientation {
/// Opaque handle to a host-side `ScreenOrientation` instance.
type screen-orientation-handle = u64;
/// `lock()` operation.
lock: func(self: screen-orientation-handle, orientation: u64) -> u64;
/// `unlock()` operation.
unlock: func(self: screen-orientation-handle);
/// `type` attribute — getter.
get-type: func(self: screen-orientation-handle) -> u64;
/// `angle` attribute — getter.
get-angle: func(self: screen-orientation-handle) -> u16;
/// `onchange` attribute — getter.
get-onchange: func(self: screen-orientation-handle) -> u64;
/// `onchange` attribute — setter.
set-onchange: func(self: screen-orientation-handle, value: u64);
}