11/**
2+ * @typedef {import('nlcst').Root } Root
3+ * @typedef {import('nlcst').Sentence } Sentence
4+ * @typedef {import('nlcst').Word } Word
5+ * @typedef {import('nlcst').Symbol } Symbol
6+ * @typedef {import('nlcst').Punctuation } Punctuation
7+ * @typedef {import('nlcst').SentenceContent } SentenceContent
8+ *
29 * @typedef Options
310 * Configuration.
411 * @property {boolean } [quotes=true]
3340 * When `'inverted'`, converts two dashes into an em-dash, and three dashes
3441 * into an en-dash.
3542 *
36- * @typedef {import('unist').Node } Node
37- * @typedef {import('unist').Parent } Parent
38- * @typedef {import('unist').Literal<string> } Literal
39- *
4043 * @callback Method
41- * @param {Literal } node
44+ * @param {Punctuation|Symbol } node
4245 * @param {number } index
43- * @param {Parent } parent
46+ * @param {Word|Sentence } parent
4447 * @returns {void }
4548 */
4649
@@ -136,7 +139,7 @@ const educators = {
136139 }
137140
138141 // Search for dot-nodes with white-space between.
139- /** @type {Node [] } */
142+ /** @type {SentenceContent [] } */
140143 const nodes = [ ]
141144 let position = index
142145 let count = 1
@@ -158,7 +161,6 @@ const educators = {
158161 sibling &&
159162 ( sibling . type === 'PunctuationNode' ||
160163 sibling . type === 'SymbolNode' ) &&
161- // @ts -expect-error: it’s a literal.
162164 / ^ \. + $ / . test ( sibling . value )
163165 ) {
164166 nodes . push ( queue , sibling )
@@ -257,7 +259,7 @@ const educators = {
257259 * Plugin to replace dumb/straight/typewriter punctuation marks with smart/curly
258260 * punctuation marks.
259261 *
260- * @type {import('unified').Plugin<[Options?]> }
262+ * @type {import('unified').Plugin<[Options?]|[], Root > }
261263 */
262264export default function retextSmartypants ( options = { } ) {
263265 /** @type {Array.<Method> } */
0 commit comments