diff --git a/src/features/game/components/desktop/desktop-animal-overlay.tsx b/src/features/game/components/desktop/desktop-animal-overlay.tsx index 4b25589..7a8ef63 100644 --- a/src/features/game/components/desktop/desktop-animal-overlay.tsx +++ b/src/features/game/components/desktop/desktop-animal-overlay.tsx @@ -22,12 +22,8 @@ import { } from '@/features/game/shared' import { cn } from '@/lib/utils' import { useAuthStore } from '@/store/auth' -import { - type RewardAnimationType, - useGameAutoHostingStore, - useGameRoundStore, -} from '@/store/game' -import type { BetSelection } from '@/type' +import { useGameAutoHostingStore, useGameRoundStore } from '@/store/game' +import type { BetSelection, RewardAnimationType } from '@/type' const REWARD_OVERLAY_FADE_OUT_MS = 300 const REWARD_CHILDREN_FADE_IN_MS = 2_000 diff --git a/src/features/game/components/desktop/desktop-topup.tsx b/src/features/game/components/desktop/desktop-topup.tsx index 2e469e3..2e15164 100644 --- a/src/features/game/components/desktop/desktop-topup.tsx +++ b/src/features/game/components/desktop/desktop-topup.tsx @@ -1,11 +1,12 @@ import { useMutation } from '@tanstack/react-query' import { useRef } from 'react' import { useTranslation } from 'react-i18next' -import { createDeposit, type DepositTierItem } from '@/api' +import { createDeposit } from '@/api' import { DataLoadingIndicator } from '@/components/ui/data-loading-indicator' import { useDepositTierList } from '@/hooks/use-deposit-tier-list' import { notify } from '@/lib/notify' import { cn } from '@/lib/utils' +import type { DepositTierItem } from '@/type' const PANEL_CLASS = 'rounded-md border border-[rgba(110,229,243,0.24)] bg-[linear-gradient(180deg,rgba(7,30,43,0.9),rgba(3,15,26,0.94))] shadow-[inset_0_0_calc(var(--design-unit)*14)_rgba(88,225,238,0.08),0_0_calc(var(--design-unit)*10)_rgba(32,163,186,0.12)]' diff --git a/src/features/game/components/desktop/desktop-withdraw.tsx b/src/features/game/components/desktop/desktop-withdraw.tsx index 0f61054..ff2c42a 100644 --- a/src/features/game/components/desktop/desktop-withdraw.tsx +++ b/src/features/game/components/desktop/desktop-withdraw.tsx @@ -16,6 +16,7 @@ import { useWithdrawSubmit } from '@/hooks/use-withdraw-submit' import { useWithdrawVm } from '@/hooks/use-withdraw-vm' import { cn } from '@/lib/utils' import { useModalStore } from '@/store' +import type { FinanceCurrencyConfig } from '@/type' const PANEL_CLASS = 'rounded-md border border-[rgba(110,229,243,0.24)] bg-[linear-gradient(180deg,rgba(7,30,43,0.9),rgba(3,15,26,0.94))] shadow-[inset_0_0_calc(var(--design-unit)*14)_rgba(88,225,238,0.08),0_0_calc(var(--design-unit)*10)_rgba(32,163,186,0.12)]' @@ -428,7 +429,7 @@ function DesktopWithdraw() { /> - {vm.config.currencies.map((option) => ( + {vm.config.currencies.map((option: FinanceCurrencyConfig) => ( {option.label} diff --git a/src/features/game/components/mobile/mobile-header.tsx b/src/features/game/components/mobile/mobile-header.tsx index b824109..2e83a23 100644 --- a/src/features/game/components/mobile/mobile-header.tsx +++ b/src/features/game/components/mobile/mobile-header.tsx @@ -13,7 +13,6 @@ import chatImage from '@/assets/system/chat.webp' import diamond from '@/assets/system/diamond.webp' import logo from '@/assets/system/logo.webp' import { SmartImage } from '@/components/smart-image.tsx' -import { MessageBroadcast } from '@/features/game/components/desktop/desktop-title.tsx' import { useHeaderClockLabel, useHeaderVm } from '@/hooks/use-header-vm' import { useModalStore } from '@/store' diff --git a/src/features/game/components/mobile/mobile-topup.tsx b/src/features/game/components/mobile/mobile-topup.tsx index 4f1650f..1dd48e5 100644 --- a/src/features/game/components/mobile/mobile-topup.tsx +++ b/src/features/game/components/mobile/mobile-topup.tsx @@ -1,11 +1,12 @@ import { useMutation } from '@tanstack/react-query' import { useRef } from 'react' import { useTranslation } from 'react-i18next' -import { createDeposit, type DepositTierItem } from '@/api' +import { createDeposit } from '@/api' import { DataLoadingIndicator } from '@/components/ui/data-loading-indicator' import { useDepositTierList } from '@/hooks/use-deposit-tier-list' import { notify } from '@/lib/notify' import { cn } from '@/lib/utils' +import type { DepositTierItem } from '@/type' const PANEL_CLASS = 'rounded-md border border-[rgba(110,229,243,0.24)] bg-[linear-gradient(180deg,rgba(7,30,43,0.9),rgba(3,15,26,0.94))] shadow-[inset_0_0_calc(var(--design-unit)*12)_rgba(88,225,238,0.08)]' diff --git a/src/features/game/components/mobile/mobile-withdraw.tsx b/src/features/game/components/mobile/mobile-withdraw.tsx index dd2d795..f0a3d91 100644 --- a/src/features/game/components/mobile/mobile-withdraw.tsx +++ b/src/features/game/components/mobile/mobile-withdraw.tsx @@ -16,6 +16,7 @@ import { useWithdrawSubmit } from '@/hooks/use-withdraw-submit' import { useWithdrawVm } from '@/hooks/use-withdraw-vm' import { cn } from '@/lib/utils' import { useModalStore } from '@/store' +import type { FinanceCurrencyConfig } from '@/type' const PANEL_CLASS = 'rounded-md border border-[rgba(110,229,243,0.24)] bg-[linear-gradient(180deg,rgba(7,30,43,0.9),rgba(3,15,26,0.94))] shadow-[inset_0_0_calc(var(--design-unit)*10)_rgba(88,225,238,0.08)]' @@ -414,7 +415,7 @@ function MobileWithdraw() { /> - {vm.config.currencies.map((option) => ( + {vm.config.currencies.map((option: FinanceCurrencyConfig) => ( {option.label} diff --git a/src/hooks/use-auth.ts b/src/hooks/use-auth.ts index b774590..f6f8f79 100644 --- a/src/hooks/use-auth.ts +++ b/src/hooks/use-auth.ts @@ -1,4 +1,5 @@ -import { type ModalKey, useModalStore } from '@/store' +import { useModalStore } from '@/store' +import type { ModalKey } from '@/type' export function useAuth() { const setModalOpen = useModalStore((state) => state.setModalOpen) diff --git a/src/hooks/use-login-form.ts b/src/hooks/use-login-form.ts index 773d9c0..88b0a84 100644 --- a/src/hooks/use-login-form.ts +++ b/src/hooks/use-login-form.ts @@ -3,9 +3,9 @@ import { useForm } from 'react-hook-form' import { loginWithPassword } from '@/api' import i18n from '@/i18n' import { notify } from '@/lib/notify' -import { type LoginFormValues, loginFormSchema } from '@/schema/auth-schema' +import { loginFormSchema } from '@/schema/auth-schema' import { useAuthStore } from '@/store/auth' -import type { UseLoginFormOptions } from '@/type' +import type { LoginFormValues, UseLoginFormOptions } from '@/type' import { toAuthSubmitErrorKey } from './auth-error-key' import { createZodResolver } from './zod-form-resolver' diff --git a/src/hooks/use-period-history-vm.ts b/src/hooks/use-period-history-vm.ts index d5e1bd4..1fcb0c9 100644 --- a/src/hooks/use-period-history-vm.ts +++ b/src/hooks/use-period-history-vm.ts @@ -1,9 +1,11 @@ import { useQuery } from '@tanstack/react-query' import { useMemo } from 'react' -import { type GamePeriodHistoryItemDto, getGamePeriodHistory } from '@/api' +import { getGamePeriodHistory } from '@/api' import { FLOWER_IMAGE_BY_ID } from '@/features/game/shared' -import type { PeriodHistoryDisplayItem } from '@/type' +import type { GamePeriodHistoryItemDto, PeriodHistoryDisplayItem } from '@/type' + +export type { PeriodHistoryDisplayItem } from '@/type' export const DEFAULT_PERIOD_HISTORY_LIMIT = 36 diff --git a/src/hooks/use-register-form.ts b/src/hooks/use-register-form.ts index 6649f0d..9f5d948 100644 --- a/src/hooks/use-register-form.ts +++ b/src/hooks/use-register-form.ts @@ -7,12 +7,9 @@ import { } from '@/constants' import i18n from '@/i18n' import { notify } from '@/lib/notify' -import { - type RegisterFormValues, - registerFormSchema, -} from '@/schema/auth-schema' +import { registerFormSchema } from '@/schema/auth-schema' import { useAuthStore } from '@/store/auth' -import type { UseRegisterFormOptions } from '@/type' +import type { RegisterFormValues, UseRegisterFormOptions } from '@/type' import { toAuthSubmitErrorKey } from './auth-error-key' import { createZodResolver } from './zod-form-resolver' diff --git a/src/hooks/use-withdraw-submit.ts b/src/hooks/use-withdraw-submit.ts index a2ed03d..f48184a 100644 --- a/src/hooks/use-withdraw-submit.ts +++ b/src/hooks/use-withdraw-submit.ts @@ -1,8 +1,9 @@ import { useMutation } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { createWithdraw, type WithdrawCreateRequestDto } from '@/api' +import { createWithdraw } from '@/api' import { notify } from '@/lib/notify' +import type { WithdrawCreateRequestDto } from '@/type' export function useWithdrawSubmit() { const { i18n, t } = useTranslation() diff --git a/src/hooks/use-withdraw-vm.ts b/src/hooks/use-withdraw-vm.ts index fe4fedf..b470d38 100644 --- a/src/hooks/use-withdraw-vm.ts +++ b/src/hooks/use-withdraw-vm.ts @@ -1,6 +1,5 @@ import { useCallback, useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' -import type { DepositWithdrawConfig } from '@/api' import { DEFAULT_CURRENCY_CODE, DEFAULT_WITHDRAW_CONFIG, @@ -10,6 +9,7 @@ import { } from '@/constants' import { useDepositWithdrawConfig } from '@/hooks/use-deposit-withdraw-config' import { useAuthStore } from '@/store' +import type { DepositWithdrawConfig } from '@/type' function formatNumber(locale: string, value: number) { return new Intl.NumberFormat(locale).format(value) diff --git a/src/i18n/index.ts b/src/i18n/index.ts index aef1d4c..2432b84 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -7,6 +7,7 @@ import idID from '@/locales/id-ID' import msMY from '@/locales/ms-MY' import zhCN from '@/locales/zh-CN' import { getStoredAppLanguage, setStoredAppLanguage } from '@/store/auth' +import type { AppLanguage } from '@/type' export type { AppLanguage } from '@/type' @@ -45,7 +46,7 @@ export function getLanguageFromPathname(pathname: string) { } void i18n.use(initReactI18next).init({ - lng: getInitialLanguage(), + lng: getInitialLanguage() ?? DEFAULT_APP_LANGUAGE, fallbackLng: DEFAULT_APP_LANGUAGE, debug: false, interpolation: { diff --git a/src/lib/auth/auth-session.ts b/src/lib/auth/auth-session.ts index a9a50e4..10b0df9 100644 --- a/src/lib/auth/auth-session.ts +++ b/src/lib/auth/auth-session.ts @@ -9,8 +9,6 @@ import { queryClient } from '@/lib/query/query-client' import { useAuthStore } from '@/store/auth' import { useModalStore } from '@/store/modal' import type { - AuthSessionInput, - AuthUser, ClearAuthenticatedSessionOptions, CurrentUserInitializer, RefreshSessionHandler, diff --git a/src/modal/desktop/desktop-auto-setting-modal.tsx b/src/modal/desktop/desktop-auto-setting-modal.tsx index fa4e9c6..9aa5d95 100644 --- a/src/modal/desktop/desktop-auto-setting-modal.tsx +++ b/src/modal/desktop/desktop-auto-setting-modal.tsx @@ -10,12 +10,12 @@ import { notify } from '@/lib/notify' import { useModalStore } from '@/store' import { useAuthStore } from '@/store/auth' import { - type AutoHostingStopRules, selectSelectionTotal, useGameAutoHostingStore, useGameRoundStore, useGameSessionStore, } from '@/store/game' +import type { AutoHostingStopRules } from '@/type' function parseAmount(value: string) { const parsed = Number(value) diff --git a/src/modal/mobile/mobile-auto-setting-modal.tsx b/src/modal/mobile/mobile-auto-setting-modal.tsx index ab3addd..f910bf2 100644 --- a/src/modal/mobile/mobile-auto-setting-modal.tsx +++ b/src/modal/mobile/mobile-auto-setting-modal.tsx @@ -10,12 +10,12 @@ import { notify } from '@/lib/notify' import { useModalStore } from '@/store' import { useAuthStore } from '@/store/auth' import { - type AutoHostingStopRules, selectSelectionTotal, useGameAutoHostingStore, useGameRoundStore, useGameSessionStore, } from '@/store/game' +import type { AutoHostingStopRules } from '@/type' function parseAmount(value: string) { const parsed = Number(value) diff --git a/src/schema/auth-schema.ts b/src/schema/auth-schema.ts index e7e69a7..a19fcf0 100644 --- a/src/schema/auth-schema.ts +++ b/src/schema/auth-schema.ts @@ -5,7 +5,8 @@ import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, } from '@/constants' -import type { LoginFormValues, RegisterFormValues } from '@/type' + +export type { LoginFormValues, RegisterFormValues } from '@/type' const usernameSchema = z .string() diff --git a/src/store/game/game-auto-hosting-store.ts b/src/store/game/game-auto-hosting-store.ts index 78177c8..eac83ba 100644 --- a/src/store/game/game-auto-hosting-store.ts +++ b/src/store/game/game-auto-hosting-store.ts @@ -1,12 +1,7 @@ import { create } from 'zustand' import { AUTO_HOSTING_DEFAULT_SINGLE_WIN_THRESHOLD } from '@/constants' -import type { - AutoHostingStopRules, - BetSelection, - GameAutoHostingStoreState, - StartAutoHostingInput, -} from '@/type' +import type { AutoHostingStopRules, GameAutoHostingStoreState } from '@/type' const DEFAULT_AUTO_HOSTING_RULES: AutoHostingStopRules = { stopIfBalanceBelow: { diff --git a/src/store/game/game-round-store.ts b/src/store/game/game-round-store.ts index acf2096..3c8c584 100644 --- a/src/store/game/game-round-store.ts +++ b/src/store/game/game-round-store.ts @@ -13,13 +13,9 @@ import type { Chip, GameCell, GameRoundSlice, - GameRoundStoreData, GameRoundStoreState, HistoryEntry, - RevealAnimationPhase, RevealAnimationState, - RewardAnimationType, - RoundPhase, RoundSnapshot, TrendEntry, } from '@/type' diff --git a/src/store/modal/modal-store.ts b/src/store/modal/modal-store.ts index 97033a6..4b25f7d 100644 --- a/src/store/modal/modal-store.ts +++ b/src/store/modal/modal-store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand' import { INITIAL_MODAL_VISIBILITY, MODAL_KEYS } from '@/constants' -import type { ModalKey, ModalStoreState } from '@/type' +import type { ModalStoreState } from '@/type' export { MODAL_KEYS }