forked from wonday/react-native-orientation-locker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
32 lines (30 loc) · 1.57 KB
/
index.d.ts
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
/**
* Copyright (c) 2017-present, Wonday (@wonday.org)
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
export type OrientationType = "PORTRAIT" | "PORTRAIT-UPSIDEDOWN" | "LANDSCAPE-LEFT" | "LANDSCAPE-RIGHT" | "FACE-UP" | "FACE-DOWN" | "UNKNOWN";
declare class Orientation {
static addOrientationListener(callback: (orientation: OrientationType) => void): void;
static removeOrientationListener(callback: (orientation: OrientationType) => void): void;
static addDeviceOrientationListener(callback: (deviceOrientation: OrientationType) => void): void;
static removeDeviceOrientationListener(callback: (deviceOrientation: OrientationType) => void): void;
static addLockListener(callback: (orientation: OrientationType) => void): void;
static removeLockListener(callback: (orientation: OrientationType) => void): void;
static removeAllListeners(): void;
static getInitialOrientation(): OrientationType;
static isLocked(): boolean;
static lockToPortrait(): void;
static lockToLandscape(): void;
static lockToLandscapeLeft(): void;
static lockToAllOrientationsButUpsideDown(): void;
static lockToLandscapeRight(): void;
static lockToPortraitUpsideDown(): void;
static unlockAllOrientations(): void;
static getOrientation(callback: (orientation: OrientationType) => void): void;
static getDeviceOrientation(callback: (orientation: OrientationType) => void): void;
static getAutoRotateState(callback: (state: boolean) => void): void;
}
export default Orientation;