Skip to content

[RNE Rewrite] style(ts): standardize task naming, preprocessor options, and TSDoc conventions - #1340

Merged
barhanc merged 8 commits into
rne-rewritefrom
@bh/ts-style-fixes
Aug 3, 2026
Merged

[RNE Rewrite] style(ts): standardize task naming, preprocessor options, and TSDoc conventions#1340
barhanc merged 8 commits into
rne-rewritefrom
@bh/ts-style-fixes

Conversation

@barhanc

@barhanc barhanc commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

  • Naming Consistency: Standardized ClassifierModel.opts (renamed from classifierOpts) and SemanticSegmenterModel / SemanticSegmenterOptions (renamed from SemanticSegmentationModel).

  • Preprocessor Options: Replaced top-level alpha/beta fields with a required normalizeOpts: NormalizeOptions property across all task option interfaces and models.ts presets.

  • TSDoc Standardization: Converted top-level @property tags to inline member JSDoc comments (/** ... */) and added function-level @param options.field fallback notes.

  • Immutability: Enforced readonly property modifiers on task results (SemanticSegmentationResult, BoxMap).

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

  • Run the CV example app and verify that preprocessor options change didn't break anything.

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@barhanc barhanc self-assigned this Jul 30, 2026
@barhanc barhanc added refactoring improvement PRs or issues focused on improvements in the current codebase labels Jul 30, 2026
@barhanc
barhanc requested a review from msluszniak July 31, 2026 09:55
* @param options.confidenceThreshold Minimum confidence score for returned
* detections.
* @param options.iouThreshold Non-maximum suppression IoU threshold.
* @param options.confidenceThreshold Minimum confidence score threshold. If

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options and opts, I don't know if this won't cause a confusion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Renamed opts inside model configs to modelOpts across the board.

Comment thread packages/react-native-executorch/src/extensions/cv/ops/image.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/ops/image.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/tasks/instanceSegmentation.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/tasks/keypointDetection.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/tasks/keypointDetection.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/tasks/semanticSegmentation.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/tasks/semanticSegmentation.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/cv/tasks/styleTransfer.ts Outdated
Comment thread packages/react-native-executorch/src/extensions/speech/utils/vadUtils.ts Outdated
barhanc added 4 commits August 3, 2026 14:47
Rename the  property on CV model types to  to
disambiguate from per-call  parameters and low-level op
 parameters.
Replace inline enumerations (e.g., `stretch`, `letterbox`, `crop`)
with {@link} references to the named types. Expand 'IoU' to
'Intersection over Union (IoU)' for consistency.
- Replace terse modelOpts comments with descriptions of what they
  control, linking to the proper options type
- Add {@link} type references to property descriptions
- Expand 'IoU' to 'Intersection over Union (IoU)' for consistency
- Collapse multi-line JSDoc to single-line where it fits in 100 chars
- Mention 'stretch' as only resizeMode value where applicable
@barhanc
barhanc requested a review from msluszniak August 3, 2026 13:28
@barhanc
barhanc merged commit 092ac19 into rne-rewrite Aug 3, 2026
2 checks passed
@barhanc
barhanc deleted the @bh/ts-style-fixes branch August 3, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement PRs or issues focused on improvements in the current codebase refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants