Skip to content

Commit a78f831

Browse files
docs: update api reference
1 parent 28a7bad commit a78f831

22 files changed

Lines changed: 1165 additions & 2071 deletions

.cspell-wordlist.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@ basemodule
118118
IMAGENET
119119
worklet
120120
worklets
121-
BGRA
121+
BGRA
122+
RGBA

docs/docs/06-api-reference/classes/ClassificationModule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ The input shape as an array of numbers.
223223

224224
### load()
225225

226-
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>
226+
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
227227
228228
Defined in: [modules/computer_vision/ClassificationModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L21)
229229

@@ -240,7 +240,7 @@ Object containing `modelSource`.
240240

241241
[`ResourceSource`](../type-aliases/ResourceSource.md)
242242

243-
##### onDownloadProgressCallback?
243+
##### onDownloadProgressCallback
244244

245245
(`progress`) => `void`
246246

docs/docs/06-api-reference/classes/ExecutorchModule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ The input shape as an array of numbers.
224224

225225
### load()
226226

227-
> **load**(`modelSource`, `onDownloadProgressCallback?`): `Promise`\<`void`\>
227+
> **load**(`modelSource`, `onDownloadProgressCallback`): `Promise`\<`void`\>
228228
229229
Defined in: [modules/general/ExecutorchModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L22)
230230

@@ -239,7 +239,7 @@ Optionally accepts a download progress callback.
239239

240240
Source of the model to be loaded.
241241

242-
##### onDownloadProgressCallback?
242+
##### onDownloadProgressCallback
243243

244244
(`progress`) => `void`
245245

docs/docs/06-api-reference/classes/ImageEmbeddingsModule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ The input shape as an array of numbers.
223223

224224
### load()
225225

226-
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>
226+
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
227227
228228
Defined in: [modules/computer_vision/ImageEmbeddingsModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L20)
229229

@@ -239,7 +239,7 @@ Object containing `modelSource`.
239239

240240
[`ResourceSource`](../type-aliases/ResourceSource.md)
241241

242-
##### onDownloadProgressCallback?
242+
##### onDownloadProgressCallback
243243

244244
(`progress`) => `void`
245245

docs/docs/06-api-reference/classes/LLMModule.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Module for managing a Large Language Model (LLM) instance.
88

99
### Constructor
1010

11-
> **new LLMModule**(`optionalCallbacks?`): `LLMModule`
11+
> **new LLMModule**(`optionalCallbacks`): `LLMModule`
1212
1313
Defined in: [modules/natural_language_processing/LLMModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L20)
1414

1515
Creates a new instance of `LLMModule` with optional callbacks.
1616

1717
#### Parameters
1818

19-
##### optionalCallbacks?
19+
##### optionalCallbacks
2020

2121
Object containing optional callbacks.
2222

@@ -227,7 +227,7 @@ Interrupts model generation. It may return one more token after interrupt.
227227

228228
### load()
229229

