import type { BanlistEntry, Card, CardName, CardSummary, Erratum, Game, PatchNote, Rule, RuleBook, RuleHit, Ruling, SearchAllResult, Section, Term } from "./types.ts"; /** How a caller narrows a rulings read. Every field is a filter, and all combine. */ export type RulingListOptions = { /** Rulings that name this piece. Matched on the normalized name. */ cardName?: string; kind?: "card" | "general" | "policy"; topic?: string; limit?: number; }; /** Paging and scoping options shared by the list reads. */ export type ListOptions = { ruleBookId?: string; sectionId?: string; limit?: number; offset?: number; }; export type SearchOptions = { limit?: number; ruleBookId?: string; /** * Include rows a rulebook marks as superseded. Off by default: a deprecated * rule quoted as current is a wrong answer, not an incomplete one. */ includeDeprecated?: boolean; }; /** * Everything the rules assistant can read. * * Every method returns a promise even where the shipped stores answer from * memory or from a local file. The cost of awaiting a resolved value is nothing, * and the alternative bars anybody from backing this with a database or a * service of their own without changing every caller. * * Nothing here writes. A rules assistant reads a corpus and quotes it; a store * that can also change it is a store that can be talked into changing it. */ export interface RuleStore { /** The game this corpus describes. */ game(): Promise; listRuleBooks(): Promise; listSections(options?: ListOptions): Promise; getRule(id: string): Promise; /** * One rule by its printed number. * * Numbers repeat across rulebooks, so this can be ambiguous. Pass * `ruleBookId` when the caller knows which book it means; without it the * store returns the match in the first active rulebook, in order. */ getRuleByNumber(ruleNumber: string, options?: { ruleBookId?: string; }): Promise; getRuleBySlug(slug: string, options?: { ruleBookId?: string; }): Promise; listRules(options?: ListOptions): Promise; searchRules(query: string, options?: SearchOptions): Promise; getChildren(id: string): Promise; getParent(id: string): Promise; getSiblings(id: string): Promise; /** The rules this one points at, resolved from its cross-references. */ getRelated(id: string, options?: { limit?: number; }): Promise; listTerms(options?: { limit?: number; category?: string; }): Promise; getTerm(idOrSlug: string): Promise; searchTerms(query: string, options?: { limit?: number; }): Promise; listErrata(options?: { cardName?: string; limit?: number; }): Promise; listBanlist(options?: { cardName?: string; format?: string; limit?: number; }): Promise; listPatchNotes(options?: { category?: string; limit?: number; }): Promise; getPatchNote(slugOrId: string): Promise; /** * Rulings, filtered. Optional, and that is deliberate. * * Rulings arrived after this interface did, so a store somebody wrote against * an earlier version still satisfies it. The absence is also the gate: a store * that cannot answer with rulings is never offered a rulings tool, which is * the same rule that keeps an empty banned list from growing a tool. */ listRulings?(options?: RulingListOptions): Promise; /** Rulings matching a query, best first. Superseded rulings are left out. */ searchRulings?(query: string, options?: { limit?: number; }): Promise; /** * The ruling that asks this exact question, or null. * * Both sides are folded by `normalizeQuestion`, so case, spacing, accents, and * a trailing question mark do not matter. Nothing else does: this is an equality * test, not a search. A near miss must return null and let the agent answer, * because a published question and answer belong to each other, and pairing one * publisher's answer with a question it was not written for is an invented claim. * * A live ruling comes back before a withdrawn one when two ask the same thing. */ getRulingByQuestion?(question: string): Promise; /** Card identities matching a name. Ranked: exact, then prefix, then text. */ searchCards(query: string, options?: { limit?: number; }): Promise; /** Full cards by id, in the order asked. Ids that match nothing are omitted. */ getCards(ids: string[]): Promise; /** * Every printed name. * * This is the proof a card EXISTS, which a legality answer needs before it can * say "not banned". A banlist that omits a name says nothing about a name * nobody can find, so without this list the honest answer is no answer. */ allCardNames(): Promise; /** Rules, terms, errata, banlist, and patch notes in one pass. */ searchAll(query: string, options?: { limit?: number; }): Promise; /** Release any handle the store holds. Safe to call more than once. */ close(): Promise; } //# sourceMappingURL=store.d.ts.map