@weliant-inc/weliant-types

中文文档
1.0.93发布于 2026/11/03UNLICENCEDTypeScriptESM + CJS零依赖

Shared request, response and constant types for weliant-be, weliant-fe and weliant-landing. Consumers link this folder by local path and read the built dist/, so run npm run build after every change.

原始使用文档

weliant-types

Shared request, response and constant types for weliant-be, weliant-fe and weliant-landing. Consumers link this folder by local path and read the built dist/, so run npm run build after every change.

Conventions

  • Value enums are a type + const pair, never a TS enum:

    export type ApplicationStatus = "PENDING" | "ACCEPTED" | "REJECTED";
    export const ApplicationStatus = {
      PENDING: "PENDING",
      ACCEPTED: "ACCEPTED",
      REJECTED: "REJECTED",
    } as const satisfies { [K in ApplicationStatus]: K };
    
  • Responses carry every field. Nullable fields are T | null, never ?:.

  • Dates are ISO-8601 strings, never Date.

  • Requests for create/edit forms are full replace: a new optional field is a required key typed T | null, so "unset" is always explicit.

  • Naming: XResponse, XResponseList (list item), XCreateRequest, XEditRequest, XFilters.

  • Folder shape: src/<domain>/{enums,requests,responses,filters,constants}/index.ts, plus src/<domain>/index.ts re-exporting the subfolders that exist. Every domain is exported from src/index.ts.

  • Doc comments state the meaning of null and any rule a consumer must not break.

  • Double quotes, 2-space indentation.

Public careers API

src/publicCareers is a contract third parties (agency websites) code against. Keep it additive once shipped: add fields, never rename or remove them.

版本与发布记录

@weliant-inc/weliant-types 共发布 9 个版本,首次发布于 2026/03/11;过去 12 个月发布了 9 个版本。

版本发布日期距今
1.0.93latest2026/11/03今天
1.0.922026/11/021 天前
1.0.902026/05/105 个月前
1.0.892026/04/206 个月前
1.0.872026/03/227 个月前
1.0.862026/03/187 个月前

关于 @weliant-inc/weliant-types 的常见问题

@weliant-inc/weliant-types 是什么?

对接、对接、对接的共享请求、响应和常量类型。使用者通过本地路径链接此文件夹,并读取构建的 dist/运行吧 npm run build 每次改变之后。

如何安装 @weliant-inc/weliant-types?

在项目目录运行 npm install @weliant-inc/weliant-types,或使用 pnpm add / yarn add / bun add。

@weliant-inc/weliant-types 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@weliant-inc/weliant-types 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@weliant-inc/weliant-types 可以商用吗?

@weliant-inc/weliant-types 使用 UNLICENCED 许可。声明的许可为 UNLICENCED,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@weliant-inc/weliant-types 还在维护吗?

最新版本 1.0.93 发布于 2026/11/03(今天);至今共发布 9 个版本,其中过去 12 个月发布了 9 个;首次发布于 2026/03/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。