export ThreadManager to allow auto-generation of TypeScript types#25
Merged
OBrezhniev merged 1 commit intoiden3:masterfrom Apr 9, 2024
Merged
export ThreadManager to allow auto-generation of TypeScript types#25OBrezhniev merged 1 commit intoiden3:masterfrom
OBrezhniev merged 1 commit intoiden3:masterfrom
Conversation
threadman.js exports the buildThreadManager() function which returns
an instance of the ThreadManager class.
However the ThreadManager class itself is not exported. This can
be problematic; for instance, when auto-generating TypeScript
declaration files from the source via tsc, it results in the following
error:
src/engine.js:1:1 - error TS9006: Declaration emit for this file requires using private name 'ThreadManager' from module '"src/threadman"'. An explicit type annotation may unblock declaration emit.
1 import WasmField1 from "./wasm_field1.js";
~~~~~~
This is simply solved by exporting ThreadManager.
Kolezhniuk
approved these changes
Apr 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
threadman.jsexports thebuildThreadManager()function which returns an instance of theThreadManagerclass.However the
ThreadManagerclass itself is not exported. This can be problematic; for instance, when auto-generating TypeScript declaration files from the source viatsc, it results in the following error:This is simply solved by exporting
ThreadManager.