migrate index.js to typescript

This commit is contained in:
MaysWind
2025-01-08 22:59:58 +08:00
parent b1fbf91d6e
commit 1555052e1d
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import uaParser from 'ua-parser-js'; import uaParser from 'ua-parser-js';
function isMobileDevice() { function isMobileDevice(): boolean {
if (!navigator.userAgent) { if (!navigator.userAgent) {
return false; return false;
} }
@@ -20,8 +20,8 @@ function isMobileDevice() {
return false; return false;
} }
function navigate(type) { function navigate(type: string): void {
if (process.env.NODE_ENV === 'production') { if (__EZBOOKKEEPING_IS_PRODUCTION__) {
window.location.replace(`${type}/`); window.location.replace(`${type}/`);
} else { } else {
window.location.replace(`${type}.html`); window.location.replace(`${type}.html`);
+1 -1
View File
@@ -66,6 +66,6 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<script type="module" src="./index-main.js"></script> <script type="module" src="./index-main.ts"></script>
</body> </body>
</html> </html>