Class AbstractCollectionAbstract
Hierarchy
- AbstractCollection (View Summary)
Index
Constructors
Accessors
Methods
Constructors
constructor
- new AbstractCollection(
__namedParameters: {
cards: CardSorted[];
categories: Map<string, CardCategory<CardSorted>>;
dirpath: string;
meta?: MetadataCommon;
},
): AbstractCollectionParameters
- __namedParameters: {
cards: CardSorted[];
categories: Map<string, CardCategory<CardSorted>>;
dirpath: string;
meta?: MetadataCommon;
}
Returns AbstractCollection
- __namedParameters: {
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[]>
AbstractgetSortOptions
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
Abstractsort
Applies sorting to the collection using the provided configuration.
Implementations must:
- Reorder the collection deterministically according to the supplied options.
- Propagate sorting behavior to any underlying categories or grouped views.
- Persist the applied sort configuration so it may be retrieved later by `getSortOptions`.Calling this method should fully define the active ordering state of the collection.
Parameters
- options: SortOptions
Sorting configuration flags.
Returns void
- options: SortOptions
values
Returns MapIterator<CardCategory<CardSorted>>
Iterator of category groups.
Base class for a sorted collection of cards by categories.