UNPKG

@microsoft/api-extractor

Version:

Validate, document, and review the exported API for a TypeScript library

45 lines (44 loc) 1.47 kB
import AstItem, { IAstItemOptions } from './AstItem'; import AstStructuredType from './AstStructuredType'; export declare enum ApiAccessModifier { Private = 0, Protected = 1, Public = 2, } /** * This class is part of the AstItem abstract syntax tree. It represents syntax following * these types of patterns: * * - "someName: SomeTypeName;" * - "someName?: SomeTypeName;" * - "someName: { someOtherName: SomeOtherTypeName }", i.e. involving a type literal expression * - "someFunction(): void;" * * AstMember is used to represent members of classes, interfaces, and nested type literal expressions. */ export default class AstMember extends AstItem { /** * True if the member is an optional field value, indicated by a question mark ("?") after the name */ accessModifier: ApiAccessModifier; isOptional: boolean; isStatic: boolean; /** * The type of the member item, if specified as a type literal expression. Otherwise, * this field is undefined. */ typeLiteral: AstStructuredType | undefined; constructor(options: IAstItemOptions); /** * @virtual */ visitTypeReferencesForAstItem(): void; /** * Returns a text string such as "someName?: SomeTypeName;", or in the case of a type * literal expression, returns a text string such as "someName?:". */ getDeclarationLine(property?: { type: string; readonly: boolean; }): string; }