Skip to content

feat(core): type the consolidated @NativeClass decorator options - #11357

Open
NathanWalker wants to merge 1 commit into
mainfrom
feat/nativeclass-decorator-types
Open

feat(core): type the consolidated @NativeClass decorator options#11357
NathanWalker wants to merge 1 commit into
mainfrom
feat/nativeclass-decorator-types

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Runtime 9.1+ (ios#403 and the Android counterpart) applies @NativeClass itself and accepts per-platform options:

  @NativeClass({
    ios: { name, protocols, methods },
    android: { name, interfaces },
  })

Mirror that shape in global-types.d.ts, using the same interface names as @nativescript/ios types/ns-nativeclass.d.ts so both declaration sets merge cleanly in one program. The previous top-level protocols / interfaces keys stay as @deprecated aliases (both runtimes still read them); nativeClassName is @deprecated because neither runtime ever read it from the options. The overloads now return the class / decorator type instead of implicit any.

Runtime 9.1 (ios#403 and the Android counterpart) applies `@NativeClass`
itself and accepts per-platform options:

  @nativeclass({
    ios: { name, protocols, methods },
    android: { name, interfaces },
  })

Mirror that shape in global-types.d.ts, using the same interface names as
@nativescript/ios `types/ns-nativeclass.d.ts` so both declaration sets
merge cleanly in one program. The previous top-level `protocols` /
`interfaces` keys stay as @deprecated aliases (both runtimes still read
them); `nativeClassName` is @deprecated because neither runtime ever
read it from the options. The overloads now return the class / decorator
type instead of implicit any.
@NathanWalker NathanWalker added this to the 9.1.1 milestone Aug 20, 2026
@nx-cloud

nx-cloud Bot commented Aug 20, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit dad0173

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 48s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-20 19:43:48 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant