Class BasicCollection
Hierarchy
- AbstractCollection
- BasicCollection (View Summary)
Index
Constructors
Accessors
Methods
Constructors
constructor
- new BasicCollection(
options: {
cards: CardSorted[];
dirpath?: string;
meta?: MetadataCommon;
sortByKind?: boolean;
},
): BasicCollectionParameters
- options: {
cards: CardSorted[];
dirpath?: string;
meta?: MetadataCommon;
sortByKind?: boolean;
}cards: CardSorted[]
Cards associated with this collection.
Optionaldirpath?: stringThe subdirectory for this collection.
Optionalmeta?: MetadataCommonCardDB metadata from source of cards.
OptionalsortByKind?: boolean
Returns BasicCollection
- options: {
Accessors
cards
Returns CardSorted[]
All cards for the format.
dirpath
- get dirpath(): string
Returns the subdirectory for this collection.
Returns string
mergeMark
Returns any set of collection import file names marked for merging.
Returns Set<string>
meta
- get meta(): Readonly<
| Omit<MetadataInventory, keyof MetadataGenerated>
| Omit<MetadataSorted, keyof MetadataGenerated>
| Omit<MetadataSortedFormat, keyof MetadataGenerated>,
>Returns Readonly<
| Omit<MetadataInventory, keyof MetadataGenerated>
| Omit<MetadataSorted, keyof MetadataGenerated>
| Omit<MetadataSortedFormat, keyof MetadataGenerated>,
>Collection metadata.
name
- get name(): string
Returns string
Collection name / ID.
printName
- get printName(): string
Returns string
A printable / punctuated version of the collection name.
size
- get size(): number
Returns number
Count of cards in this format.
Methods
calculateMarked
Calculate any
markmerging.Parameters
- mark: Set<string>
A set of CSV file names in the conversion process to mark / highlight for merging.
Returns CardSorted[]
- mark: Set<string>
entries
Returns MapIterator<[string, CardCategory<CardSorted>]>
Entry iterator of sorted categories in collection.
get
Get a specific sorted category.
Parameters
- key: string
SortedCategory key / name.
Returns CardCategory<CardSorted>
- key: string
getCardGroup
Returns the group name this card belongs to if any..
Parameters
- card: Card
Returns keyof MetadataGroups<string[]>
getSortOptions
Returns the most recently applied sort configuration.
Returns Readonly<SortOptions>
Any sort options applied.
has
Does this collection have a specific card category.
Parameters
- key: string
CardCategory key / name.
Returns boolean
Whether this collection has the card category.
- key: string
isCardGroup
Checks the meta external file names for a card file name match.
Parameters
- card: Card
Card to test.
- group: keyof MetadataGroups<string[]>
External card group to test for inclusion.
Returns boolean
- card: Card
keys
Returns MapIterator<string>
Key iterator of sorted categories in collection.
resetMarked
Resets any cards marked for merging.
Returns void
sort
Parameters
- options: { alpha?: boolean; type?: boolean }
Sort options to apply.
Optionalalpha?: booleanSort by alphabetical name.
Optionaltype?: booleanSort by normalized type.
Returns void
- options: { alpha?: boolean; type?: boolean }
values
Returns MapIterator<CardCategory<CardSorted>>
Iterator of category groups.
Required options.