remark-oembed
remark-oembed copied to clipboard
Provide typescript typings (youtube embeds in markdown)
I have a problem with Youtube embeds in Markdown in my Next.js project.
I use react-markdown
or react-remark
for Markdown and tried to use remark-oembed
for Youtube embeds inside Markdown.
Example of Markdown:
Text paragraph 1
https://www.youtube.com/watch?v=PRfV5TvRjEA
Text paragraph 2
Everything is OK without package remark-oembed
(but Youtube link stays as a string, not transforming to iframe).
Using it receives problems:

module "/Users/teine/Development/traffic-exchange-media/media-frontend/node_modules/remark-oembed/index"
Could not find a declaration file for module 'remark-oembed'. '/Users/teine/Development/traffic-exchange-media/media-frontend/node_modules/remark-oembed/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/remark-oembed` if it exists or add a new declaration (.d.ts) file containing `declare module 'remark-oembed';`ts(7016)
Maintainer of remark
said (https://github.com/remarkjs/remark/discussions/742#discussioncomment-860350):
remark-oembed does not currently provide typescript typings.
Could you provide typescript typings, please?
Node: 14.16.1 "next": "^10.2.3", "react": "17.0.2", "react-dom": "17.0.2", "react-markdown": "^6.0.2", "react-remark": "^2.0.3", "rehype-raw": "^5.1.0", "rehype-sanitize": "^4.0.0", "remark": "^13.0.0", "remark-oembed": "^1.2.2", "typograf": "^6.12.0"