import type { ThunkAction, ThunkDispatch } from "redux-thunk"
import store from "@/store"
import type { RootResData } from "./data"
import { updateUserType } from "@/store/actions/profile"
export type RootStore = ReturnType<typeof store.getState>
export type RootThunkAction = ThunkAction<
void,
RootStore,
unknown,
action<RootResData |string>
>
export type AppThunkDispatch = ThunkDispatch<
RootSate,
unknown,
action<RootResData |string>
>
export type actionType =
| "login/token"
| "user/get"
| "profile/getUserProfile"
| "profile/update"
| "profile/photo"
export type action<P> = {
type: actionType
payload: P
}
export type ActionCreator<P> = (payload: P) => action<P>
export type ReducerCreator<P, A = action<P>> = (state: P, action: A) => P
import { updateUserType } from "@/store/actions/profile"
interface ResponseData<D> {
message: string
data: D
}
export type Token = {
token: string
refresh_token: string
}
export type User = {
id: string
name: string
photo: string
art_count: number
follow_count: number
fans_count: number
like_count: number
}
export type UserEditor = {
id: string
name: string
photo: string
mobile: string
gender: string
birthday: string
intro?: string
}
export type ProfileType = {
user: User
userProfile: UserEditor
}
export type UserPhoto = {
id?: string
photo: string
}