@flesh-and-blood /类型
的枚举、接口和纯帮助函数 血肉之躯 卡片。这是底边
包, @flesh-and-blood/cards 和 @flesh-and-blood/search 依赖。
它没有运行时依赖项。
安装
npm i @flesh-and-blood/types
出版 双ESM + CJS工作在捆绑器、本地Node ESM和CommonJS中。
使用
import { Hero, Rarity, getDefaultPrinting } from "@flesh-and-blood/types";
数据和助手模块也可以作为子路径导入,所以你可以只拉入你需要的:
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/)。
npm run build # build:esm (per-file ESM, tree-shakeable) + build:cjs (bundled) + tsc declarations
npm test # vitest