# 简介
任意 Any 元组 枚举enum
||||
var [变量名]: [类型] = 值
as
函数指定返回值类型
ts特有的,不能转为js ?表示可选参数
declare namespace API {
interface IUser {
id: number,
userId: string,
userName: string,
password: string,
status: string,
createId: string,
createTims: Date,
modifyId: string,
modifyTime: Date
}
interface TableParams {
pagination?: TablePaginationConfig;
sortField?: string;
sortOrder?: string;
filters?: Record<string, FilterValue>;
}
interface PageInfo {
total?: number,
pageSize?: number,
pageNum?: number,
list?: any[]
}
}
和声明文件.d.ts联用
ts中一些注释会影响报错,例如: 忽略ts检查
// @ts-ignore
https://www.runoob.com/w3cnote/getting-started-with-typescript.html