how to type import * as meta from "index.mdx"
?
#205
-
i have an import: import * as meta from './_book/index.mdx'
type Meta = {
title: string
description: string
date: Date
author: string
keywords: string
cover: string
} when i do
how do i type it so that i tried doing
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
a) Please read the readme of |
Beta Was this translation helpful? Give feedback.
a) Please read the readme of
remark-mdx-frontmatter
on how to use it: https://github.com/remcohaszing/remark-mdx-frontmatter#name, pass aname
to it. Then it puts everything in an object for you.b) You can attempt to type what MDX files expose: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/38f8f3f7b457dc38b52de08c23d66a5ced38bd9c/types/mdx/index.d.ts#L10-L53.