supMDX-page/dist/MDXPage.d.ts

40 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-02-17 04:22:18 +09:00
/// <reference types="react" />
2023-02-16 00:03:53 +09:00
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: JSX.Element;
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 {};