Skip to content

Commit

Permalink
fix(screen-orientation): Add OrientationLockType (#1914)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Giralté <[email protected]>
Co-authored-by: jcesarmobile <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2024
1 parent 60e0267 commit bc61f5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
15 changes: 12 additions & 3 deletions screen-orientation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ By default, an iPad allows Multitasking and its orientation cannot be locked. If
* [`addListener('screenOrientationChange', ...)`](#addlistenerscreenorientationchange)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

Expand Down Expand Up @@ -135,9 +136,9 @@ Removes all listeners.

#### OrientationLockOptions

| Prop | Type |
| ----------------- | -------------------------------- |
| **`orientation`** | <code>OrientationLockType</code> |
| Prop | Type | Description |
| ----------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **`orientation`** | <code><a href="#orientationlocktype">OrientationLockType</a></code> | Note: Typescript v5.2+ users should import <a href="#orientationlocktype">OrientationLockType</a> from @capacitor/screen-orientation. |


#### PluginListenerHandle
Expand All @@ -146,4 +147,12 @@ Removes all listeners.
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |


### Type Aliases


#### OrientationLockType

<code>'any' | 'natural' | 'landscape' | 'portrait' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary'</code>

</docgen-api>
13 changes: 13 additions & 0 deletions screen-orientation/src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import type { PluginListenerHandle } from '@capacitor/core';

export interface OrientationLockOptions {
/**
* Note: Typescript v5.2+ users should import OrientationLockType from @capacitor/screen-orientation.
*/
orientation: OrientationLockType;
}

export type OrientationLockType =
| 'any'
| 'natural'
| 'landscape'
| 'portrait'
| 'portrait-primary'
| 'portrait-secondary'
| 'landscape-primary'
| 'landscape-secondary';

export interface ScreenOrientationResult {
type: OrientationType;
}
Expand Down

0 comments on commit bc61f5c

Please sign in to comment.