1 | {"version":3,"file":"PluginFeature.js","sourceRoot":"","sources":["../../src/plugin/PluginFeature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,oEAAwD;AAExD;;;;;;;GAOG;AACH,MAAa,2BAA2B;IAItC,gBAAgB;IAChB;QACE,0BAA0B;IAC5B,CAAC;CACF;AARD,kEAQC;AAED;;;;;GAKG;AACH,MAAa,oBAAoB;CAAG;AAApC,oDAAoC;AAEpC,MAAM,iBAAiB,GAAW,sCAAsC,CAAC;AAEzE;;;GAGG;AACH,MAAsB,aAAa;IAMjC;;;;;OAKG;IACH,YAAmB,cAA2C;QAC5D,gCAAgC;QAChC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,aAAa;QAClB,+BAA+B;IACjC,CAAC;IAEM,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAgB;QACjD,OAAO,4BAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;CACF;AA5BD,sCA4BC;AAED,4BAAQ,CAAC,aAAa,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { TypeUuid } from '@rushstack/node-core-library';\n\n/**\n * This is an internal part of the plugin infrastructure.\n *\n * @remarks\n * This object is the constructor parameter for API Documenter plugin features.\n *\n * @public\n */\nexport class PluginFeatureInitialization {\n /** @internal */\n public _context!: PluginFeatureContext;\n\n /** @internal */\n public constructor() {\n // reserved for future use\n }\n}\n\n/**\n * Context object for {@link PluginFeature}.\n * Exposes various services that can be used by a plugin.\n *\n * @public\n */\nexport class PluginFeatureContext {}\n\nconst uuidPluginFeature: string = '56876472-7134-4812-819e-533de0ee10e6';\n\n/**\n * The abstract base class for all API Documenter plugin features.\n * @public\n */\nexport abstract class PluginFeature {\n /**\n * Exposes various services that can be used by a plugin.\n */\n public context: PluginFeatureContext;\n\n /**\n * The subclass should pass the `initialization` through to the base class.\n * Do not put custom initialization code in the constructor. Instead perform your initialization in the\n * `onInitialized()` event function.\n * @internal\n */\n public constructor(initialization: PluginFeatureInitialization) {\n // reserved for future expansion\n this.context = initialization._context;\n }\n\n /**\n * This event function is called after the feature is initialized, but before any processing occurs.\n * @virtual\n */\n public onInitialized(): void {\n // (implemented by child class)\n }\n\n public static [Symbol.hasInstance](instance: object): boolean {\n return TypeUuid.isInstanceOf(instance, uuidPluginFeature);\n }\n}\n\nTypeUuid.registerClass(PluginFeature, uuidPluginFeature);\n"]} |