Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/api-extractor-model > ApiExportedMixin > isBaseClassOf

ApiExportedMixin.isBaseClassOf() function

A type guard that tests whether the specified ApiItem subclass extends the ApiExportedMixin mixin.

Signature:

function isBaseClassOf(apiItem: ApiItem): apiItem is ApiExportedMixin;

Parameters

ParameterTypeDescription
apiItemApiItem

Returns:

apiItem is ApiExportedMixin

Remarks

The JavaScript instanceof operator cannot be used to test for mixin inheritance, because each invocation of the mixin function produces a different subclass. (This could be mitigated by Symbol.hasInstance, however the TypeScript type system cannot invoke a runtime test.)