SpellService
A spell checker keyed by "spell document" numbers (one per top-level editor, so the checker can keep per-editor ignore lists).
Methods
Section titled “Methods”check()
Section titled “check()”check(
doc,paragraphs):Promise<SpellMiss[][] |null>
Misspellings for each paragraph, in order; null when the check could not run.
Parameters
Section titled “Parameters”number
paragraphs
Section titled “paragraphs”string[]
Returns
Section titled “Returns”Promise<SpellMiss[][] | null>
closeDocument()
Section titled “closeDocument()”closeDocument(
doc):void
The editor of doc is gone.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
isOn()
Section titled “isOn()”isOn():
boolean
Is spell checking on right now?
Returns
Section titled “Returns”boolean
newDocument()
Section titled “newDocument()”newDocument():
number
A fresh spell-document number for a top-level editor.
Returns
Section titled “Returns”number
onChange()
Section titled “onChange()”onChange(
cb): () =>void
Follow the on / off state; returns the unsubscribe.
Parameters
Section titled “Parameters”(on) => void
Returns
Section titled “Returns”() => void
suggestions()
Section titled “suggestions()”suggestions(
doc,paragraph,from,to):Promise<string[]>
Up to five suggestions for paragraph.slice(from, to), in the checker's order.
Parameters
Section titled “Parameters”number
paragraph
Section titled “paragraph”string
number
number
Returns
Section titled “Returns”Promise<string[]>