chore: establish V1.1 recovery baseline
This commit is contained in:
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
// 全局类型声明 — 供 miniapp TypeScript 页面使用
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
|
||||
// Page 全局声明(微信小程序全局函数)
|
||||
declare function Page<T>(obj: T & WechatMiniprogram.Page.ILifetime): void;
|
||||
|
||||
// Stores 模块声明
|
||||
declare module '../../stores' {
|
||||
export const authStore: {
|
||||
state: { isLoggedIn: boolean; userId: string | null; phoneBound: boolean; authStatus: string; lastError: any }
|
||||
loginWithWechat: (code: string) => Promise<any>
|
||||
logout: () => Promise<void>
|
||||
}
|
||||
export const userStore: {
|
||||
state: { userState: any; profile: any }
|
||||
hydrate: () => void
|
||||
fetchStatus: () => Promise<void>
|
||||
subscribe: (cb: (state: any) => void) => () => void
|
||||
bindToPage: (page: any, fields: Record<string, string>) => () => void
|
||||
}
|
||||
export const matchStore: {
|
||||
state: { recommendations: any[]; recState: string; likersCount: number; matches: any[] }
|
||||
fetchRecommendations: () => Promise<void>
|
||||
loadMoreRecommendations: () => Promise<void>
|
||||
fetchLikersCount: () => Promise<void>
|
||||
like: (userId: string) => Promise<any>
|
||||
pass: (userId: string) => Promise<void>
|
||||
block: (userId: string, reason?: string) => Promise<void>
|
||||
unmatch: (matchId: string) => Promise<void>
|
||||
confirmSuccess: (matchId: string) => Promise<any>
|
||||
subscribe: (cb: (state: any) => void) => () => void
|
||||
bindToPage: (page: any, fields: Record<string, string>) => () => void
|
||||
}
|
||||
export const messageStore: {
|
||||
state: { conversations: any[]; currentConversationId: string | null; connectionState: string }
|
||||
openConversation: (id: string) => Promise<void>
|
||||
closeConversation: () => void
|
||||
fetchConversations: () => Promise<void>
|
||||
markConversationRead: (id: string) => Promise<void>
|
||||
markConversationBlocked: (id: string) => void
|
||||
onMessage: (convId: string, cb: (msg: any) => void) => () => void
|
||||
subscribe: (cb: (state: any) => void) => () => void
|
||||
bindToPage: (page: any, fields: Record<string, string>) => () => void
|
||||
}
|
||||
export const appStore: {
|
||||
state: { loading: boolean }
|
||||
init: () => Promise<void>
|
||||
toast: (msg: string) => void
|
||||
toastSuccess: (msg: string) => void
|
||||
toastError: (msg: string, fallback?: string) => void
|
||||
showLoading: (msg?: string) => void
|
||||
hideLoading: () => void
|
||||
confirm: (opts: { title: string; content: string; confirmText: string; danger?: boolean }) => Promise<boolean>
|
||||
}
|
||||
export const blockUser: (userId: string, reason?: string) => Promise<void>
|
||||
export const likeUser: (userId: string) => Promise<any>
|
||||
}
|
||||
|
||||
// Constants 模块声明
|
||||
declare module '../../constants' {
|
||||
export const ROUTE: {
|
||||
TAB: { HOME: string; DISCOVER: string; MESSAGES: string; ACTIVITY: string; MINE: string }
|
||||
MAIN: { DISCOVER: string; FATE_CENTER: string }
|
||||
DETAIL: { PROFILE_DETAIL: string; ACTIVITY_REGISTER: string; MATCHMAKER_APPLY: string; LIKERS: string; MATCHMAKER_PROGRESS: string }
|
||||
REVIEW: { PENDING: string; REJECTED: string; ACCOUNT_STATUS: string }
|
||||
AUTH: { LOGIN: string }
|
||||
}
|
||||
export const to: {
|
||||
detail: (userId: string) => string
|
||||
chat: (convId: string) => string
|
||||
report: (userId: string) => string
|
||||
}
|
||||
export const BUSINESS_LIMITS: { MAX_PROFILE_PHOTOS: number }
|
||||
export const RECOMMENDATION_STATE: { IDLE: string; LOADING: string; ERROR: string; EMPTY: string }
|
||||
export const PROFILE_REVIEW: { NOT_SUBMITTED: string; PENDING: string; APPROVED: string; NEED_EDIT: string; REJECTED: string }
|
||||
export const ACCOUNT_STATUS: { NORMAL: string; BANNED: string; SUSPENDED: string }
|
||||
export const DANGER_ACTION: { BLOCK: string; UNMATCH: string }
|
||||
export const BUSINESS_ERROR_CODE: { PROFILE_NOT_APPROVED: string; ACCOUNT_BANNED: string }
|
||||
}
|
||||
Reference in New Issue
Block a user