/** * Check spelling. * * @param {Readonly | DictionaryCallback | Dictionary} options * Configuration or dictionary (required). * @returns * Transform. */ export default function retextSpell(options: Readonly | DictionaryCallback | Dictionary): (tree: Root, file: VFile, next: TransformCallback) => undefined; export type Root = import('nlcst').Root; export type TransformCallback = import('unified').TransformCallback; export type VFile = import('vfile').VFile; /** * Dictionary function. */ export type DictionaryCallback = (onload: DictionaryOnLoad) => undefined | void; /** * Callback called when the dictionary is loaded. */ export type DictionaryOnLoad = (error: Error | undefined, result?: Dictionary | undefined) => undefined | void; /** * A hunspell dictionary. */ export type Dictionary = { /** * Data for the affix file (defines the language, keyboard, flags, and more). */ aff: Uint8Array; /** * Data for the dictionary file (contains words and flags applying to those words). */ dic: Uint8Array; }; /** * Configuration. */ export type Options = { /** * Dictionary (required); * result of importing one of the dictionaries in `wooorm/dictionaries`. */ dictionary: DictionaryCallback | Dictionary; /** * List of words to ignore (optional). */ ignore?: ReadonlyArray | null | undefined; /** * Whether to ignore literal words (default: `true`). */ ignoreLiteral?: boolean | null | undefined; /** * Whether to ignore “words” that contain digits or times such as `123456` or * `2:41pm` (default: `true`). */ ignoreDigits?: boolean | null | undefined; /** * Number of times to suggest (default: `30`); * further misspellings do not get suggestions. */ max?: number | null | undefined; /** * Normalize smart apostrophes (`’`) as straight (`'`) apostrophes (default: * `true`); * dictionaries sometimes don’t support smart apostrophes. */ normalizeApostrophes?: boolean | null | undefined; /** * Personal dictionary (optional). */ personal?: Uint8Array | string | null | undefined; }; /** * Info passed around. */ export type State = { /** * Cache of suggestions. */ cache: Map>; /** * Spell checker. */ checker: unknown; /** * Suggestions. */ count: number; /** * List of words to ignore. */ ignore: ReadonlyArray; /** * Whether to ignore literal words. */ ignoreLiteral: boolean; /** * Whether to ignore words that contain only digits. */ ignoreDigits: boolean; /** * Maximum number of suggestions. */ max: number; /** * Whether to normalize apostrophes. */ normalizeApostrophes: boolean; }; //# sourceMappingURL=index.d.ts.map