Merge pull request #11888 from MoLow/master

add react-native-orientation-tests
This commit is contained in:
Arthur Ozga
2016-10-14 10:59:10 -07:00
committed by GitHub
3 changed files with 48 additions and 4 deletions
+2 -4
View File
@@ -4,8 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class HowlerGlobal {
mute(): HowlerGlobal;
unmute(): HowlerGlobal;
mute(muted: boolean): HowlerGlobal;
volume(): number;
volume(volume: number): HowlerGlobal;
codecs(extension: string): boolean;
@@ -56,8 +55,7 @@ interface Howl {
play(callback?: (soundId: string) => void): Howl;
pause(soundId?: string): Howl;
stop(soundId?: string): Howl;
mute(soundId?: string): Howl;
unmute(soundId?: string): Howl;
mute(muted?: boolean, soundId?: string): Howl;
fade(from: number, to: number, duration: number, callback?: Function, soundId?: string): Howl;
loop(): boolean;
loop(loop: boolean): Howl;
@@ -0,0 +1,18 @@
/// <reference path="react-native-orientation.d.ts" />
import * as Orientation from 'react-native-orientation';
Orientation.addOrientationListener((orientation)=>{});
Orientation.removeOrientationListener((orientation)=>{});
Orientation.addSpecificOrientationListener((orientation)=>{});
Orientation.removeSpecificOrientationListener((orientation)=>{});
Orientation.getInitialOrientation();
Orientation.lockToPortrait();
Orientation.lockToPortrait();
Orientation.lockToLandscape();
Orientation.lockToLandscapeLeft();
Orientation.lockToLandscapeRight();
Orientation.unlockAllOrientations();
Orientation.getOrientation((err,orientation)=>{});
Orientation.getSpecificOrientation((err,orientation)=>{});
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for react-native-orientation
// Project: https://github.com/yamill/react-native-orientation
// Definitions by: Moshe Atlow <https://github.com/MoLow/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'react-native-orientation' {
namespace Orientation {
type orientation = "LANDSCAPE" | "PORTRAIT" | "UNKNOWN" | "PORTRAITUPSIDEDOWN";
type specificOrientation = "LANDSCAPE-LEFT" | "LANDSCAPE-RIGHT" | "PORTRAIT" | "UNKNOWN" | "PORTRAITUPSIDEDOWN";
export function addOrientationListener(callback: (orientation: orientation) => void): void;
export function removeOrientationListener(callback: (orientation: orientation) => void): void;
export function addSpecificOrientationListener(callback: (specificOrientation: specificOrientation) => void): void;
export function removeSpecificOrientationListener(callback: (specificOrientation: specificOrientation) => void): void;
export function getInitialOrientation(): orientation;
export function lockToPortrait(): void;
export function lockToLandscape(): void;
export function lockToLandscapeLeft(): void;
export function lockToLandscapeRight(): void;
export function unlockAllOrientations(): void;
export function getOrientation(callback: (err: Error, orientation: orientation) => void): void;
export function getSpecificOrientation(callback: (err: Error, orientation: specificOrientation) => void): void;
}
export = Orientation;
}