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';
function isMobileDevice() {
function isMobileDevice(): boolean {
if (!navigator.userAgent) {
return false;
}
@@ -20,8 +20,8 @@ function isMobileDevice() {
return false;
}
function navigate(type) {
if (process.env.NODE_ENV === 'production') {
function navigate(type: string): void {
if (__EZBOOKKEEPING_IS_PRODUCTION__) {
window.location.replace(`${type}/`);
} else {
window.location.replace(`${type}.html`);
+1 -1
View File
@@ -66,6 +66,6 @@
</noscript>
<div id="app"></div>
<script type="module" src="./index-main.js"></script>
<script type="module" src="./index-main.ts"></script>
</body>
</html>