supMDX-page/dist/MDXPage.d.ts
sup39 9c32cea6b8 v0.3.0
- Uses `@sup39/mdx-nav` v0.3.0, which
  - changed `Link` (next/link) to `a`
  - automatically adds slash before children entries
- Fixed children type of `MDXPage`: allows multiple child elements
2023-03-13 18:06:01 +09:00

39 lines
1.1 KiB
TypeScript

import React from 'react';
import { NavHeaderConfig } from '@sup39/mdx-nav';
import { I18N, LocaleInfo } from './i18n';
import { I18NNavEntryInfo } from './i18n-nav';
type HeadingInfo = {
tagName: string;
label: string;
id: string;
};
export type MDXProps = {
children: React.ReactNode;
router: {
pathname: string;
} & LocaleInfo;
meta: Partial<{
title: I18N<string>;
description: I18N<string>;
h1: I18N<string>;
[key: string]: any;
}>;
headings: HeadingInfo[];
config: MDXConfig;
};
export type MDXConfig = {
site: {
startYear?: number;
author: string;
title: I18N<string>;
subtitle?: I18N<string>;
} & Omit<NavHeaderConfig, 'title' | 'subtitle'>;
metaFields?: {
label: I18N<string>;
attr: string;
}[];
nav: I18NNavEntryInfo[];
};
export declare function MDXPageBase({ children, router, meta: meta18, headings, config, }: MDXProps): JSX.Element;
export declare const MDXPageFactory: (config: MDXConfig) => ({ children, ...props }: Omit<MDXProps, 'config'>) => JSX.Element;
export {};