Skip to content

Commit 353bcaa

Browse files
committed
Fix TypeScript type hints
1 parent 85a9443 commit 353bcaa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

web/demo/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ const closeModalButton = document.getElementById(
168168
"closeModal"
169169
) as HTMLButtonElement;
170170

171-
const setSettingsBorderCol = (col) =>
171+
const setSettingsBorderCol = (col: string) =>
172172
document.documentElement.style.setProperty("--settings-border", col);
173173

174-
let settingsErrorTimeout;
174+
let settingsErrorTimeout: number;
175175
let settingsValid = true;
176176
settingsModel.onDidChangeContent(() => {
177177
clearTimeout(settingsErrorTimeout);
@@ -273,7 +273,7 @@ document
273273
.getElementById("toggle-view")!
274274
.addEventListener("click", toggleDiffView);
275275

276-
const renderErrorInModel = (error, model) => {
276+
const renderErrorInModel = (error: any, model: monaco.editor.ITextModel) => {
277277
const errorMessage =
278278
error + (error.cause ? `\nCaused by: ${error.cause}` : "");
279279
const markers = [
@@ -290,11 +290,11 @@ const renderErrorInModel = (error, model) => {
290290
monaco.editor.setModelMarkers(model, "", markers);
291291
};
292292

293-
const clearErrorsInModel = (model) => {
293+
const clearErrorsInModel = (model: monaco.editor.ITextModel) => {
294294
monaco.editor.setModelMarkers(model, "", []);
295295
};
296296

297-
const updateRulers = (maxLineLen) => {
297+
const updateRulers = (maxLineLen: number) => {
298298
originalEditor.updateOptions({ rulers: [makeRuler(maxLineLen)] });
299299
formattedEditor.updateOptions({ rulers: [makeRuler(maxLineLen)] });
300300
if (diffEditor !== undefined) {

0 commit comments

Comments
 (0)