Reference · Collections and piles: pure helpers
CollectionMetadatatype
What a collector writes about a card: its set, year, number, edition, condition, grade, quantity and notes. All optional; year and quantity are whole numbers.
Import it
import type { CollectionMetadata } from "@johnmorrisdotca/fuda-cards/collection";
Definition
interface CollectionMetadata {
set?: string;
year?: number;
number?: string;
edition?: string;
condition?: string;
grade?: string;
quantity?: number;
notes?: string;
}
Members
| Name | Type | Description |
|---|---|---|
set (optional) | string | undefined | |
year (optional) | number | undefined | |
number (optional) | string | undefined | |
edition (optional) | string | undefined | |
condition (optional) | string | undefined | |
grade (optional) | string | undefined | |
quantity (optional) | number | undefined | |
notes (optional) | string | undefined |
Examples
import { parseCollection, type CollectionMetadata } from "@johnmorrisdotca/fuda-cards/collection";
const metadata: CollectionMetadata = { set: "Base", year: 1999, quantity: 2 };
console.log(parseCollection([{ name: "Card", image: "c.jpg", metadata }])[0].metadata);
// { set: 'Base', year: 1999, quantity: 2 }{ set: 'Base', year: 1999, quantity: 2 }What it prints (run when this page was built)