RoadmapShopEvents
Skip to main content

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

ApiItem class

The abstract base class for all members of an ApiModel object.

Signature:
export declare class ApiItem

Remarks

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

Constructors

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

Properties

PropertyModifiersTypeDescription
canonicalReferenceDeclarationReference(BETA) Warning: This API is used internally by API extractor but is not yet ready for general usage.
containerKeystringReturns a string key that can be used to efficiently retrieve an ApiItem from an ApiItemContainerMixin. The key is unique within the container. Its format is undocumented and may change at any time.
displayNamestringReturns a name for this object that can be used in diagnostic messages, for example.
kindApiItemKindIdentifies the subclass of the ApiItem base class.
membersReadonlyArray<ApiItem >This property supports a visitor pattern for walking the tree. For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically. Otherwise it returns an empty array.
parentApiItem | undefinedIf this item was added to a ApiItemContainerMixin item, then this returns the container item. If this is an Parameter that was added to a method or function, then this returns the function item. Otherwise, it returns undefined.

Methods

MethodModifiersDescription
buildCanonicalReference()Builds the cached object used by the canonicalReference property.
deserialize(jsonObject, context)static
getAssociatedPackage()If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned. Otherwise undefined is returned.
getHierarchy()Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.
getMergedSiblings()If this item has a name (i.e. extends ApiNameMixin), then return all items that have the same parent and the same name. Otherwise, return all items that have the same parent and the same ApiItemKind.
getScopedNameWithinPackage()This returns a scoped name such as "Namespace1.Namespace2.MyClass.myMember()". It does not include the package name or entry point.
getSortKey()
onDeserializeInto(options, context, jsonObject)static
serializeInto(jsonObject)