@ts-ast-parser/core
Version:
Reflects a simplified version of the TypeScript AST for generating documentation
37 lines • 1.48 kB
TypeScript
import type { ReflectedNode, ReflectedTypeNode } from '../reflected-node.js';
import type { ProjectContext } from '../project-context.js';
import type { IndexSignature } from '../models/interface.js';
import type { SymbolWithContext } from '../utils/types.js';
import { MemberKind } from '../models/member-kind.js';
import type { Type } from '../models/type.js';
import { CommentNode } from './comment-node.js';
import type ts from 'typescript';
/**
* Represents the reflected node of an index signature in an interface or in a type literal.
* For example: `{ [key: string]: number }`
*/
export declare class IndexSignatureNode implements ReflectedNode<IndexSignature, ts.IndexSignatureDeclaration> {
private readonly _node;
private readonly _member;
private readonly _context;
private readonly _parameter;
private readonly _jsDoc;
constructor(node: ts.IndexSignatureDeclaration, member: SymbolWithContext, context: ProjectContext);
getName(): string;
getContext(): ProjectContext;
getKind(): MemberKind;
getTSNode(): ts.IndexSignatureDeclaration;
getJSDoc(): CommentNode;
getLine(): number;
getType(): ReflectedTypeNode;
getIndexType(): ReflectedNode<Type> | null;
isOptional(): boolean;
/**
* Serializes the reflected node
*
* @returns The reflected node as a serializable object
*/
serialize(): IndexSignature;
private _getParameter;
}
//# sourceMappingURL=index-signature-node.d.ts.map