Skip to content

[interop] Add Support for Typealiases #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 10, 2025

Conversation

nikeokoronkwo
Copy link
Contributor

Fixes #406

This issue adds support for TS typealises, denoted by the type keyword, and represents them as Dart typedefs.

type A = string;
type B<T> = Promise<T>;

turns into

typedef A = JSString;
typedef B<T extends JSAny> = JSPromise<T>;

@nikeokoronkwo nikeokoronkwo changed the title [interop] Support Typealiases [interop] Add Support for Typealiases Jul 6, 2025
- Deleted `ts_bindings_test.dart` (ts_bindings_test.dart needs input data to run dart-lang#372)
- transformer.dart updated
- Added test cases for enum decls
- Added support for getting js types for nested aliases and enums
@srujzs srujzs merged commit 354e229 into dart-lang:main Jul 10, 2025
16 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jul 10, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

http (https://github.com/dart-lang/http/compare/7d2d87e..4209e84):
  4209e84  2025-07-09  Brian Quinlan  [cronet_http] Upgrade to kotlin 1.8.10 (dart-lang/http#1789)
  d2886a0  2025-07-08  dependabot[bot]  Bump subosito/flutter-action in the github-actions group (dart-lang/http#1784)
  4097219  2025-07-08  Brian Quinlan  Prepare to release 1.5.0-beta (dart-lang/http#1787)
  a4f5a8d  2025-07-08  Luka S  feat: support aborting HTTP requests (dart-lang/http#1773)

i18n (https://github.com/dart-lang/i18n/compare/42c4932..c45e050):
  c45e0504  2025-07-09  Googler  No public description
  bdb94c25  2025-07-09  Googler  No public description

tools (https://github.com/dart-lang/tools/compare/6282b35..fd7cc89):
  fd7cc89a  2025-07-09  Nate Biggs  Fix wasm dry run event and tests (dart-lang/tools#2128)
  1500539b  2025-07-09  Liam Appelbe  [coverage] Expose `filterIgnored` function (dart-lang/tools#2123)
  99634476  2025-07-08  Nate Biggs  Add wasm dry run event to unified analytics. (dart-lang/tools#2125)

web (https://github.com/dart-lang/web/compare/fb8a149..354e229):
  354e229  2025-07-09  Nikechukwu  [interop] Add Support for Typealiases (dart-lang/web#407)
  f0f0914  2025-07-08  Nikechukwu  [interop] Add Support for Enums (dart-lang/web#404)

Change-Id: Ia691d4ca8d20ccb1d7a96598c369dabaf9124850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439804
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
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.

Interop Gen: Support Typealiases
2 participants