Home > @microsoft/api-extractor-model > ApiDeclaredItem

ApiDeclaredItem class

The base class for API items that have an associated source code excerpt containing a TypeScript declaration.

Signature:

export declare class ApiDeclaredItem extends ApiDocumentedItem 

Constructors

Constructor Modifiers Description
(constructor)(options)   Constructs a new instance of the ApiDeclaredItem class

Properties

Property Modifiers Type Description
excerpt   Excerpt The source code excerpt where the API item is declared.
excerptTokens   ReadonlyArray<ExcerptToken> The individual source code tokens that comprise the main excerpt.

Methods

Method Modifiers Description
buildExcerpt(tokenRange)   Constructs a new Excerpt corresponding to the provided token range.
getExcerptWithModifiers()   If the API item has certain important modifier tags such as @sealed, @virtual, or @override, this prepends them as a doc comment above the excerpt.
onDeserializeInto(options, context, jsonObject) static  
serializeInto(jsonObject)    

Remarks

This is part of the ApiModel hierarchy of classes, which are serializable representations of API declarations.

Most ApiItem subclasses have declarations and thus extend ApiDeclaredItem. Counterexamples include ApiModel and ApiPackage, which do not have any corresponding TypeScript source code.