UNPKG

2.04 kBJavaScriptView Raw
1"use strict";
2// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3// See LICENSE in the project root for license information.
4Object.defineProperty(exports, "__esModule", { value: true });
5exports.PluginFeature = exports.PluginFeatureContext = exports.PluginFeatureInitialization = void 0;
6const node_core_library_1 = require("@rushstack/node-core-library");
7/**
8 * This is an internal part of the plugin infrastructure.
9 *
10 * @remarks
11 * This object is the constructor parameter for API Documenter plugin features.
12 *
13 * @public
14 */
15class PluginFeatureInitialization {
16 /** @internal */
17 constructor() {
18 // reserved for future use
19 }
20}
21exports.PluginFeatureInitialization = PluginFeatureInitialization;
22/**
23 * Context object for {@link PluginFeature}.
24 * Exposes various services that can be used by a plugin.
25 *
26 * @public
27 */
28class PluginFeatureContext {
29}
30exports.PluginFeatureContext = PluginFeatureContext;
31const uuidPluginFeature = '56876472-7134-4812-819e-533de0ee10e6';
32/**
33 * The abstract base class for all API Documenter plugin features.
34 * @public
35 */
36class PluginFeature {
37 /**
38 * The subclass should pass the `initialization` through to the base class.
39 * Do not put custom initialization code in the constructor. Instead perform your initialization in the
40 * `onInitialized()` event function.
41 * @internal
42 */
43 constructor(initialization) {
44 // reserved for future expansion
45 this.context = initialization._context;
46 }
47 /**
48 * This event function is called after the feature is initialized, but before any processing occurs.
49 * @virtual
50 */
51 onInitialized() {
52 // (implemented by child class)
53 }
54 static [Symbol.hasInstance](instance) {
55 return node_core_library_1.TypeUuid.isInstanceOf(instance, uuidPluginFeature);
56 }
57}
58exports.PluginFeature = PluginFeature;
59node_core_library_1.TypeUuid.registerClass(PluginFeature, uuidPluginFeature);
60//# sourceMappingURL=PluginFeature.js.map
\No newline at end of file