Use explicit types
This commit is contained in:
@@ -124,6 +124,7 @@ const HooksEditor = () => {
|
||||
setMarkers(monacoRef.current);
|
||||
}
|
||||
}, [snap.active]);
|
||||
|
||||
return (
|
||||
<Box
|
||||
css={{
|
||||
@@ -165,7 +166,8 @@ const HooksEditor = () => {
|
||||
mimetypes: ["text/plain"],
|
||||
});
|
||||
MonacoServices.install(monaco);
|
||||
const webSocket = createWebSocket(
|
||||
|
||||
const webSocket: ReconnectingWebSocket = createWebSocket(
|
||||
process.env.NEXT_PUBLIC_LANGUAGE_SERVER_API_ENDPOINT || ""
|
||||
);
|
||||
subscriptionRef.current = webSocket;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MessageConnection } from "@codingame/monaco-jsonrpc";
|
||||
import { MonacoLanguageClient, ErrorAction, CloseAction, createConnection } from "@codingame/monaco-languageclient";
|
||||
import { CloseAction, createConnection, ErrorAction, MonacoLanguageClient } from "@codingame/monaco-languageclient";
|
||||
import Router from "next/router";
|
||||
import normalizeUrl from "normalize-url";
|
||||
import ReconnectingWebSocket from "reconnecting-websocket";
|
||||
@@ -37,7 +37,7 @@ export function createUrl(path: string): string {
|
||||
return normalizeUrl(`${protocol}://${location.host}${location.pathname}${path}`);
|
||||
}
|
||||
|
||||
export function createWebSocket(url: string) {
|
||||
export function createWebSocket(url: string): ReconnectingWebSocket {
|
||||
const socketOptions = {
|
||||
maxReconnectionDelay: 10000,
|
||||
minReconnectionDelay: 1000,
|
||||
@@ -47,4 +47,4 @@ export function createWebSocket(url: string) {
|
||||
debug: false
|
||||
};
|
||||
return new ReconnectingWebSocket(url, [], socketOptions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user