UNPKG

2.33 kBTypeScriptView Raw
1import { DocNodeKind, DocNode, IDocNodeParameters, IDocNodeParsedParameters } from './DocNode';
2import { TokenSequence } from '../parser/TokenSequence';
3/**
4 * Constructor parameters for {@link DocMemberIdentifier}.
5 */
6export interface IDocMemberIdentifierParameters extends IDocNodeParameters {
7 identifier: string;
8}
9/**
10 * Constructor parameters for {@link DocMemberIdentifier}.
11 */
12export interface IDocMemberIdentifierParsedParameters extends IDocNodeParsedParameters {
13 leftQuoteExcerpt?: TokenSequence;
14 identifierExcerpt: TokenSequence;
15 rightQuoteExcerpt?: TokenSequence;
16}
17/**
18 * A member identifier is part of a {@link DocMemberReference}.
19 */
20export declare class DocMemberIdentifier extends DocNode {
21 private readonly _leftQuoteExcerpt;
22 private _identifier;
23 private readonly _identifierExcerpt;
24 private readonly _rightQuoteExcerpt;
25 /**
26 * Don't call this directly. Instead use {@link TSDocParser}
27 * @internal
28 */
29 constructor(parameters: IDocMemberIdentifierParameters | IDocMemberIdentifierParsedParameters);
30 /**
31 * Tests whether the input string can be used without quotes as a member identifier in a declaration reference.
32 * If not, {@link DocMemberIdentifier.hasQuotes} will be required.
33 *
34 * @remarks
35 * In order to be used without quotes, the string must follow the identifier syntax for ECMAScript / TypeScript,
36 * and it must not be one of the reserved words used for system selectors (such as `instance`, `static`,
37 * `constructor`, etc).
38 */
39 static isValidIdentifier(identifier: string): boolean;
40 /** @override */
41 get kind(): DocNodeKind | string;
42 /**
43 * The identifier string without any quote encoding.
44 *
45 * @remarks
46 * If the value is not a valid ECMAScript identifier, it will be quoted as a
47 * string literal during rendering.
48 */
49 get identifier(): string;
50 /**
51 * Returns true if the identifier will be rendered as a quoted string literal
52 * instead of as a programming language identifier. This is required if the
53 * `identifier` property is not a valid ECMAScript identifier.
54 */
55 get hasQuotes(): boolean;
56 /** @override */
57 protected onGetChildNodes(): ReadonlyArray<DocNode | undefined>;
58}
59//# sourceMappingURL=DocMemberIdentifier.d.ts.map
\No newline at end of file