44 */
55
66import socketAdapter from "./SocketAdapter.js" ;
7+ import type { RosbridgeMessage } from "../types/protocol.js" ;
78import {
89 isRosbridgeActionFeedbackMessage ,
910 isRosbridgeActionResultMessage ,
@@ -13,7 +14,6 @@ import {
1314 isRosbridgeSendActionGoalMessage ,
1415 isRosbridgeServiceResponseMessage ,
1516 isRosbridgeStatusMessage ,
16- RosbridgeMessage ,
1717} from "../types/protocol.js" ;
1818
1919import Topic from "./Topic.js" ;
@@ -23,7 +23,8 @@ import TFClient from "../tf/TFClient";
2323import ActionClient from "../actionlib/ActionClient.js" ;
2424import SimpleActionServer from "../actionlib/SimpleActionServer.js" ;
2525import { EventEmitter } from "eventemitter3" ;
26- import { rosapi } from "../types/rosapi.ts" ;
26+ import type { rosapi } from "../types/rosapi.ts" ;
27+ import type { WebSocket as WsWebSocket } from "ws" ;
2728
2829function isRTCPeerDataChannel ( obj : unknown ) : obj is RTCPeerConnection {
2930 return obj ?. constructor . name === "RTCDataChannel" ;
@@ -47,8 +48,7 @@ export default class Ros extends EventEmitter<
4748 // Any dynamically-named event should correspond to a rosbridge protocol message
4849 } & Record < string , [ RosbridgeMessage ] >
4950> {
50- /** @type {import('./SocketAdapter.js').default | null } */
51- socket : import ( "./SocketAdapter.js" ) . default | null = null ;
51+ socket : socketAdapter | null = null ;
5252 isConnected = false ;
5353 transportLibrary : "websocket" | RTCPeerConnection ;
5454 transportOptions : {
@@ -90,7 +90,7 @@ export default class Ros extends EventEmitter<
9090 */
9191 async #createTransport(
9292 url : string ,
93- ) : Promise < WebSocket | RTCDataChannel | import ( "ws" ) . WebSocket | null > {
93+ ) : Promise < WebSocket | RTCDataChannel | WsWebSocket | null > {
9494 if ( isRTCPeerDataChannel ( this . transportLibrary ) ) {
9595 const dataChannel = this . transportLibrary . createDataChannel (
9696 url ,
0 commit comments