@xz-fe/base-ts
v1.0.14
Published
Data type definition of base-ts
Keywords
Readme
xz-fe/base-ts(讯众基础ts常量库)
公共数据/常量描述
使用方式
npm install @xz-fe/base-tsimport { NSC } from '@xz-fe/base-ts';
const reponse = {
code: 7000,
msg: '用户未登录'
}
if (reponse.code === NSC.Code.UserNoLogin) {
alert(reponse.msg);
}类型解释
如无特殊需求,采用interface而非type。
Project: 表示Project相关类型定义。Project.Ext: 扩展项命名空间,比如Project.Ext.PropertiesProject.Param: 参数命名空间,比如Project.Param.Create
如有整合需求,可使用Util.Merge进行手动组合
关于types的一些高级用法参看 https://www.typescriptlang.org/docs/handbook/utility-types.html#partialt
