mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* [nspell] add types and tests for v2.1 * rename to plural tests * There is no UMD * address linter errors and add testing comments * address review comments by switching to callable class * revert errornous change * address review second part * add esModuleInterop flag without the flag npm run test fails. It would not fail if "export default NSpell" would be used in combination with a "npm-naming" rule
35 lines
820 B
TypeScript
35 lines
820 B
TypeScript
import nspell from 'nspell';
|
|
|
|
// $ExpectType NSpell
|
|
nspell('');
|
|
// $ExpectType NSpell
|
|
nspell(new Buffer(''));
|
|
// $ExpectType NSpell
|
|
nspell(new Buffer(''), new Buffer(''));
|
|
// $ExpectType NSpell
|
|
nspell({ aff: new Buffer(''), dic: new Buffer('') });
|
|
// $ExpectType NSpell
|
|
nspell([{ aff: new Buffer('') }, { aff: new Buffer('') }]);
|
|
|
|
const spell = nspell('', '');
|
|
// $ExpectType boolean
|
|
spell.correct('');
|
|
// $ExpectType string[]
|
|
spell.suggest('');
|
|
// $ExpectType SpellCheck
|
|
spell.spell('');
|
|
// $ExpectType NSpell
|
|
spell.add('');
|
|
// $ExpectType NSpell
|
|
spell.remove('');
|
|
// $ExpectType string | undefined
|
|
spell.wordCharacters();
|
|
// $ExpectType NSpell
|
|
spell.dictionary('');
|
|
// $ExpectType NSpell
|
|
spell.dictionary(new Buffer(''));
|
|
// $ExpectType NSpell
|
|
spell.personal('');
|
|
// $ExpectType NSpell
|
|
spell.personal(new Buffer(''));
|