mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
feat: add website documentation early mvp (#8183)
Co-authored-by: iCrawl <buechler.noel@outlook.com>
This commit is contained in:
22
packages/website/src/DocModel/DocVariable.ts
Normal file
22
packages/website/src/DocModel/DocVariable.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { ApiModel, ApiVariable } from '@microsoft/api-extractor-model';
|
||||
import { DocItem } from './DocItem';
|
||||
import { genToken, TokenDocumentation } from '~/util/parse.server';
|
||||
|
||||
export class DocVariable extends DocItem<ApiVariable> {
|
||||
public readonly typeTokens: TokenDocumentation[] = [];
|
||||
public readonly readonly: boolean;
|
||||
|
||||
public constructor(model: ApiModel, item: ApiVariable) {
|
||||
super(model, item);
|
||||
this.typeTokens = item.variableTypeExcerpt.spannedTokens.map((token) => genToken(model, token));
|
||||
this.readonly = item.isReadonly;
|
||||
}
|
||||
|
||||
public override toJSON() {
|
||||
return {
|
||||
...super.toJSON(),
|
||||
typeTokens: this.typeTokens,
|
||||
readonly: this.readonly,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user