feat(v2): Provide type definitions for MDXPage from page plugin (#3354)

This commit is contained in:
Sam Zhou 2020-08-28 08:58:32 -04:00 committed by GitHub
parent 56c04c7834
commit c8d6e418ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 3 deletions

View file

@ -9,8 +9,9 @@ import React from 'react';
import Layout from '@theme/Layout';
import {MDXProvider} from '@mdx-js/react';
import MDXComponents from '@theme/MDXComponents';
import type {Props} from '@theme/MDXPage';
function MDXPage(props) {
function MDXPage(props: Props): JSX.Element {
const {content: MDXPageContent} = props;
const {frontMatter, metadata} = MDXPageContent;
const {title, description} = frontMatter;

View file

@ -10,6 +10,7 @@
/// <reference types="@docusaurus/module-type-aliases" />
/// <reference types="@docusaurus/plugin-content-blog" />
/// <reference types="@docusaurus/plugin-content-docs" />
/// <reference types="@docusaurus/plugin-content-pages" />
declare module '@theme/AnnouncementBar' {
const AnnouncementBar: () => JSX.Element | null;
@ -271,8 +272,6 @@ declare module '@theme/MDXComponents' {
export default MDXComponents;
}
// TODO @theme/MDXPage
declare module '@theme/Navbar' {
const Navbar: () => JSX.Element;
export default Navbar;