Skip to content

Commit

Permalink
Merge pull request #24 from SkilledApps/feature/typescript
Browse files Browse the repository at this point in the history
Add TS support
  • Loading branch information
punarinta committed Mar 26, 2023
2 parents a35e8e9 + 10e2e6e commit c59f4e8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
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

0 comments on commit c59f4e8

Please sign in to comment.