UNPKG

@flesh-and-blood/search

Version:

TypeScript search engine for Flesh and Blood cards

27 lines (26 loc) 951 B
import { Card, DoubleSidedCard, Foiling, Printing, Release, Treatment } from "@flesh-and-blood/types"; import { AppliedFilter, SpecialConditions } from "./filters"; export interface SearchCard extends DoubleSidedCard { matchingPrintings?: Printing[]; } export interface SearchResults { appliedFilters: AppliedFilter[]; keywords: string[]; attributes: { artists: string[]; foilings: Foiling[]; releases: Release[]; treatments: Treatment[]; }; searchResults: SearchCard[]; } declare class Search { private cards; private debug; private fuse; constructor(cards: DoubleSidedCard[], debug?: boolean); log: (message?: any, ...optionalParams: any[]) => void; search: (text: string, includeMemes?: boolean) => SearchResults; } export default Search; export declare const filterCard: (card: Card, appliedFilters: AppliedFilter[], specialConditions: SpecialConditions) => boolean;