Skip to content

Conversation

@samchon
Copy link
Owner

@samchon samchon commented May 12, 2025

Same reason with samchon/openapi#163


This pull request refactors type definitions across multiple files to replace export import with export type for improved clarity and consistency. Additionally, it updates the WebSocketAcceptor file to directly import the WebSocket class instead of using a type-only import.

Type definition refactoring:

  • Replaced export import State with export type State in the following namespaces to improve clarity:
    • WebSocketAcceptor in src/protocols/web/WebSocketAcceptor.ts
    • WebSocketConnector in src/protocols/web/WebSocketConnector.ts
    • WebSocketServer in src/protocols/web/WebSocketServer.ts
    • SharedWorkerAcceptor in src/protocols/workers/SharedWorkerAcceptor.ts
    • SharedWorkerConnector in src/protocols/workers/SharedWorkerConnector.ts
    • SharedWorkerServer in src/protocols/workers/SharedWorkerServer.ts
    • WorkerConnector in src/protocols/workers/WorkerConnector.ts
    • WorkerServer in src/protocols/workers/WorkerServer.ts

Import adjustment:

  • Updated src/protocols/web/WebSocketAcceptor.ts to import the WebSocket class directly, replacing the type-only import. This ensures the module is properly loaded at runtime.

@samchon samchon requested a review from Copilot May 12, 2025 05:38
@samchon samchon self-assigned this May 12, 2025
@samchon samchon added the enhancement New feature or request label May 12, 2025
Copy link
Contributor

Copilot AI left a comment

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 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".

Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

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

Type alias for const enum is not working, so needs more investigation.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants