🚨 use // @ts-check in a JavaScript file
[Type Checking JavaScript Files](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html)
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {string} KeyboardKey `event.key` 的代号,
|
* @typedef {string} KeyboardKey `event.key` 的代号,
|
||||||
* 见 <https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values>
|
* 见 <https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values>
|
||||||
@@ -117,11 +119,11 @@ window.addEventListener('DOMContentLoaded', (_event) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
domEl.addEventListener('touchstart', (e) => {
|
domEl.addEventListener('touchstart', () => {
|
||||||
window.ipc.postMessage('drag_window');
|
window.ipc.postMessage('drag_window');
|
||||||
});
|
});
|
||||||
|
|
||||||
domEl.addEventListener('dblclick', (e) => {
|
domEl.addEventListener('dblclick', () => {
|
||||||
window.ipc.postMessage('fullscreen');
|
window.ipc.postMessage('fullscreen');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -154,6 +156,9 @@ function setDefaultZoom() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {(htmlZoom: string) => string} [zoomRule]
|
||||||
|
*/
|
||||||
function zoomCommon(zoomRule) {
|
function zoomCommon(zoomRule) {
|
||||||
const htmlZoom = window.localStorage.getItem('htmlZoom') || '100%';
|
const htmlZoom = window.localStorage.getItem('htmlZoom') || '100%';
|
||||||
const html = document.getElementsByTagName('html')[0];
|
const html = document.getElementsByTagName('html')[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user