mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53: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:
42
packages/website/src/components/Sections.tsx
Normal file
42
packages/website/src/components/Sections.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { MethodList } from './MethodList';
|
||||
import { ParameterTable } from './ParameterTable';
|
||||
import { PropertyList } from './PropertyList';
|
||||
import { Section } from './Section';
|
||||
import type { DocInterface } from '~/DocModel/DocInterface';
|
||||
import type { ParameterDocumentation } from '~/util/parse.server';
|
||||
|
||||
export interface PropertiesSectionProps {
|
||||
data: ReturnType<DocInterface['toJSON']>['properties'];
|
||||
}
|
||||
|
||||
export function PropertiesSection({ data }: PropertiesSectionProps) {
|
||||
return data.length ? (
|
||||
<Section title="Properties">
|
||||
<PropertyList data={data} />
|
||||
</Section>
|
||||
) : null;
|
||||
}
|
||||
|
||||
export interface MethodsSectionProps {
|
||||
data: ReturnType<DocInterface['toJSON']>['methods'];
|
||||
}
|
||||
|
||||
export function MethodsSection({ data }: MethodsSectionProps) {
|
||||
return data.length ? (
|
||||
<Section title="Methods">
|
||||
<MethodList data={data} />
|
||||
</Section>
|
||||
) : null;
|
||||
}
|
||||
|
||||
export interface ParametersSectionProps {
|
||||
data: ParameterDocumentation[];
|
||||
}
|
||||
|
||||
export function ParametersSection({ data }: ParametersSectionProps) {
|
||||
return data.length ? (
|
||||
<Section title="Parameters">
|
||||
<ParameterTable data={data} />
|
||||
</Section>
|
||||
) : null;
|
||||
}
|
||||
Reference in New Issue
Block a user