mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
23 lines
681 B
TypeScript
23 lines
681 B
TypeScript
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,
|
|
};
|
|
}
|
|
}
|