@nw01/screen-orientation
v0.0.1
Published
Work with the screen orientation in a common way for Android, and web
Readme
@capacitor-community/screen-orientation
Work with the screen orientation in a common way for Android, and web
Install
npm install @capacitor-community/screen-orientation
npx cap syncAPI
orientation()lock(...)unlock()addListener('screenOrientationChange', ...)removeAllListeners()- Interfaces
- Type Aliases
orientation()
orientation() => Promise<ScreenOrientationResult>Returns: Promise<ScreenOrientationResult>
lock(...)
lock(options: OrientationLockOptions) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| options | OrientationLockOptions |
unlock()
unlock() => Promise<void>addListener('screenOrientationChange', ...)
addListener(eventName: "screenOrientationChange", listenerFunc: (orientation: ScreenOrientationResult) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------------------------- |
| eventName | 'screenOrientationChange' |
| listenerFunc | (orientation: ScreenOrientationResult) => void |
Returns: Promise<PluginListenerHandle>
removeAllListeners()
removeAllListeners() => Promise<void>Interfaces
ScreenOrientationResult
| Prop | Type |
| ---------- | ---------------------------- |
| type | OrientationType |
OrientationLockOptions
| Prop | Type | Description |
| ----------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| orientation | OrientationLockType | Note: Typescript v5.2+ users should import OrientationLockType from @capacitor/screen-orientation. |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
Type Aliases
OrientationLockType
"any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"
