@tplc/business
Version:
70 lines (68 loc) • 1.48 kB
TypeScript
import { LcbActionViewProps } from './components/lcb-action-view/types'
export interface ActionView {
title: string
icon?: string
link: LcbActionViewProps
url?: string
mode: number
hotSpot?: {
x: number
y: number
width: number
height: number
link: LcbActionViewProps
}[]
}
export type IResData<T> = {
code: number | string
msg: string
data: T
}
export interface DataSource {
source?: 'remote' | 'context' | 'user'
requestInfo?: {
requestUrl: string
requestParams: string
}
/** 动态key */
dependKey?: string
}
export interface LcbGlobal {
http: {
get<T>(url: string, query?: Record<string, any> | undefined): Promise<IResData<T>>
post<T>(
url: string,
data?: Record<string, any> | undefined,
hideLoadingToast?: boolean,
): Promise<IResData<T>>
}
navigateTo: (url: string) => void
loadingStore?: () => {
changeLoading: (path: string, loading: boolean) => void
}
userStore?: () => {
userInfo: Record<string, any>
updateUser: (data: Record<string, any>, isLogin?: boolean) => void
getUser: () => void
}
constantsStore?: () => {
mainConfig?: Record<string, any>
}
getIsTabbar: () => boolean
layoutId: string
internalPages: {
webview: string
search: string
setting: string
home: string
orderList: string
authPhone: string
userEdit: string
drawdown: string
}
}
global {
interface Uni {
$lcb: LcbGlobal
}
}