# @flesh-and-blood/types 中文文档

规范地址：https://npmcn.com/package/%40flesh-and-blood/types/

版本：7\.3\.3
npm 元数据更新时间：2026-11-01T03:28:09.848Z
中文译文更新时间：2026-11-01T04:06:30.198Z
软件包许可：MIT

本文由上游 README 机器翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40flesh-and-blood/types
原文对照：https://npmcn.com/package/%40flesh-and-blood/types/?lang=original
项目主页：https://github.com/fabrary/cards#readme
源码仓库：https://github.com/fabrary/cards

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：102 kB，21 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2023-09-14T02:48:14.576Z
- 最新版本发布：2026-11-01T03:28:09.664Z
- 已发布版本数：371（近 12 个月 112 个）

## 中文简介

血肉卡牌类型的TypeScript表示

## 安装

```sh
npm install @flesh-and-blood/types
```

也可以使用：`pnpm add @flesh-and-blood/types`、`yarn add @flesh-and-blood/types`、`bun add @flesh-and-blood/types`

## README

# @flesh-and-blood /类型

的枚举、接口和纯帮助函数 **血肉之躯** 卡片。这是底边 包, [`@flesh-and-blood/cards`](https://npmcn.com/package/%40flesh-and-blood/cards) 和 [`@flesh-and-blood/search`](https://npmcn.com/package/%40flesh-and-blood/search) 依赖。 它没有运行时依赖项。

## 安装

```bash
npm i @flesh-and-blood/types
```

出版 **双ESM + CJS**工作在捆绑器、本地Node ESM和CommonJS中。

## 使用

```ts
import { Hero, Rarity, getDefaultPrinting } from "@flesh-and-blood/types";
```

数据和助手模块也可以作为子路径导入，所以你可以只拉入你需要的：

```ts
import { ReleaseType, getIsBooster } from "@flesh-and-blood/types/sets";
import { getDefaultPrinting } from "@flesh-and-blood/types/helpers";
import type { Card } from "@flesh-and-blood/types/interfaces";
```

## 包括什么

导出的TypeScript类型是精确值和字段的真实来源；下面的列表是 概述。

### 枚举

`Bond`， `Class`， `Flow`， `Foiling`， `Format`， `Fusion`， `Hero`， `Keyword`， `Language`， `Meta`， `Metatype`， `Rarity`， `Release`， `ReleaseEdition`， `ReleaseType`， `Shorthand`， `Subtype`， `Talent`， `Trait`， `Treatment`， `Type`.

### 接口

`Card` （主卡形）， `DoubleSidedCard`， `Printing`， `ReleaseInfo`.

### 助手: `@flesh-and-blood/types/helpers`

-   **印刷器:** `getPrint`， `getDefaultPrinting`， `getSpecialPrinting`， `getMaxRarityPrinting`
-   **过滤值:** `getNormalizedFilterValue`， `PUNCTUATION`
-   **卡属性:** `getCardIdentifier`， `getFrontAndBackCardIdentifier`， `getCardFromGEMCardIdentifier`， `getIsArenaCard`， `getIsDeckCard`， `getIsCardTokenForDeck`， `getCanCardBeTokenForDeck`， `getCanAddToDeck`， `getShouldRotateCardImage`， `getFamilyName`， `getBaselineHero`

### 释放的词汇: `@flesh-and-blood/types/sets`

`Language`， `ReleaseType` 和 `ReleaseInfo` 记录类型，加上 `getIsBooster`， `getIsReprint`， `getIsDraftable`， `getIsPreconstructed`。发布记录本身随卡数据一起发货，如 `releases` 从 `@flesh-and-blood/cards`.

## 参与这个项目

来源生活在 `src/` （`interfaces.ts`， `sets.ts`， `helpers/`）。

```bash
npm run build   # build:esm (per-file ESM, tree-shakeable) + build:cjs (bundled) + tsc declarations
npm test        # vitest
```

## 常见问题

### @flesh-and-blood/types 是什么？

血肉卡牌类型的TypeScript表示

### 如何安装 @flesh-and-blood/types？

在项目目录运行 npm install @flesh-and-blood/types，或使用 pnpm add / yarn add / bun add。

### @flesh-and-blood/types 支持 TypeScript 吗？

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

### @flesh-and-blood/types 支持 ESM 还是 CommonJS？

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

### @flesh-and-blood/types 可以商用吗？

@flesh-and-blood/types 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @flesh-and-blood/types 还在维护吗？

最新版本 7\.3\.3 发布于 2026/11/01（2 天前）；至今共发布 371 个版本，其中过去 12 个月发布了 112 个；首次发布于 2023/09/14。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

