@types/spellchecker
TypeScript icon, indicating that this package has built-in type declarations

3.5.2 • Public • Published

Installation

npm install --save @types/spellchecker

Summary

This package contains type definitions for spellchecker (http://atom.github.io/node-spellchecker).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/spellchecker.

index.d.ts

/* ---------------------------------------------------------------------------
                       Custom Types / Interfaces
--------------------------------------------------------------------------- */
/**
 * MisspelledLocation - shape of an object returned by checkSpelling to
 * identify locations of misspelled words in a corpus.
 * @description a misspelled word can be found by corpus.slice(start, end)
 * start - start index of a misspelled word in a corpus
 * end - end index of a misspelled word in a corpus
 */
export interface MisspelledLocation {
    start: number;
    end: number;
}

/* ---------------------------------------------------------------------------
                                Methods
--------------------------------------------------------------------------- */
/**
 * Spellchecker.isMisspelled - Check if a word is misspelled.
 * @param word - String word to check.
 * @returns boolean - true if the word is misspelled, false otherwise.
 */
export function isMisspelled(word: string): boolean;

/**
 * Spellchecker.getCorrectionsForMisspelling - Get the corrections for a misspelled word.
 * @param word - String word to get corrections for.
 * @returns array - Returns a non-null but possibly empty array of string corrections.
 */
export function getCorrectionsForMisspelling(word: string): string[];

/**
 * Spellchecker.checkSpelling - Identify misspelled words in a corpus of text.
 * @param corpus - String corpus of text to spellcheck.
 * @returns array - Returns an Array containing {start, end} objects that describe an
 *                  index range within the original String that contains a misspelled word.
 */
export function checkSpelling(corpus: string): MisspelledLocation[];

/**
 * Spellchecker.checkSpellingAsync - Asynchronously identify misspelled words.
 * @param corpus - String corpus of text to spellcheck.
 * @returns array - Returns a Promise that resolves with the Array described by checkSpelling().
 */
export function checkSpellingAsync(corpus: string): Promise<MisspelledLocation[]>;

/**
 * Spellchecker.add - Adds a word to the dictionary.
 * When using Hunspell, this will not modify the .dic file;
 * new words must be added each time the spellchecker is created. Use a custom dictionary file.
 * @param word - String word to add.
 * @returns void
 */
export function add(word: string): void;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Dale Fenton.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.5.21,642ts5.8
3.5.21,642ts5.7
3.5.21,642latest
3.5.21,642ts4.5
3.5.21,642ts4.6
3.5.21,642ts4.7
3.5.21,642ts4.8
3.5.21,642ts4.9
3.5.21,642ts5.0
3.5.21,642ts5.1
3.5.21,642ts5.2
3.5.21,642ts5.3
3.5.21,642ts5.4
3.5.21,642ts5.5
3.5.21,642ts5.9
3.5.21,642ts5.6
3.5.21,642ts6.0
3.5.018ts2.1
3.5.018ts2.2
3.5.018ts2.3
3.5.018ts2.4
3.5.018ts2.5
3.5.018ts2.6
3.5.018ts2.7
3.5.018ts2.8
3.5.018ts2.9
3.5.018ts3.0
3.5.018ts3.1
3.5.018ts3.2
3.5.018ts3.3
3.5.018ts3.4
3.5.018ts3.5
3.5.018ts3.6
3.5.018ts3.7
3.5.018ts3.8
3.5.018ts3.9
3.5.018ts4.0
3.5.018ts4.1
3.5.018ts4.2
3.5.018ts4.3
3.5.018ts4.4

Version History

VersionDownloads (Last 7 Days)Published
3.5.21,642
3.5.11
3.5.018

Package Sidebar

Install

npm i @types/spellchecker

Weekly Downloads

1,661

Version

3.5.2

License

MIT

Unpacked Size

7.31 kB

Total Files

5

Last publish

Collaborators

  • types