Files
template-10260/types/global.d.ts
赵忠林 a3d7309fc7 feat(pages): 添加多个页面配置和实现文章管理功能
- 添加 .editorconfig、.eslintrc 和 .gitignore 配置文件
- 添加管理员文章管理页面配置和实现
- 添加医生申请、银行卡、客户管理页面配置和实现
- 添加用户地址和聊天消息页面配置
- 实现文章新增编辑功能,包括表单验证和图片上传
- 实现医生注册功能,包含头像上传和手机号获取
- 实现银行卡管理功能,支持默认地址设置
- 实现客户报备功能,包含7天保护期逻辑
- 实现在线开方页面配置
- 修复页面标题和样式配置问题
2025-12-25 14:07:47 +08:00

161 lines
3.5 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// <reference types="@tarojs/taro" />
// 静态资源模块声明
declare module '*.png' {
const content: string;
export default content;
}
declare module '*.gif' {
const content: string;
export default content;
}
declare module '*.jpg' {
const content: string;
export default content;
}
declare module '*.jpeg' {
const content: string;
export default content;
}
declare module '*.svg' {
const content: string;
export default content;
}
declare module '*.css' {
const content: Record<string, string>;
export default content;
}
declare module '*.less' {
const content: Record<string, string>;
export default content;
}
declare module '*.scss' {
const content: Record<string, string>;
export default content;
}
declare module '*.sass' {
const content: Record<string, string>;
export default content;
}
declare module '*.styl' {
const content: Record<string, string>;
export default content;
}
// 环境变量类型定义
declare namespace NodeJS {
interface ProcessEnv {
/** NODE 内置环境变量, 会影响到最终构建生成产物 */
NODE_ENV: 'development' | 'production' | 'test';
/** 当前构建的平台 */
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd';
/**
* 当前构建的小程序 appid
* @description 若不同环境有不同的小程序,可通过在 env 文件中配置环境变量`TARO_APP_ID`来方便快速切换 appid 而不必手动去修改 dist/project.config.json 文件
* @see https://taro-docs.jd.com/docs/next/env-mode-config#特殊环境变量-taro_app_id
*/
TARO_APP_ID: string;
/** API基础URL */
API_BASE_URL?: string;
/** 应用名称 */
APP_NAME?: string;
/** 调试模式 */
DEBUG?: string;
}
}
// 全局常量类型定义
declare const API_BASE_URL: string;
declare const APP_NAME: string;
declare const DEBUG: string;
// 基础类型定义
declare global {
/** 通用ID类型 */
type ID = string | number;
/** 时间戳类型 */
type Timestamp = number;
/** 可选的字符串或数字 */
type StringOrNumber = string | number;
/** 分页参数基础类型 */
interface BasePaginationParams {
page?: number;
limit?: number;
sort?: string;
order?: 'asc' | 'desc';
}
/** 分页响应基础类型 */
interface BasePaginationResponse<T = any> {
list: T[];
count: number;
page?: number;
limit?: number;
totalPages?: number;
}
/** API响应基础类型 */
interface BaseApiResponse<T = any> {
code: number;
message?: string;
data?: T;
timestamp?: Timestamp;
}
/** 基础实体类型 */
interface BaseEntity {
id?: ID;
createTime?: string;
updateTime?: string;
createBy?: string;
updateBy?: string;
}
/** 树形结构基础类型 */
interface BaseTreeNode<T = any> {
id: ID;
parentId?: ID;
children?: T[];
level?: number;
}
/** 选项类型 */
interface Option<T = StringOrNumber> {
label: string;
value: T;
disabled?: boolean;
children?: Option<T>[];
}
/** 文件上传类型 */
interface UploadFile {
uid: string;
name: string;
status: 'uploading' | 'done' | 'error';
url?: string;
size?: number;
type?: string;
}
/** 地址信息类型 */
interface AddressInfo {
province: string;
city: string;
district: string;
detail: string;
postalCode?: string;
longitude?: number;
latitude?: number;
}
/** 联系信息类型 */
interface ContactInfo {
name: string;
phone: string;
email?: string;
}
}