mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
feat(v2): Provide type definitions for MDXPage from page plugin (#3354)
This commit is contained in:
parent
56c04c7834
commit
c8d6e418ff
4 changed files with 29 additions and 3 deletions
|
@ -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;
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue