Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TS support #24

Merged
merged 2 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { NativeAppEventEmitter } from 'react-native'
export type SoundLevelResultType = {
/**
* @description Frame number
*/
id: number;

/**
* @description Sound level in decibels
* @description -160 is a silence
*/
value: number;

/**
* @description raw level value, OS-depended
*/
rawValue: number;
}

export type SoundLevelType = {
/**
* @description monitoringInterval works only for iOS
*/
start: (monitoringInterval?: number) => void;
stop: () => void;
onNewFrame: (result: SoundLevelResultType) => void;
}

declare const SoundLevel: SoundLevelType;

export default SoundLevel;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-sound-level",
"version": "1.1.5",
"version": "1.1.7",
"description": "A package to dynamically measure microphone input level",
"main": "index.js",
"author": "Vladimir Osipov (https://github.com/punarinta)",
Expand Down