import { Token } from './index'; import { ParameterToken } from './parameter'; import { AtomToken } from './atom'; import { SyntaxToken } from './syntax'; import type { Config, LintError } from '../base'; export declare const invalidTemplateMsg = "Invalid template name"; /** * template or magic word * * 模板或魔术字 * @classdesc `{childNodes: [AtomToken|SyntaxToken, ...ParameterToken[]]}` */ export declare abstract class TranscludeToken extends Token { #private; readonly modifier: string; readonly name: string; readonly childNodes: readonly [ SyntaxToken, AtomToken, AtomToken, ...ParameterToken[] ] | readonly [AtomToken | SyntaxToken, ...ParameterToken[]]; abstract get firstChild(): AtomToken | SyntaxToken; abstract get lastChild(): AtomToken | SyntaxToken | ParameterToken; get type(): 'template' | 'magic-word'; /** * module name * * 模块名 * @since v1.21.0 */ get module(): string | undefined; /** * function name * * 函数名 * @since v1.21.2 */ get function(): string | undefined; /** * @param title 模板标题或魔术字 * @param parts 参数各部分 * @throws `SyntaxError` 非法的模板名称 */ constructor(title: string, parts: ([string] | [string | number, string])[], config: Config, accum?: Token[]); /** * Set the transclusion modifier * * 设置引用修饰符 * @param modifier transclusion modifier / 引用修饰符 */ setModifier(modifier: string): boolean; /** * Check if it is a template or a module * * 是否是模板或模块 */ isTemplate(): boolean; /** * @override * @param token node to be inserted / 待插入的子节点 * @param i position to be inserted at / 插入位置 */ insertAt(token: T, i?: number): T; /** * Get parameters with the specified name * * 获取指定参数 * @param key parameter name / 参数名 */ getArgs(key: string | number, exact?: boolean, copy?: boolean, init?: boolean): Set; /** * Get duplicated parameters * * 获取重名参数 */ getDuplicatedArgs(): [string, ParameterToken[]][]; /** * Get possible values of some magic words * * 对特定魔术字获取可能的取值 * @throws `Error` if not a supported magic word */ getPossibleValues(): Token[]; }