Files
youlai-app/src/types/global.d.ts
T
Ray.Hao 89734a909e chore(types): 删除与 uni-types 重复的原生组件声明
- 原生组件类型由 @uni-helper/uni-types 提供,手写声明冗余
- 去掉由 types 数组统一加载的重复三斜线引用
2026-11-08 00:40:32 +08:00

57 lines
975 B
TypeScript

// 全局类型声明文件
/// <reference types="@uni-helper/vite-plugin-uni-pages/client" />
declare global {
/**
* 微信小程序全局对象
*
* 条件编译内的 `wx` 在微信端运行时存在,但 vue-tsc 仍会解析源码,
* 因此这里提供最小声明,避免页面直接报未定义
*/
const wx: {
request(options: UniApp.RequestOptions): void;
};
/**
* 分页查询参数
*/
interface PageQuery {
pageNum: number;
pageSize: number;
}
/**
* 分页响应对象
*/
interface PageResult<T> {
/** 数据列表 */
list: T[];
/** 总数 */
total: number;
}
/**
* 组件数据源
*/
interface OptionType {
/** 值 */
value: string | number;
/** 文本 */
label: string;
/** 子列表 */
children?: OptionType[];
}
/**
* 响应数据
*/
interface ApiResponse<T = any> {
code: string;
data: T;
msg: string;
}
}
export {};