forked from goodatlas/react-native-audio-record
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request goodatlas#25 from is343/master
add typescript type definitions
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
declare module "react-native-audio-record" { | ||
export interface IAudioRecord { | ||
init: (options: Options) => void | ||
start: () => void | ||
stop: () => Promise<string> | ||
on: (event: "data", callback: (data: string) => void) => void | ||
} | ||
|
||
export interface Options { | ||
sampleRate: number | ||
/** | ||
* - `1 | 2` | ||
*/ | ||
channels: number | ||
/** | ||
* - `8 | 16` | ||
*/ | ||
bitsPerSample: number | ||
/** | ||
* - `6` | ||
*/ | ||
audioSource?: number | ||
wavFile: string | ||
} | ||
|
||
const AudioRecord: IAudioRecord | ||
|
||
export default AudioRecord; | ||
} |