UNPKG

1.92 kBTypeScriptView Raw
1import { DocNodeKind, DocNode, IDocNodeParameters } from './DocNode';
2import { DocParamBlock } from './DocParamBlock';
3/**
4 * Constructor parameters for {@link DocParamCollection}.
5 */
6export interface IDocParamCollectionParameters extends IDocNodeParameters {
7}
8/**
9 * Represents a collection of DocParamBlock objects and provides efficient operations for looking up the
10 * documentation for a specified parameter name.
11 */
12export declare class DocParamCollection extends DocNode {
13 private readonly _blocks;
14 private _blocksByName;
15 /**
16 * Don't call this directly. Instead use {@link TSDocParser}
17 * @internal
18 */
19 constructor(parameters: IDocParamCollectionParameters);
20 /** @override */
21 get kind(): DocNodeKind | string;
22 /**
23 * Provide an iterator for callers that support it.
24 */
25 [Symbol.iterator](): IterableIterator<DocParamBlock>;
26 /**
27 * Returns the blocks in this collection.
28 */
29 get blocks(): ReadonlyArray<DocParamBlock>;
30 /**
31 * Returns the number of blocks in this collection.
32 */
33 get count(): number;
34 /**
35 * Adds a new block to the collection.
36 */
37 add(docParamBlock: DocParamBlock): void;
38 /**
39 * Removes all blocks from the collection
40 */
41 clear(): void;
42 /**
43 * Returns the first block whose `parameterName` matches the specified string.
44 *
45 * @remarks
46 * If the collection was parsed from an input containing errors, there could potentially be more than
47 * one DocParamBlock with the same name. In this situation, tryGetBlockByName() will return the first match
48 * that it finds.
49 *
50 * This lookup is optimized using a dictionary.
51 */
52 tryGetBlockByName(parameterName: string): DocParamBlock | undefined;
53 /** @override */
54 protected onGetChildNodes(): ReadonlyArray<DocNode | undefined>;
55}
56//# sourceMappingURL=DocParamCollection.d.ts.map
\No newline at end of file