Skip to content

Commit cf332a2

Browse files
Enable strict error checking
1 parent 6ddcecf commit cf332a2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/controllers/SessionController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class SessionController implements SLWebSocketEventListener {
100100
}
101101
}
102102

103-
onWebSocketEvent(json: JSON) {
103+
onWebSocketEvent(json: any) {
104104
const path = json['path'];
105105
if (!path) { return; }
106106
switch (path) {
@@ -112,15 +112,15 @@ class SessionController implements SLWebSocketEventListener {
112112
}
113113
}
114114

115-
onMessageReceived(json: JSON) {
115+
onMessageReceived(json: any) {
116116
const id = json['id'];
117117
const content = json['content'];
118118
const sender = json['sender'];
119119
if (!id || !content || !sender) { return; }
120120
this.addChatMessage({ id: id, sender: sender, content: content, isEphemeral: false });
121121
}
122122

123-
onSessionStateUpdated(json: JSON) {
123+
onSessionStateUpdated(json: any) {
124124
const sessionState = json['session_state'];
125125
const error = json['error'];
126126
if (!sessionState) { return; }
@@ -130,7 +130,7 @@ class SessionController implements SLWebSocketEventListener {
130130
this.listeners.forEach((listener) => listener.onSessionStateUpdated?.(sessionState, error));
131131
}
132132

133-
onAssistantStateUpdated(json: JSON) {
133+
onAssistantStateUpdated(json: any) {
134134
const state = json['assistant_reply_state'];
135135
if (!state) { return; }
136136
let message: string | null = null;

src/networking/WebSocket.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export enum SLWebSocketState {
1010
}
1111

1212
export interface SLWebSocketEventListener {
13-
onWebSocketEvent?: (json: JSON) => void;
13+
onWebSocketEvent?: (json: any) => void;
1414
onWebSocketStateChanged?: (state: SLWebSocketState) => void;
1515
}
1616

@@ -176,8 +176,8 @@ export class SLWebSocket extends WebSocket {
176176
});
177177
}
178178

179-
private onError(error: ErrorEvent) {
180-
console.error(`[Web Socket] Error: ${error.message}.`);
179+
private onError(event: Event) {
180+
console.error(`[Web Socket] Error: ${event}.`);
181181
}
182182

183183
private onClose(e: CloseEvent) {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"declarationMap": true,
1111
"esModuleInterop": true,
1212
"moduleResolution": "node",
13-
"strictNullChecks": true
13+
"strict": true
1414
},
1515
"include": ["./src", "./types"],
1616
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)