Skip to content

[browser] Export useful browser tuntime TypeScript types - #127084

Merged
pavelsavara merged 2 commits into
dotnet:mainfrom
elringus:feat/export-wasm-types
Apr 20, 2026
Merged

pavelsavara merged 2 commits into
dotnet:mainfrom
elringus:feat/export-wasm-types

Conversation

@elringus

@elringus elringus commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor

This exports the browser asset-related types from the public TypeScript entrypoints for both Mono and CoreCLR.

These types were already defined in the underlying runtime type declarations, but they were not consistently re-exported from the public API surfaces. This change makes them available to consumers in both runtimes through the intended top-level type export files.

This improves the usability of the browser runtime TypeScript APIs by making the existing asset model types discoverable and importable without reaching into internal type declaration files.

The issue was discussed with @pavelsavara on .NET's Discord server.

Copilot AI review requested due to automatic review settings April 17, 2026 16:08
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Apr 17, 2026
@elringus

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes existing browser runtime asset-related TypeScript types publicly discoverable by re-exporting them from the intended top-level .d.ts entrypoints for both NativeAOT and Mono browser runtimes.

Changes:

  • Re-export asset model types (e.g., Assets, Asset, AssemblyAsset, WasmAsset, WebAssemblyBootResourceType, etc.) from the NativeAOT public TypeScript entrypoint.
  • Re-export the same asset model types from the Mono browser runtime public TypeScript entrypoint, aligning the two runtimes’ public surfaces.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/native/libs/Common/JavaScript/types/export-api.ts Extends the NativeAOT top-level type entrypoint to re-export the asset model types from public-api.
src/mono/browser/runtime/types/export-types.ts Extends the Mono browser runtime top-level type entrypoint to re-export the same asset model types from the runtime types/index.

@pavelsavara

Copy link
Copy Markdown
Member

@elringus please

  • run npm run rollup:debug in src/native
  • run npm run rollup in src/mono/browser/runtime

it will generate 2x dotnet.d.ts to commit to this PR

@elringus

Copy link
Copy Markdown
Contributor Author

@elringus please

* run `npm run rollup:debug` in `src/native`

* run `npm run rollup` in `src/mono/browser/runtime`

it will generate 2x dotnet.d.ts to commit to this PR

Done.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@pavelsavara
pavelsavara merged commit 452e9ba into dotnet:main Apr 20, 2026
146 of 154 checks passed
@elringus
elringus deleted the feat/export-wasm-types branch May 11, 2026 17:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript community-contribution Indicates that the PR has been added by a community member os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants