UNPKG

1.98 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.MarkdownDocumenterFeature = exports.MarkdownDocumenterFeatureContext = void 0;
6const node_core_library_1 = require("@rushstack/node-core-library");
7const PluginFeature_1 = require("./PluginFeature");
8/**
9 * Context object for {@link MarkdownDocumenterFeature}.
10 * Exposes various services that can be used by a plugin.
11 *
12 * @public
13 */
14class MarkdownDocumenterFeatureContext {
15 /** @internal */
16 constructor(options) {
17 this.apiModel = options.apiModel;
18 this.outputFolder = options.outputFolder;
19 this.documenter = options.documenter;
20 }
21}
22exports.MarkdownDocumenterFeatureContext = MarkdownDocumenterFeatureContext;
23const uuidMarkdownDocumenterFeature = '34196154-9eb3-4de0-a8c8-7e9539dfe216';
24/**
25 * Inherit from this base class to implement an API Documenter plugin feature that customizes
26 * the generation of markdown output.
27 *
28 * @public
29 */
30class MarkdownDocumenterFeature extends PluginFeature_1.PluginFeature {
31 /**
32 * This event occurs before each markdown file is written. It provides an opportunity to customize the
33 * content of the file.
34 * @virtual
35 */
36 onBeforeWritePage(eventArgs) {
37 // (implemented by child class)
38 }
39 /**
40 * This event occurs after all output files have been written.
41 * @virtual
42 */
43 onFinished(eventArgs) {
44 // (implemented by child class)
45 }
46 static [Symbol.hasInstance](instance) {
47 return node_core_library_1.TypeUuid.isInstanceOf(instance, uuidMarkdownDocumenterFeature);
48 }
49}
50exports.MarkdownDocumenterFeature = MarkdownDocumenterFeature;
51node_core_library_1.TypeUuid.registerClass(MarkdownDocumenterFeature, uuidMarkdownDocumenterFeature);
52//# sourceMappingURL=MarkdownDocumenterFeature.js.map
\No newline at end of file