From 92b9a2517c87587f48f57d7b4f1eb95aeddd8e7f Mon Sep 17 00:00:00 2001 From: Jhen-Jie Hong Date: Mon, 11 Nov 2024 11:06:19 +0800 Subject: [PATCH] fix(docs): exculde private + docgen --- docs/API/README.md | 38 +++++++------- docs/API/classes/WhisperContext.md | 52 +++++++++++++++---- docs/API/enums/AudioSessionCategoryIos.md | 12 ++--- .../enums/AudioSessionCategoryOptionIos.md | 14 ++--- docs/API/enums/AudioSessionModeIos.md | 16 +++--- package.json | 2 +- 6 files changed, 82 insertions(+), 52 deletions(-) diff --git a/docs/API/README.md b/docs/API/README.md index 55c9d4d..c1c9f9d 100644 --- a/docs/API/README.md +++ b/docs/API/README.md @@ -59,7 +59,7 @@ whisper.rn #### Defined in -[index.ts:76](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L76) +[index.ts:76](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L76) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[index.ts:177](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L177) +[index.ts:177](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L177) ___ @@ -103,7 +103,7 @@ ___ #### Defined in -[index.ts:456](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L456) +[index.ts:476](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L476) ___ @@ -113,7 +113,7 @@ ___ #### Defined in -[index.ts:59](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L59) +[index.ts:59](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L59) ___ @@ -131,7 +131,7 @@ ___ #### Defined in -[index.ts:52](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L52) +[index.ts:52](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L52) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[index.ts:45](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L45) +[index.ts:45](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L45) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[NativeRNWhisper.ts:5](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/NativeRNWhisper.ts#L5) +[NativeRNWhisper.ts:5](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/NativeRNWhisper.ts#L5) ___ @@ -198,7 +198,7 @@ ___ #### Defined in -[index.ts:70](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L70) +[index.ts:70](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L70) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[index.ts:138](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L138) +[index.ts:138](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L138) ___ @@ -241,7 +241,7 @@ ___ #### Defined in -[index.ts:171](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L171) +[index.ts:171](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L171) ___ @@ -265,7 +265,7 @@ ___ #### Defined in -[index.ts:158](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L158) +[index.ts:158](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L158) ___ @@ -275,7 +275,7 @@ ___ #### Defined in -[index.ts:84](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L84) +[index.ts:84](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L84) ___ @@ -293,7 +293,7 @@ ___ #### Defined in -[NativeRNWhisper.ts:37](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/NativeRNWhisper.ts#L37) +[NativeRNWhisper.ts:37](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/NativeRNWhisper.ts#L37) ## Variables @@ -318,7 +318,7 @@ AudioSession Utility, iOS only. #### Defined in -[AudioSessionIos.ts:50](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L50) +[AudioSessionIos.ts:50](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L50) ___ @@ -330,7 +330,7 @@ Is allow fallback to CPU if load CoreML model failed #### Defined in -[index.ts:562](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L562) +[index.ts:582](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L582) ___ @@ -342,7 +342,7 @@ Is use CoreML models on iOS #### Defined in -[index.ts:559](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L559) +[index.ts:579](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L579) ___ @@ -354,7 +354,7 @@ Current version of whisper.cpp #### Defined in -[index.ts:554](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L554) +[index.ts:574](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L574) ## Functions @@ -374,7 +374,7 @@ Current version of whisper.cpp #### Defined in -[index.ts:484](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L484) +[index.ts:504](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L504) ___ @@ -388,4 +388,4 @@ ___ #### Defined in -[index.ts:549](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L549) +[index.ts:569](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L569) diff --git a/docs/API/classes/WhisperContext.md b/docs/API/classes/WhisperContext.md index 8ab4309..3125dfb 100644 --- a/docs/API/classes/WhisperContext.md +++ b/docs/API/classes/WhisperContext.md @@ -19,6 +19,7 @@ - [bench](WhisperContext.md#bench) - [release](WhisperContext.md#release) - [transcribe](WhisperContext.md#transcribe) +- [transcribeData](WhisperContext.md#transcribedata) - [transcribeRealtime](WhisperContext.md#transcriberealtime) ## Constructors @@ -35,7 +36,7 @@ #### Defined in -[index.ts:204](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L204) +[index.ts:204](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L204) ## Properties @@ -45,7 +46,7 @@ #### Defined in -[index.ts:200](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L200) +[index.ts:200](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L200) ___ @@ -55,7 +56,7 @@ ___ #### Defined in -[index.ts:198](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L198) +[index.ts:198](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L198) ___ @@ -65,7 +66,7 @@ ___ #### Defined in -[index.ts:202](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L202) +[index.ts:202](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L202) ## Methods @@ -85,7 +86,7 @@ ___ #### Defined in -[index.ts:445](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L445) +[index.ts:465](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L465) ___ @@ -99,21 +100,22 @@ ___ #### Defined in -[index.ts:451](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L451) +[index.ts:471](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L471) ___ ### transcribe -▸ **transcribe**(`filePath`, `options?`): `Object` +▸ **transcribe**(`filePathOrBase64`, `options?`): `Object` -Transcribe audio file +Transcribe audio file (path or base64 encoded wav file) +base64: need add `data:audio/wav;base64,` prefix #### Parameters | Name | Type | | :------ | :------ | -| `filePath` | `string` \| `number` | +| `filePathOrBase64` | `string` \| `number` | | `options` | [`TranscribeFileOptions`](../README.md#transcribefileoptions) | #### Returns @@ -127,7 +129,35 @@ Transcribe audio file #### Defined in -[index.ts:215](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L215) +[index.ts:292](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L292) + +___ + +### transcribeData + +▸ **transcribeData**(`data`, `options?`): `Object` + +Transcribe audio data (base64 encoded float32 PCM data) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `string` | +| `options` | [`TranscribeFileOptions`](../README.md#transcribefileoptions) | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `promise` | `Promise`<[`TranscribeResult`](../README.md#transcriberesult)\> | +| `stop` | () => `Promise`<`void`\> | + +#### Defined in + +[index.ts:323](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L323) ___ @@ -149,4 +179,4 @@ Transcribe the microphone audio stream, the microphone user permission is requir #### Defined in -[index.ts:311](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/index.ts#L311) +[index.ts:331](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/index.ts#L331) diff --git a/docs/API/enums/AudioSessionCategoryIos.md b/docs/API/enums/AudioSessionCategoryIos.md index efb394d..b5bd097 100644 --- a/docs/API/enums/AudioSessionCategoryIos.md +++ b/docs/API/enums/AudioSessionCategoryIos.md @@ -25,7 +25,7 @@ https://developer.apple.com/documentation/avfaudio/avaudiosessioncategory?langua #### Defined in -[AudioSessionIos.ts:8](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L8) +[AudioSessionIos.ts:8](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L8) ___ @@ -35,7 +35,7 @@ ___ #### Defined in -[AudioSessionIos.ts:13](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L13) +[AudioSessionIos.ts:13](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L13) ___ @@ -45,7 +45,7 @@ ___ #### Defined in -[AudioSessionIos.ts:12](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L12) +[AudioSessionIos.ts:12](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L12) ___ @@ -55,7 +55,7 @@ ___ #### Defined in -[AudioSessionIos.ts:10](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L10) +[AudioSessionIos.ts:10](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L10) ___ @@ -65,7 +65,7 @@ ___ #### Defined in -[AudioSessionIos.ts:11](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L11) +[AudioSessionIos.ts:11](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L11) ___ @@ -75,4 +75,4 @@ ___ #### Defined in -[AudioSessionIos.ts:9](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L9) +[AudioSessionIos.ts:9](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L9) diff --git a/docs/API/enums/AudioSessionCategoryOptionIos.md b/docs/API/enums/AudioSessionCategoryOptionIos.md index e213cd8..dbd8acd 100644 --- a/docs/API/enums/AudioSessionCategoryOptionIos.md +++ b/docs/API/enums/AudioSessionCategoryOptionIos.md @@ -26,7 +26,7 @@ https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryoptions #### Defined in -[AudioSessionIos.ts:25](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L25) +[AudioSessionIos.ts:25](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L25) ___ @@ -36,7 +36,7 @@ ___ #### Defined in -[AudioSessionIos.ts:23](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L23) +[AudioSessionIos.ts:23](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L23) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[AudioSessionIos.ts:24](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L24) +[AudioSessionIos.ts:24](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L24) ___ @@ -56,7 +56,7 @@ ___ #### Defined in -[AudioSessionIos.ts:26](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L26) +[AudioSessionIos.ts:26](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L26) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[AudioSessionIos.ts:21](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L21) +[AudioSessionIos.ts:21](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L21) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[AudioSessionIos.ts:22](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L22) +[AudioSessionIos.ts:22](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L22) ___ @@ -86,4 +86,4 @@ ___ #### Defined in -[AudioSessionIos.ts:20](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L20) +[AudioSessionIos.ts:20](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L20) diff --git a/docs/API/enums/AudioSessionModeIos.md b/docs/API/enums/AudioSessionModeIos.md index 0b6c516..f124059 100644 --- a/docs/API/enums/AudioSessionModeIos.md +++ b/docs/API/enums/AudioSessionModeIos.md @@ -27,7 +27,7 @@ https://developer.apple.com/documentation/avfaudio/avaudiosessionmode?language=o #### Defined in -[AudioSessionIos.ts:33](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L33) +[AudioSessionIos.ts:33](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L33) ___ @@ -37,7 +37,7 @@ ___ #### Defined in -[AudioSessionIos.ts:36](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L36) +[AudioSessionIos.ts:36](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L36) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[AudioSessionIos.ts:38](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L38) +[AudioSessionIos.ts:38](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L38) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[AudioSessionIos.ts:39](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L39) +[AudioSessionIos.ts:39](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L39) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[AudioSessionIos.ts:40](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L40) +[AudioSessionIos.ts:40](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L40) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[AudioSessionIos.ts:35](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L35) +[AudioSessionIos.ts:35](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L35) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[AudioSessionIos.ts:37](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L37) +[AudioSessionIos.ts:37](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L37) ___ @@ -97,4 +97,4 @@ ___ #### Defined in -[AudioSessionIos.ts:34](https://github.com/mybigday/whisper.rn/blob/5effdc8/src/AudioSessionIos.ts#L34) +[AudioSessionIos.ts:34](https://github.com/mybigday/whisper.rn/blob/9a3a410/src/AudioSessionIos.ts#L34) diff --git a/package.json b/package.json index 55ad486..0f0f9e0 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ ], "scripts": { "bootstrap": "./scripts/bootstrap.sh", - "docgen": "typedoc src/index.ts --plugin typedoc-plugin-markdown --readme none --out docs/API", + "docgen": "typedoc src/index.ts --plugin typedoc-plugin-markdown --excludePrivate --readme none --out docs/API", "lint": "eslint \"**/*.{js,ts,tsx}\"", "typecheck": "tsc --noEmit", "prepack": "yarn docgen && bob build",