diff --git a/howlerjs/howler.d.ts b/howlerjs/howler.d.ts index 9e245a8058..cdb95ce44f 100644 --- a/howlerjs/howler.d.ts +++ b/howlerjs/howler.d.ts @@ -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; diff --git a/react-native-orientation/react-native-orientation-tests.ts b/react-native-orientation/react-native-orientation-tests.ts new file mode 100644 index 0000000000..23e3c468c4 --- /dev/null +++ b/react-native-orientation/react-native-orientation-tests.ts @@ -0,0 +1,18 @@ +/// + +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)=>{}); diff --git a/react-native-orientation/react-native-orientation.d.ts b/react-native-orientation/react-native-orientation.d.ts new file mode 100644 index 0000000000..1ee7d6f929 --- /dev/null +++ b/react-native-orientation/react-native-orientation.d.ts @@ -0,0 +1,28 @@ +// Type definitions for react-native-orientation +// Project: https://github.com/yamill/react-native-orientation +// Definitions by: Moshe Atlow +// 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; +}