migrate setting.js and logger.js to ts

This commit is contained in:
MaysWind
2025-01-04 23:42:10 +08:00
parent a9e50d29d3
commit a46399cbaf
34 changed files with 375 additions and 361 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ import { PARENT_ACCOUNT_CURRENCY_PLACEHOLDER } from '@/consts/currency.ts';
import { DEFAULT_ACCOUNT_ICON_ID } from '@/consts/icon.ts';
import { DEFAULT_ACCOUNT_COLOR } from '@/consts/color.ts';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import { isNumber, isEquals } from '@/lib/common.ts';
import { getCurrentUnixTime } from '@/lib/datetime.ts';
import { getCategorizedAccountsMap, getAllFilteredAccountsBalance } from '@/lib/account.js';
+1 -1
View File
@@ -1,7 +1,7 @@
import { defineStore } from 'pinia';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import { isEquals } from '@/lib/common.ts';
import { getCurrentUnixTime, formatUnixTime } from '@/lib/datetime.ts';
import { getExchangedAmount } from '@/lib/numeral.ts';
+1 -1
View File
@@ -13,7 +13,7 @@ import { useExchangeRatesStore } from './exchangeRates.js';
import userState from '@/lib/userstate.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import { isObject, isString } from '@/lib/common.ts';
export const useRootStore = defineStore('root', {
+1 -1
View File
@@ -17,7 +17,7 @@ import {
getThisYearLastUnixTime
} from '@/lib/datetime.ts';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
function updateTransactionDateRange(state) {
const userStore = useUserStore();
+1 -1
View File
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import { WeekDay } from '@/core/datetime.ts';
import { DEFAULT_CURRENCY_CODE } from '@/consts/currency.ts';
import * as settings from '@/lib/settings.js';
import * as settings from '@/lib/settings.ts';
export const useSettingsStore = defineStore('settings', {
state: () => ({
+1 -1
View File
@@ -22,7 +22,7 @@ import {
import { DEFAULT_ACCOUNT_ICON, DEFAULT_CATEGORY_ICON } from '@/consts/icon.ts';
import { DEFAULT_ACCOUNT_COLOR, DEFAULT_CATEGORY_COLOR } from '@/consts/color.ts';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import {
isEquals,
isNumber,
+1 -1
View File
@@ -4,7 +4,7 @@ import { useUserStore } from './user.js';
import userState from '@/lib/userstate.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import { isObject } from '@/lib/common.ts';
export const useTokensStore = defineStore('tokens', {
+1 -1
View File
@@ -14,7 +14,7 @@ import { TransactionType, TransactionTagFilterType } from '@/core/transaction.ts
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
import userState from '@/lib/userstate.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import {
isDefined,
isNumber,
+1 -1
View File
@@ -5,7 +5,7 @@ import { DEFAULT_CATEGORY_ICON_ID } from '@/consts/icon.ts';
import { DEFAULT_CATEGORY_COLOR } from '@/consts/color.ts';
import { isEquals } from '@/lib/common.ts';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
function loadTransactionCategoryList(state, allCategories) {
state.allTransactionCategories = allCategories;
+1 -1
View File
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import { isEquals } from '@/lib/common.ts';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
function loadTransactionTagList(state, tags) {
state.allTransactionTags = tags;
+1 -1
View File
@@ -4,7 +4,7 @@ import { TransactionType } from '@/core/transaction.ts';
import { TemplateType } from '@/core/template.ts';
import { isDefined, isObject, isArray, isEquals } from '@/lib/common.ts';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
function loadTransactionTemplateList(state, templateType, templates) {
state.allTransactionTemplates[templateType] = templates;
+1 -1
View File
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import userState from '@/lib/userstate.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import { isBoolean } from '@/lib/common.ts';
export const useTwoFactorAuthStore = defineStore('twoFactorAuth', {
+1 -1
View File
@@ -4,7 +4,7 @@ import { useSettingsStore } from './setting.js';
import userState from '@/lib/userstate.js';
import services from '@/lib/services.js';
import logger from '@/lib/logger.js';
import logger from '@/lib/logger.ts';
import {
isObject,
isNumber