@flesh-and-blood/types

中文文档
7.3.3发布于 2026/11/01MITTypeScriptESM + CJS零依赖

TypeScript representations of Flesh and Blood card types

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. What's included
  4. Enums
  5. Interfaces
  6. Helpers: @flesh-and-blood/types/helpers
  7. Release vocabulary: @flesh-and-blood/types/sets
  8. Working with this project

@flesh-and-blood/types

TypeScript enums, interfaces, and pure helper functions for Flesh and Blood cards. This is the base package that @flesh-and-blood/cards and @flesh-and-blood/search depend on. It has no runtime dependencies.

Installation

npm i @flesh-and-blood/types

Published as dual ESM + CJS: works in bundlers, native Node ESM, and CommonJS.

Usage

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

Data and helper modules are also available as subpath imports, so you can pull in just what you need:

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";

What's included

The exported TypeScript types are the source of truth for exact values and fields; the lists below are an overview.

Enums

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

Interfaces

Card (the main card shape), DoubleSidedCard, Printing, ReleaseInfo.

Helpers: @flesh-and-blood/types/helpers

  • Printing pickers: getPrint, getDefaultPrinting, getSpecialPrinting, getMaxRarityPrinting
  • Filter values: getNormalizedFilterValue, PUNCTUATION
  • Card properties: getCardIdentifier, getFrontAndBackCardIdentifier, getCardFromGEMCardIdentifier, getIsArenaCard, getIsDeckCard, getIsCardTokenForDeck, getCanCardBeTokenForDeck, getCanAddToDeck, getShouldRotateCardImage, getFamilyName, getBaselineHero

Release vocabulary: @flesh-and-blood/types/sets

Language, ReleaseType and the ReleaseInfo record type, plus getIsBooster, getIsReprint, getIsDraftable, getIsPreconstructed. The release records themselves ship with the card data, as releases from @flesh-and-blood/cards.

Working with this project

Source lives in src/ (interfaces.ts, sets.ts, helpers/).

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

版本与发布记录

@flesh-and-blood/types 共发布 371 个版本,首次发布于 2023/09/14;过去 12 个月发布了 112 个版本。

版本发布日期距今
7.3.3latest2026/11/012 天前
7.3.22026/11/012 天前
7.3.12026/10/304 天前
7.3.02026/10/295 天前
7.2.02026/10/285 天前
7.1.102026/10/286 天前

关于 @flesh-and-blood/types 的常见问题

@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 和提交记录判断。