In trying to supply a custom processAllTokens hook:
marked.marked.lexer(stringToParse, { hooks: { processAllTokens: tokens => tokens } })
Typescript wanted hooks to include all the other possible functions the Hooks object can have.
Type '{ processAllTokens: (tokens: TokensList | Token[]) => Token[]; }' is missing the following properties from type '_Hooks<string, string>': options, preprocess, postprocess, emStrongMask, and 2 more.
I eventually determined marked.use({ hooks: { works because it combines the hooks object, making it partial. However, this would've been easier if marked.use mentioned how this works in the intellisense, or if other options did. It's harder to connect the meaning of functions across the app. I think I could've saved a lot of time if the documentation included the source code functions.
(Very excellent software, by the way. I will be using this in my own project.)
In trying to supply a custom
processAllTokenshook:Typescript wanted
hooksto include all the other possible functions the Hooks object can have.I eventually determined
marked.use({ hooks: {works because it combines the hooks object, making it partial. However, this would've been easier ifmarked.usementioned how this works in the intellisense, or if other options did. It's harder to connect the meaning of functions across the app. I think I could've saved a lot of time if the documentation included the source code functions.(Very excellent software, by the way. I will be using this in my own project.)