import type { ReadabilityFormula } from '../metrics/index.js'; export interface SwapAssertion { ignoreCase?: boolean; wordBoundary?: boolean; keysAreRegex?: boolean; pairs: Record; /** * Whether inline code spans (`` `like this` ``) are scanned for matches. * Default `false`: a match inside inline code is skipped (by range, not * by masking the text -- see core/inline-code.ts), so a swap pair like * `master -> primary` doesn't fire inside `` `git checkout master` ``. * Set `true` to scan code spans too. */ includeCode?: boolean; } export interface PatternAssertion { tokens: string[]; ignoreCase?: boolean; nonword?: boolean; /** * Whether inline code spans (`` `like this` ``) are scanned for matches. * Default `false`: a match inside inline code is skipped (by range, not * by masking the text -- see core/inline-code.ts), so a token like * `master` doesn't fire inside `` `git checkout master` ``. Set `true` * to scan code spans too. */ includeCode?: boolean; } export interface SemanticLineBreaksAssertion { mode: 'sentence' | 'phrase'; maxPhrase?: number; ignoreCodeBlocks?: boolean; ignoreTables?: boolean; } export interface MaxImageSizeAssertion { /** Maximum image size in KB. Default: 100 */ maxSizeKB?: number; /** File extensions to check. Default: ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'] */ extensions?: string[]; } export interface OccurrenceAssertion { pattern: string; min?: number; max?: number; ignoreCase?: boolean; } export interface RepetitionAssertion { pattern?: string; ignoreCase?: boolean; } export interface ConsistencyAssertion { either: Record; ignoreCase?: boolean; } export interface ConditionalAssertion { first: string; second: string; ignoreCase?: boolean; } export interface CapitalizationAssertion { match: string; exceptions?: string[]; style?: 'ap' | 'chicago'; builtinVocabulary?: boolean; } export interface MetricAssertion { formula: ReadabilityFormula; min?: number; max?: number; } export interface SpellingAssertion { /** * Base path (WITHOUT the `.aff`/`.dic` extension) to a custom Hunspell * dictionary pair, resolved relative to `process.cwd()` unless absolute. * Omit to use the default English dictionary (`dictionary-en`). */ dictionary?: string; /** Extra known-good words, matched case-insensitively; never flagged. */ vocab?: string[]; /** * Regex patterns; a token matching any of them is never flagged. An * invalid pattern is silently ignored. */ ignore?: string[]; /** * Default `true`: whether `../data/proper-nouns.ts`'s * `TECHNICAL_PROPER_NOUNS` is unioned into the accepted-word set alongside * `vocab` -- see spelling.ts's `execute`. Multi-token entries are split on * whitespace/dots and each part accepted individually (correct for a * per-word spell check, unlike `capitalization`'s whole-phrase matching -- * see spelling.ts's doc comment for that asymmetry). Set `false` to * restore strict pre-built-in behavior. */ builtinVocabulary?: boolean; } export interface LengthAssertion { unit: 'characters' | 'words' | 'sentences'; min?: number; max?: number; } /** * Escape-hatch options shape for the 53 markdownlint-parity token rules * (`line-length`, `ul-style`, `no-duplicate-heading`, `heading-style`, and * so on — see `rules/token/index.ts`'s `allTokenRules`). Each token rule * declares its own option names and defaults on its `TokenRule.defaults` * object (see e.g. `rules/token/line-length.ts`) rather than a dedicated * named interface here — there are too many (and they change too often * across rule ports) to keep in lockstep with hand-written interfaces * without one inevitably drifting. This permissive index signature is what * lets a typed `RecheckConfig` literal set e.g. * `assertions: { 'line-length': { lineLength: 120 } }` without TS2353; * runtime shape checking for token-rule options happens in each rule's own * `check()`, not at the type level. */ export interface TokenRuleOptions { [option: string]: unknown; } export type AssertionConfig = SwapAssertion | PatternAssertion | SemanticLineBreaksAssertion | MaxImageSizeAssertion | OccurrenceAssertion | RepetitionAssertion | ConsistencyAssertion | ConditionalAssertion | CapitalizationAssertion | MetricAssertion | SpellingAssertion | LengthAssertion | TokenRuleOptions; //# sourceMappingURL=assertions.d.ts.map