Files
to_docx/client/node_modules/langium/lib/references/name-provider.d.ts
T
Chen Xiao 0b64e2de94 First commit.
Signed-off-by: Chen Xiao <abigwc@gmail.com>
2026-05-08 14:43:16 +08:00

30 lines
1.3 KiB
TypeScript

/******************************************************************************
* Copyright 2021 TypeFox GmbH
* This program and the accompanying materials are made available under the
* terms of the MIT License, which is available in the project root.
******************************************************************************/
import type { AstNode, CstNode } from '../syntax-tree.js';
export interface NamedAstNode extends AstNode {
name: string;
}
export declare function isNamed(node: AstNode): node is NamedAstNode;
/**
* Utility service for retrieving the `name` of an `AstNode` or the `CstNode` containing a `name`.
*/
export interface NameProvider {
/**
* Returns the `name` of a given AstNode.
* @param node Specified `AstNode` whose name node shall be retrieved.
*/
getName(node: AstNode): string | undefined;
/**
* Returns the `CstNode` which contains the parsed value of the `name` assignment.
* @param node Specified `AstNode` whose name node shall be retrieved.
*/
getNameNode(node: AstNode): CstNode | undefined;
}
export declare class DefaultNameProvider implements NameProvider {
getName(node: AstNode): string | undefined;
getNameNode(node: AstNode): CstNode | undefined;
}
//# sourceMappingURL=name-provider.d.ts.map