Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/api-extractor-model > ApiItemContainerMixin > preserveMemberOrder

ApiItemContainerMixin.preserveMemberOrder property

Disables automatic sorting of ApiItem.members.

Signature:

readonly preserveMemberOrder: boolean;

Remarks

By default ApiItemContainerMixin will automatically sort its members according to their ApiItem.getSortKey() string, which provides a standardized mostly alphabetical ordering that is appropriate for most API items. When loading older .api.json files the automatic sorting is reapplied and may update the ordering.

Set preserveMemberOrder to true to disable automatic sorting for this container; instead, the members will retain whatever ordering appeared in the IApiItemContainerMixinOptions.members array. The preserveMemberOrder option is saved in the .api.json file.