RoadmapShopEvents
Skip to main content

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
Extends: [ApiDocumentedItem](/pages/api-extractor-model.apidocumenteditem)

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.

Constructors

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the ApiDeclaredItem class

Properties

PropertyModifiersTypeDescription
excerptExcerptThe source code excerpt where the API item is declared.
excerptTokensReadonlyArray<ExcerptToken >The individual source code tokens that comprise the main excerpt.

Methods

MethodModifiersDescription
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)