mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
feat: add ToC to interfaces
This commit is contained in:
@@ -9,7 +9,7 @@ import { Section } from './Section';
|
|||||||
import { TableOfContentItems } from './TableOfContentItems';
|
import { TableOfContentItems } from './TableOfContentItems';
|
||||||
import { TypeParamTable } from './TypeParamTable';
|
import { TypeParamTable } from './TypeParamTable';
|
||||||
import { TSDoc } from './tsdoc/TSDoc';
|
import { TSDoc } from './tsdoc/TSDoc';
|
||||||
import type { ApiClassJSON, ApiItemJSON } from '~/DocModel/ApiNodeJSONEncoder';
|
import type { ApiClassJSON, ApiInterfaceJSON, ApiItemJSON } from '~/DocModel/ApiNodeJSONEncoder';
|
||||||
import type { TypeParameterData } from '~/DocModel/TypeParameterMixin';
|
import type { TypeParameterData } from '~/DocModel/TypeParameterMixin';
|
||||||
import type { AnyDocNodeJSON } from '~/DocModel/comment/CommentNode';
|
import type { AnyDocNodeJSON } from '~/DocModel/comment/CommentNode';
|
||||||
import { generateIcon } from '~/util/icon';
|
import { generateIcon } from '~/util/icon';
|
||||||
@@ -25,8 +25,8 @@ export interface DocContainerProps {
|
|||||||
implementsTokens?: TokenDocumentation[][];
|
implementsTokens?: TokenDocumentation[][];
|
||||||
typeParams?: TypeParameterData[];
|
typeParams?: TypeParameterData[];
|
||||||
comment?: AnyDocNodeJSON | null;
|
comment?: AnyDocNodeJSON | null;
|
||||||
methods?: ApiClassJSON['methods'] | null;
|
methods?: ApiClassJSON['methods'] | ApiInterfaceJSON['methods'] | null;
|
||||||
properties?: ApiClassJSON['properties'] | null;
|
properties?: ApiClassJSON['properties'] | ApiInterfaceJSON['properties'] | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DocContainer({
|
export function DocContainer({
|
||||||
@@ -110,7 +110,7 @@ export function DocContainer({
|
|||||||
<Stack>{children}</Stack>
|
<Stack>{children}</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
{kind === 'Class' && (methods?.length || properties?.length) ? (
|
{(kind === 'Class' || kind === 'Interface') && (methods?.length || properties?.length) ? (
|
||||||
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
||||||
<Aside
|
<Aside
|
||||||
sx={{ backgroundColor: 'transparent' }}
|
sx={{ backgroundColor: 'transparent' }}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ export function Interface({ data }: { data: ApiInterfaceJSON }) {
|
|||||||
excerpt={data.excerpt}
|
excerpt={data.excerpt}
|
||||||
summary={data.summary}
|
summary={data.summary}
|
||||||
typeParams={data.typeParameters}
|
typeParams={data.typeParameters}
|
||||||
|
methods={data.methods}
|
||||||
|
properties={data.properties}
|
||||||
>
|
>
|
||||||
<PropertiesSection data={data.properties} />
|
<PropertiesSection data={data.properties} />
|
||||||
<MethodsSection data={data.methods} />
|
<MethodsSection data={data.methods} />
|
||||||
|
|||||||
Reference in New Issue
Block a user