mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
feat(website): add extends clauses, enum members and automatic -types links (#8270)
* feat(website): add extends clauses, enum members and automatic -types links * chore: remove vscode settings * refactor: remove util file
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { DocContainer } from '../DocContainer';
|
||||
import { MethodList } from '../MethodList';
|
||||
import { PropertyList } from '../PropertyList';
|
||||
import { Separator } from '../Seperator';
|
||||
import { MethodsSection, PropertiesSection } from '../Sections';
|
||||
import type { DocClass } from '~/DocModel/DocClass';
|
||||
|
||||
export interface ClassProps {
|
||||
@@ -16,22 +14,10 @@ export function Class({ data }: ClassProps) {
|
||||
excerpt={data.excerpt}
|
||||
summary={data.summary}
|
||||
typeParams={data.typeParameterData}
|
||||
extendsTokens={data.extendsTokens}
|
||||
>
|
||||
<>
|
||||
{data.properties.length ? (
|
||||
<>
|
||||
<PropertyList data={data.properties} />
|
||||
<Separator />
|
||||
</>
|
||||
) : null}
|
||||
|
||||
{data.methods.length ? (
|
||||
<>
|
||||
<MethodList data={data.methods} />
|
||||
<Separator />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
<PropertiesSection data={data.properties} />
|
||||
<MethodsSection data={data.methods} />
|
||||
</DocContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { CodeListing, CodeListingSeparatorType } from '../CodeListing';
|
||||
import { DocContainer } from '../DocContainer';
|
||||
import { Section } from '../Section';
|
||||
import type { DocEnum } from '~/DocModel/DocEnum';
|
||||
|
||||
export interface EnumProps {
|
||||
@@ -8,14 +10,19 @@ export interface EnumProps {
|
||||
export function Enum({ data }: EnumProps) {
|
||||
return (
|
||||
<DocContainer name={data.name} kind={data.kind} excerpt={data.excerpt} summary={data.summary}>
|
||||
<>
|
||||
<h3>Members</h3>
|
||||
<ul>
|
||||
<Section title="Members">
|
||||
<div className="flex flex-col">
|
||||
{data.members.map((member) => (
|
||||
<li key={member.name}>{member.name}</li>
|
||||
<CodeListing
|
||||
key={member.name}
|
||||
name={member.name}
|
||||
separator={CodeListingSeparatorType.Value}
|
||||
typeTokens={member.initializerTokens}
|
||||
summary={member.summary}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
</div>
|
||||
</Section>
|
||||
</DocContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DocContainer } from '../DocContainer';
|
||||
import { ParameterTable } from '../ParameterTable';
|
||||
import { ParametersSection } from '../Sections';
|
||||
import type { DocFunction } from '~/DocModel/DocFunction';
|
||||
|
||||
export interface FunctionProps {
|
||||
@@ -15,8 +15,7 @@ export function Function({ data }: FunctionProps) {
|
||||
summary={data.summary}
|
||||
typeParams={data.typeParameterData}
|
||||
>
|
||||
<h2>Parameters</h2>
|
||||
<ParameterTable data={data.parameters} />
|
||||
<ParametersSection data={data.parameters} />
|
||||
</DocContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { DocContainer } from '../DocContainer';
|
||||
import { MethodList } from '../MethodList';
|
||||
import { PropertyList } from '../PropertyList';
|
||||
import { MethodsSection, PropertiesSection } from '../Sections';
|
||||
import type { DocInterface } from '~/DocModel/DocInterface';
|
||||
|
||||
export interface InterfaceProps {
|
||||
@@ -16,10 +15,8 @@ export function Interface({ data }: InterfaceProps) {
|
||||
summary={data.summary}
|
||||
typeParams={data.typeParameterData}
|
||||
>
|
||||
<>
|
||||
{data.properties.length ? <PropertyList data={data.properties} /> : null}
|
||||
{data.methods.length ? <MethodList data={data.methods} /> : null}
|
||||
</>
|
||||
<PropertiesSection data={data.properties} />
|
||||
<MethodsSection data={data.methods} />
|
||||
</DocContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user