feat: add website documentation early mvp (#8183)

Co-authored-by: iCrawl <buechler.noel@outlook.com>
This commit is contained in:
Suneet Tipirneni
2022-07-01 14:54:15 -04:00
committed by GitHub
parent e0c8282490
commit d95197cc78
41 changed files with 1800 additions and 647 deletions

View 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,
};
}
}