import type { Reader } from "../reader"; import { Casing } from "./casing"; import { CompoundPattern } from "./compound-pattern"; import { CompoundRule } from "./compound-rule"; import { ConvTable } from "./conv-table"; import { PhonetTable } from "./phonet-table"; import { RepPattern } from "./rep-pattern"; import type { AffData, CharacterMap, Flag, Flags, FlagSet, OverridableAffData, PrefixIndex, PrefixMap, SuffixIndex, SuffixMap } from "./types"; export type { Flag, CharacterMap, PrefixMap, SuffixMap, PrefixIndex, SuffixIndex, Flags, FlagSet, AffData, OverridableAffData }; /** A resolved and parsed representation of the data found in a Hunspell `.aff` file. */ export declare class Aff implements AffData { SET: string; FLAG: "short" | "long" | "numeric" | "UTF-8"; LANG?: string; WORDCHARS?: string; IGNORE?: Set; CHECKSHARPS: boolean; FORBIDDENWORD?: string; KEY: string; TRY: string; NOSUGGEST?: Flag; KEEPCASE?: Flag; REP: Set; MAP: CharacterMap; NOSPLITSUGS: boolean; PHONE?: PhonetTable; MAXCPDSUGS: number; MAXNGRAMSUGS: number; MAXDIFF: number; ONLYMAXDIFF: boolean; PFX: PrefixMap; SFX: SuffixMap; NEEDAFFIX?: Flag; CIRCUMFIX?: Flag; COMPLEXPREFIXES: boolean; FULLSTRIP: boolean; BREAK: Set; COMPOUNDRULE: Set; COMPOUNDMIN: number; COMPOUNDWORDMAX?: number; COMPOUNDFLAG?: Flag; COMPOUNDBEGIN?: Flag; COMPOUNDMIDDLE?: Flag; COMPOUNDEND?: Flag; ONLYINCOMPOUND?: Flag; COMPOUNDPERMITFLAG?: Flag; COMPOUNDFORBIDFLAG?: Flag; FORCEUCASE?: Flag; CHECKCOMPOUNDCASE: boolean; CHECKCOMPOUNDDUP: boolean; CHECKCOMPOUNDREP: boolean; CHECKCOMPOUNDTRIPLE: boolean; CHECKCOMPOUNDPATTERN: Set; SIMPLIFIEDTRIPLE: boolean; COMPOUNDSYLLABLE?: [number, string]; COMPOUNDMORESUFFIXES: boolean; COMPOUNDROOT?: Flag; ICONV?: ConvTable; OCONV?: ConvTable; AF: Flags[]; AM: Set[]; WARN?: Flag; FORBIDWARN: boolean; SYLLABLENUM?: string; SUBSTANDARD?: Flag; /** * The {@link Casing} instance for this data. Usually just a normal * {@link Casing} instance, but it may also be {@link GermanCasing}, * {@link TurkicCasing}, or something else entirely depending on configuration. */ casing: Casing; /** An index, more specifically a {@link Trie}, of {@link Prefix}es. */ prefixesIndex: PrefixIndex; /** An index, more specifically a {@link Trie}, of {@link Suffix}es. */ suffixesIndex: SuffixIndex; /** * @param reader - The {@link Reader} instance to parse with. * @param override - An optional object which allows for overriding * whatever {@link AffData} that was parsed with something else. */ constructor(reader: Reader, override?: OverridableAffData); /** Parses a string and returns the first {@link Flag} found. */ parseFlag(flag: string): Flag; /** Parses a string and returns the {@link Flags} found. */ parseFlags(flags: string | string[]): Flags; /** * Utility for handling special cases involving the `CHECKSHARPS` * directive. Returns false if the directive itself is disabled, but * otherwise will determine if the given word contains a `ß`. * * @param word - The word to check. */ isSharps(word: string): boolean; /** * Utility for applying the {@link Aff.IGNORE} transformation to a string. * Does nothing if the `IGNORE` directive isn't present. * * @param str - The string to transform. */ ignore(str: string): string; }