mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +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:
@@ -1,14 +1,14 @@
|
||||
import { DocItem } from './DocItem';
|
||||
import { DocMethodSignature } from './DocMethodSignature';
|
||||
import { DocProperty } from './DocProperty';
|
||||
import { TypeParameterMixin } from './TypeParameterMixin';
|
||||
import { ApiInterface, ApiItemKind, ApiMethodSignature, ApiModel, ApiPropertySignature } from '~/api-extractor.server';
|
||||
import { type TokenDocumentation, genToken, type TypeParameterData, generateTypeParamData } from '~/util/parse.server';
|
||||
import { type TokenDocumentation, genToken } from '~/util/parse.server';
|
||||
|
||||
export class DocInterface extends DocItem<ApiInterface> {
|
||||
export class DocInterface extends TypeParameterMixin(DocItem<ApiInterface>) {
|
||||
public readonly extendsTokens: TokenDocumentation[][] | null;
|
||||
public readonly methods: DocMethodSignature[] = [];
|
||||
public readonly properties: DocProperty[] = [];
|
||||
public readonly typeParameters: TypeParameterData[] = [];
|
||||
|
||||
public constructor(model: ApiModel, item: ApiInterface) {
|
||||
super(model, item);
|
||||
@@ -17,8 +17,6 @@ export class DocInterface extends DocItem<ApiInterface> {
|
||||
excerpt.excerpt.spannedTokens.map((token) => genToken(this.model, token)),
|
||||
);
|
||||
|
||||
this.typeParameters = item.typeParameters.map((typeParam) => generateTypeParamData(this.model, typeParam));
|
||||
|
||||
for (const member of item.members) {
|
||||
switch (member.kind) {
|
||||
case ApiItemKind.MethodSignature:
|
||||
@@ -39,7 +37,6 @@ export class DocInterface extends DocItem<ApiInterface> {
|
||||
extendsTokens: this.extendsTokens,
|
||||
methods: this.methods.map((method) => method.toJSON()),
|
||||
properties: this.properties.map((prop) => prop.toJSON()),
|
||||
typeParameters: this.typeParameters,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user