230-
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>
230+
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
231231
232232
Defined in: [modules/natural_language_processing/LLMModule.ts:49](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/LLMModule.ts#L49)
233233

@@ -257,7 +257,7 @@ Object containing model, tokenizer, and tokenizer config sources.
257257

258258
`ResourceSource` pointing to the JSON file which contains the tokenizer.
259259

260-
##### onDownloadProgressCallback?
260+
##### onDownloadProgressCallback
261261

262262
(`progress`) => `void`
263263

docs/docs/06-api-reference/classes/MessageCountContextStrategy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This strategy trims the conversation history based purely on the message count.
1313

1414
### Constructor
1515

16-
> **new MessageCountContextStrategy**(`windowLength?`): `MessageCountContextStrategy`
16+
> **new MessageCountContextStrategy**(`windowLength`): `MessageCountContextStrategy`
1717
1818
Defined in: [utils/llms/context_strategy/MessageCountContextStrategy.ts:14](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/llms/context_strategy/MessageCountContextStrategy.ts#L14)
1919

@@ -23,7 +23,7 @@ Initializes the MessageCountContextStrategy.
2323

2424
#### Parameters
2525

26-
##### windowLength?
26+
##### windowLength
2727

2828
`number` = `5`
2929

docs/docs/06-api-reference/classes/OCRModule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The OCR result as a `OCRDetection[]`.
5959

6060
### load()
6161

62-
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>
62+
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
6363
6464
Defined in: [modules/computer_vision/OCRModule.ts:27](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts#L27)
6565

@@ -85,7 +85,7 @@ Object containing `detectorSource`, `recognizerSource`, and `language`.
8585

8686
[`ResourceSource`](../type-aliases/ResourceSource.md)
8787

88-
##### onDownloadProgressCallback?
88+
##### onDownloadProgressCallback
8989

9090
(`progress`) => `void`
9191

docs/docs/06-api-reference/classes/ObjectDetectionModule.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Always call this method when you're done with a model to prevent memory leaks.
180180

181181
### forward()
182182

183-
> **forward**(`imageSource`, `detectionThreshold?`): `Promise`\<[`Detection`](../interfaces/Detection.md)[]\>
183+
> **forward**(`input`, `detectionThreshold`): `Promise`\<[`Detection`](../interfaces/Detection.md)[]\>
184184
185185
Defined in: [modules/computer_vision/ObjectDetectionModule.ts:46](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts#L46)
186186

@@ -202,7 +202,7 @@ Image source (string path or PixelData object)
202202

203203
`string` | [`PixelData`](../interfaces/PixelData.md)
204204

205-
##### detectionThreshold?
205+
##### detectionThreshold
206206

207207
`number` = `0.5`
208208

@@ -308,7 +308,7 @@ The input shape as an array of numbers.
308308

309309
### load()
310310

311-
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>
311+
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
312312
313313
Defined in: [modules/computer_vision/ObjectDetectionModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts#L22)
314314

@@ -325,7 +325,7 @@ Object containing `modelSource`.
325325

326326
[`ResourceSource`](../type-aliases/ResourceSource.md)
327327

328-
##### onDownloadProgressCallback?
328+
##### onDownloadProgressCallback
329329

330330
(`progress`) => `void`
331331

docs/docs/06-api-reference/classes/ResourceFetcher.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ Currently supports reading file contents as strings for configuration files.
5858

5959
### fetch()
6060

61-
> `static` **fetch**(`callback?`, ...`sources`): `Promise`\<`string`[] \| `null`\>
61+
> `static` **fetch**(`callback`, ...`sources`): `Promise`\<`string`[] \| `null`\>
6262
6363
Defined in: [utils/ResourceFetcher.ts:105](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L105)
6464

6565
Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch.
6666

6767
#### Parameters
6868

69-
##### callback?
69+
##### callback
7070

7171
(`downloadProgress`) => `void`
7272

docs/docs/06-api-reference/classes/SemanticSegmentationModule.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Always call this method when you're done with a model to prevent memory leaks.
131131

132132
### forward()
133133

134-
> **forward**\<`K`\>(`imageSource`, `classesOfInterest?`, `resizeToInput?`): `Promise`\<`Record`\<`"ARGMAX"`, `Int32Array`\<`ArrayBufferLike`\>\> & `Record`\<`K`, `Float32Array`\<`ArrayBufferLike`\>\>\>
134+
> **forward**\<`K`\>(`imageSource`, `classesOfInterest`, `resizeToInput`): `Promise`\<`Record`\<`"ARGMAX"`, `Int32Array`\<`ArrayBufferLike`\>\> & `Record`\<`K`, `Float32Array`\<`ArrayBufferLike`\>\>\>
135135
136136
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:176](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L176)
137137

@@ -151,13 +151,13 @@ Executes the model's forward pass to perform semantic segmentation on the provid
151151

152152
A string representing the image source (e.g., a file path, URI, or Base64-encoded string).
153153

154-
##### classesOfInterest?
154+
##### classesOfInterest
155155

156156
`K`[] = `[]`
157157

158158
An optional list of label keys indicating which per-class probability masks to include in the output. `ARGMAX` is always returned regardless.
159159

160-
##### resizeToInput?
160+
##### resizeToInput
161161

162162
`boolean` = `true`
163163

@@ -260,7 +260,7 @@ Load the model and prepare it for inference.
260260

261261
### fromCustomConfig()
262262

263-
> `static` **fromCustomConfig**\<`L`\>(`modelSource`, `config`, `onDownloadProgress?`): `Promise`\<`SemanticSegmentationModule`\<`L`\>\>
263+
> `static` **fromCustomConfig**\<`L`\>(`modelSource`, `config`, `onDownloadProgress`): `Promise`\<`SemanticSegmentationModule`\<`L`\>\>
264264
265265
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:142](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L142)
266266

@@ -287,7 +287,7 @@ A fetchable resource pointing to the model binary.
287287

288288
A [SemanticSegmentationConfig](../type-aliases/SemanticSegmentationConfig.md) object with the label map and optional preprocessing parameters.
289289

290-
##### onDownloadProgress?
290+
##### onDownloadProgress
291291

292292
(`progress`) => `void`
293293

@@ -313,7 +313,7 @@ const segmentation = await SemanticSegmentationModule.fromCustomConfig(
313313

314314
### fromModelName()
315315

316-
> `static` **fromModelName**\<`C`\>(`config`, `onDownloadProgress?`): `Promise`\<`SemanticSegmentationModule`\<[`ModelNameOf`](../type-aliases/ModelNameOf.md)\<`C`\>\>\>
316+
> `static` **fromModelName**\<`C`\>(`config`, `onDownloadProgress`): `Promise`\<`SemanticSegmentationModule`\<[`ModelNameOf`](../type-aliases/ModelNameOf.md)\<`C`\>\>\>
317317
318318
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:95](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L95)
319319

@@ -334,7 +334,7 @@ The config object is discriminated by `modelName` — each model can require dif
334334

335335
A [SemanticSegmentationModelSources](../type-aliases/SemanticSegmentationModelSources.md) object specifying which model to load and where to fetch it from.
336336

337-
##### onDownloadProgress?
337+
##### onDownloadProgress
338338

339339
(`progress`) => `void`
340340

0 commit comments

Comments
 (0)