ScreenOrientation

The ScreenOrientation interface of the Screen Orientation API provides information about the current orientation of the document.

MDN Reference

Properties

Link copied to clipboard
external val angle: Short

The angle read-only property of the ScreenOrientation interface returns the document's current orientation angle.

Link copied to clipboard
Link copied to clipboard
external val type: OrientationType

The type read-only property of the ScreenOrientation interface returns the document's current orientation type, one of portrait-primary, portrait-secondary, landscape-primary, or landscape-secondary.

Functions

Link copied to clipboard
open external fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
inline suspend fun ScreenOrientation.lock(orientation: OrientationLockType)

The lock() method of the ScreenOrientation interface locks the orientation of the containing document to the specified orientation.

Link copied to clipboard
external fun lockAsync(orientation: OrientationLockType): Promise<Void>

The lock() method of the ScreenOrientation interface locks the orientation of the containing document to the specified orientation.

Link copied to clipboard
external fun unlock()

The unlock() method of the ScreenOrientation interface unlocks the orientation of the containing document, effectively locking it to the default screen orientation.

Link copied to clipboard
external fun <T : Event> when(type: EventType<T>, options: ObservableEventListenerOptions?): Observable<T>