mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
feat(website): show package members in a sidebar (#8245)
* feat(website): show package members in a sidebar * fix: put response instead of loader * Apply suggestions from code review Co-authored-by: Noel <buechler.noel@outlook.com> * chore: make requested changes * refactor: make only package list scrollable * feat: make sidebar mobile responsive * fix: breakpoints for sidebar Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
@@ -8,14 +8,14 @@ import {
|
||||
import { DocItem } from './DocItem';
|
||||
import { DocMethod } from './DocMethod';
|
||||
import { DocProperty } from './DocProperty';
|
||||
import { type TokenDocumentation, genToken, TypeParameterData, generateTypeParamData } from '~/util/parse.server';
|
||||
import { TypeParameterMixin } from './TypeParameterMixin';
|
||||
import { type TokenDocumentation, genToken } from '~/util/parse.server';
|
||||
|
||||
export class DocClass extends DocItem<ApiClass> {
|
||||
export class DocClass extends TypeParameterMixin(DocItem<ApiClass>) {
|
||||
public readonly extendsTokens: TokenDocumentation[] | null;
|
||||
public readonly implementsTokens: TokenDocumentation[][];
|
||||
public readonly methods: DocMethod[] = [];
|
||||
public readonly properties: DocProperty[] = [];
|
||||
public readonly typeParameters: TypeParameterData[] = [];
|
||||
|
||||
public constructor(model: ApiModel, item: ApiClass) {
|
||||
super(model, item);
|
||||
@@ -29,8 +29,6 @@ export class DocClass extends DocItem<ApiClass> {
|
||||
excerpt.excerpt.spannedTokens.map((token) => genToken(this.model, token)),
|
||||
);
|
||||
|
||||
this.typeParameters = item.typeParameters.map((typeParam) => generateTypeParamData(model, typeParam));
|
||||
|
||||
for (const member of item.members) {
|
||||
switch (member.kind) {
|
||||
case ApiItemKind.Method:
|
||||
@@ -52,7 +50,6 @@ export class DocClass extends DocItem<ApiClass> {
|
||||
implementsTokens: this.implementsTokens,
|
||||
methods: this.methods.map((method) => method.toJSON()),
|
||||
properties: this.properties.map((prop) => prop.toJSON()),
|
||||
typeParameters: this.typeParameters,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user