Open
Conversation
Same reason with samchon/openapi#163
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors type definitions across various protocol modules to replace "export import" with "export type" for enhanced clarity and consistency, and it adjusts the WebSocket import in WebSocketAcceptor to ensure proper runtime loading.
- Replaces "export import" with "export type" for State definitions in worker and web protocol files.
- Updates WebSocketAcceptor to import the WebSocket class directly.
- Harmonizes type exports across multiple modules.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/protocols/workers/WorkerServer.ts | Replaced "export import" with "export type" for State. |
| src/protocols/workers/WorkerConnector.ts | Updated State export from "export import" to "export type". |
| src/protocols/workers/SharedWorkerServer.ts | Changed State export to "export type". |
| src/protocols/workers/SharedWorkerConnector.ts | Replaced State export with "export type". |
| src/protocols/workers/SharedWorkerAcceptor.ts | Updated State export to use "export type". |
| src/protocols/web/WebSocketServer.ts | Converted State export from "export import" to "export type". |
| src/protocols/web/WebSocketConnector.ts | Changed State export to "export type". |
| src/protocols/web/WebSocketAcceptor.ts | Updated WebSocket import for runtime and replaced State export with "export type". |
samchon
commented
May 12, 2025
Owner
Author
samchon
left a comment
There was a problem hiding this comment.
Type alias for const enum is not working, so needs more investigation.
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.
Same reason with samchon/openapi#163
This pull request refactors type definitions across multiple files to replace
export importwithexport typefor improved clarity and consistency. Additionally, it updates theWebSocketAcceptorfile to directly import theWebSocketclass instead of using a type-only import.Type definition refactoring:
export import Statewithexport type Statein the following namespaces to improve clarity:WebSocketAcceptorinsrc/protocols/web/WebSocketAcceptor.tsWebSocketConnectorinsrc/protocols/web/WebSocketConnector.tsWebSocketServerinsrc/protocols/web/WebSocketServer.tsSharedWorkerAcceptorinsrc/protocols/workers/SharedWorkerAcceptor.tsSharedWorkerConnectorinsrc/protocols/workers/SharedWorkerConnector.tsSharedWorkerServerinsrc/protocols/workers/SharedWorkerServer.tsWorkerConnectorinsrc/protocols/workers/WorkerConnector.tsWorkerServerinsrc/protocols/workers/WorkerServer.tsImport adjustment:
src/protocols/web/WebSocketAcceptor.tsto import theWebSocketclass directly, replacing the type-only import. This ensures the module is properly loaded at runtime.