Skip to content

Commit

Permalink
docs: update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Oct 1, 2023
1 parent 5c0d0c0 commit 6ab78e8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 21 deletions.
58 changes: 42 additions & 16 deletions docs/API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ whisper.rn

### Variables

- [AudioSessionIos](README.md#audiosessionios)
- [isCoreMLAllowFallback](README.md#iscoremlallowfallback)
- [isUseCoreML](README.md#isusecoreml)
- [libVersion](README.md#libversion)
Expand All @@ -41,15 +42,15 @@ whisper.rn

| Name | Type | Description |
| :------ | :------ | :------ |
| `coreMLModelAsset?` | { `assets`: `number`[] ; `filename`: `string` } | CoreML model assets, if you're using `require` on filePath, use this option is required if you want to enable Core ML, you will need bundle weights/weight.bin, model.mil, coremldata.bin into app by `require` |
| `coreMLModelAsset.assets` | `number`[] | - |
| `coreMLModelAsset?` | { `assets`: `string`[] \| `number`[] ; `filename`: `string` } | CoreML model assets, if you're using `require` on filePath, use this option is required if you want to enable Core ML, you will need bundle weights/weight.bin, model.mil, coremldata.bin into app by `require` |
| `coreMLModelAsset.assets` | `string`[] \| `number`[] | - |
| `coreMLModelAsset.filename` | `string` | - |
| `filePath` | `string` \| `number` | - |
| `isBundleAsset?` | `boolean` | Is the file path a bundle asset for pure string filePath |

#### Defined in

[index.ts:312](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L312)
[index.ts:316](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L316)

___

Expand All @@ -59,7 +60,7 @@ ___

#### Defined in

[index.ts:34](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L34)
[index.ts:34](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L34)

___

Expand Down Expand Up @@ -89,7 +90,7 @@ ___

#### Defined in

[NativeRNWhisper.ts:5](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/NativeRNWhisper.ts#L5)
[NativeRNWhisper.ts:5](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/NativeRNWhisper.ts#L5)

___

Expand All @@ -107,7 +108,7 @@ ___

#### Defined in

[index.ts:41](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L41)
[index.ts:41](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L41)

___

Expand All @@ -132,7 +133,7 @@ ___

#### Defined in

[index.ts:86](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L86)
[index.ts:86](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L86)

___

Expand All @@ -150,7 +151,7 @@ ___

#### Defined in

[index.ts:119](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L119)
[index.ts:119](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L119)

___

Expand All @@ -174,7 +175,7 @@ ___

#### Defined in

[index.ts:106](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L106)
[index.ts:106](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L106)

___

Expand All @@ -184,7 +185,7 @@ ___

#### Defined in

[index.ts:48](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L48)
[index.ts:48](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L48)

___

Expand All @@ -202,10 +203,35 @@ ___

#### Defined in

[NativeRNWhisper.ts:37](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/NativeRNWhisper.ts#L37)
[NativeRNWhisper.ts:37](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/NativeRNWhisper.ts#L37)

## Variables

### AudioSessionIos

**AudioSessionIos**: `Object`

AudioSession Utility, iOS only.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `Category` | typeof `AudioSessionCategory` |
| `CategoryOptions` | typeof `AudioSessionCategoryOptions` |
| `Mode` | typeof `AudioSessionMode` |
| `getCurrentCategory` | () => `Promise`<{ `category`: `AudioSessionCategory` ; `options`: `AudioSessionCategoryOptions`[] }\> |
| `getCurrentMode` | () => `Promise`<`AudioSessionMode`\> |
| `setActive` | (`active`: `boolean`) => `Promise`<`void`\> |
| `setCategory` | (`category`: `AudioSessionCategory`, `options`: `AudioSessionCategoryOptions`[]) => `Promise`<`void`\> |
| `setMode` | (`mode`: `AudioSessionMode`) => `Promise`<`void`\> |

#### Defined in

[AudioSessionIos.ts:41](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/AudioSessionIos.ts#L41)

___

### isCoreMLAllowFallback

`Const` **isCoreMLAllowFallback**: `boolean` = `!!coreMLAllowFallback`
Expand All @@ -214,7 +240,7 @@ Is allow fallback to CPU if load CoreML model failed

#### Defined in

[index.ts:397](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L397)
[index.ts:410](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L410)

___

Expand All @@ -226,7 +252,7 @@ Is use CoreML models on iOS

#### Defined in

[index.ts:394](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L394)
[index.ts:407](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L407)

___

Expand All @@ -238,7 +264,7 @@ Current version of whisper.cpp

#### Defined in

[index.ts:389](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L389)
[index.ts:402](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L402)

## Functions

Expand All @@ -258,7 +284,7 @@ Current version of whisper.cpp

#### Defined in

[index.ts:334](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L334)
[index.ts:338](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L338)

___

Expand All @@ -272,4 +298,4 @@ ___

#### Defined in

[index.ts:384](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L384)
[index.ts:397](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L397)
10 changes: 5 additions & 5 deletions docs/API/classes/WhisperContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#### Defined in

[index.ts:128](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L128)
[index.ts:128](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L128)

## Properties

Expand All @@ -42,7 +42,7 @@

#### Defined in

[index.ts:126](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L126)
[index.ts:126](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L126)

## Methods

Expand All @@ -56,7 +56,7 @@

#### Defined in

[index.ts:307](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L307)
[index.ts:311](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L311)

___

Expand Down Expand Up @@ -84,7 +84,7 @@ Transcribe audio file

#### Defined in

[index.ts:133](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L133)
[index.ts:133](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L133)

___

Expand All @@ -106,4 +106,4 @@ Transcribe the microphone audio stream, the microphone user permission is requir

#### Defined in

[index.ts:201](https://github.com/mybigday/whisper.rn/blob/70b7bfb/src/index.ts#L201)
[index.ts:205](https://github.com/mybigday/whisper.rn/blob/5c0d0c0/src/index.ts#L205)
3 changes: 3 additions & 0 deletions src/AudioSessionIos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const checkPlatform = () => {
if (Platform.OS !== 'ios') throw new Error('Only supported on iOS')
}

/**
* AudioSession Utility, iOS only.
*/
export default {
Category: AudioSessionCategory,
CategoryOptions: AudioSessionCategoryOptions,
Expand Down

0 comments on commit 6ab78e8

Please sign in to comment.