wikiparser-node
Version:
A Node.js parser for MediaWiki markup with AST
40 lines (39 loc) • 1.25 kB
TypeScript
import { TagPairToken } from './index';
import type { LintError, Config } from '../../base';
import type { AstText, Token } from '../../internal';
/**
* `<includeonly>`, `<noinclude>` or `<onlyinclude>`
*
* `<includeonly>`或`<noinclude>`或`<onlyinclude>`
* @classdesc `{childNodes: [AstText, AstText]}`
*/
export declare abstract class IncludeToken extends TagPairToken {
readonly childNodes: readonly [AstText, AstText];
abstract get firstChild(): AstText;
abstract get lastChild(): AstText;
abstract get children(): [];
abstract get firstElementChild(): undefined;
abstract get lastElementChild(): undefined;
get type(): 'include';
get innerText(): string | undefined;
set innerText(text: string | undefined);
/**
* @param name 标签名
* @param attr 标签属性
* @param inner 内部wikitext
* @param closed 是否封闭
*/
constructor(name: string, attr?: string, inner?: string, closed?: string, config?: Config, accum?: Token[]);
cloneNode(): this;
/**
* @override
* @param str new text / 新文本
*/
setText(str: string): string;
/**
* Remove tag attributes
*
* 清除标签属性
*/
removeAttr(): void;
}