UNPKG

1.85 kBTypeScriptView Raw
1import { DocNode } from '../nodes/DocNode';
2export declare type DocNodeConstructor = new (...args: any[]) => DocNode;
3export interface IDocNodeDefinition {
4 docNodeKind: string;
5 constructor: DocNodeConstructor;
6}
7/**
8 * Part of the {@link TSDocConfiguration} object.
9 *
10 * @remarks
11 * If you define your own custom subclasses of `DocNode`, they must be registered with the `DocNodeManager`.
12 * Use {@link DocNodeManager.registerAllowableChildren} to specify which {@link DocNodeContainer} subclasses
13 * are allowed to contain your nodes.
14 */
15export declare class DocNodeManager {
16 private static readonly _nodeKindRegExp;
17 private readonly _docNodeDefinitionsByKind;
18 private readonly _docNodeDefinitionsByConstructor;
19 /**
20 * Registers a list of {@link IDocNodeDefinition} objects to be used with the associated
21 * {@link TSDocConfiguration} object.
22 */
23 registerDocNodes(packageName: string, definitions: ReadonlyArray<IDocNodeDefinition>): void;
24 /**
25 * Reports an error if the specified DocNode kind has not been registered.
26 */
27 throwIfNotRegisteredKind(docNodeKind: string): void;
28 /**
29 * For the given parent DocNode kind, registers the specified DocNode kinds as being allowable children of
30 * the parent.
31 *
32 * @remarks
33 * To prevent mistakes, `DocNodeContainer` will report an error if you try to add node that was not registered
34 * as an allowable child of the container.
35 */
36 registerAllowableChildren(parentKind: string, childKinds: ReadonlyArray<string>): void;
37 /**
38 * Returns true if the specified DocNode kind has been registered as an allowable child of the specified
39 * parent DocNode kind.
40 */
41 isAllowedChild(parentKind: string, childKind: string): boolean;
42 private _getDefinition;
43}
44//# sourceMappingURL=DocNodeManager.d.ts.map
\No newline at end of file