wikiparser-node 1.3.1 → 1.3.2-b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/bundle/bundle.min.js +36 -0
  2. package/config/llwiki.json +1 -35
  3. package/config/moegirl.json +1 -44
  4. package/config/zhwiki.json +1 -466
  5. package/extensions/dist/base.js +68 -0
  6. package/extensions/dist/editor.js +159 -0
  7. package/extensions/dist/highlight.js +30 -0
  8. package/extensions/dist/lint.js +48 -0
  9. package/extensions/editor.css +63 -0
  10. package/extensions/ui.css +117 -0
  11. package/i18n/zh-hans.json +4 -3
  12. package/i18n/zh-hant.json +4 -3
  13. package/package.json +32 -12
  14. package/config/.schema.json +0 -172
  15. package/dist/addon/table.d.ts +0 -6
  16. package/dist/addon/table.js +0 -564
  17. package/dist/base.d.ts +0 -45
  18. package/dist/bin/toc.js +0 -18
  19. package/dist/index.d.ts +0 -31
  20. package/dist/index.js +0 -209
  21. package/dist/internal.d.ts +0 -44
  22. package/dist/lib/element.d.ts +0 -155
  23. package/dist/lib/element.js +0 -654
  24. package/dist/lib/node.d.ts +0 -146
  25. package/dist/lib/node.js +0 -419
  26. package/dist/lib/range.d.ts +0 -104
  27. package/dist/lib/range.js +0 -385
  28. package/dist/lib/ranges.d.ts +0 -26
  29. package/dist/lib/ranges.js +0 -117
  30. package/dist/lib/text.d.ts +0 -62
  31. package/dist/lib/text.js +0 -235
  32. package/dist/lib/title.d.ts +0 -38
  33. package/dist/lib/title.js +0 -162
  34. package/dist/mixin/attributesParent.js +0 -94
  35. package/dist/mixin/fixed.js +0 -32
  36. package/dist/mixin/flagsParent.js +0 -70
  37. package/dist/mixin/hidden.js +0 -22
  38. package/dist/mixin/magicLinkParent.js +0 -41
  39. package/dist/mixin/singleLine.js +0 -25
  40. package/dist/mixin/sol.js +0 -43
  41. package/dist/mixin/syntax.js +0 -56
  42. package/dist/parser/braces.js +0 -122
  43. package/dist/parser/commentAndExt.js +0 -69
  44. package/dist/parser/converter.js +0 -40
  45. package/dist/parser/externalLinks.js +0 -28
  46. package/dist/parser/hrAndDoubleUnderscore.js +0 -38
  47. package/dist/parser/html.js +0 -36
  48. package/dist/parser/links.js +0 -94
  49. package/dist/parser/list.js +0 -59
  50. package/dist/parser/magicLinks.js +0 -40
  51. package/dist/parser/quotes.js +0 -67
  52. package/dist/parser/selector.js +0 -162
  53. package/dist/parser/table.js +0 -112
  54. package/dist/src/arg.d.ts +0 -58
  55. package/dist/src/arg.js +0 -189
  56. package/dist/src/atom.d.ts +0 -12
  57. package/dist/src/atom.js +0 -27
  58. package/dist/src/attribute.d.ts +0 -86
  59. package/dist/src/attribute.js +0 -391
  60. package/dist/src/attributes.d.ts +0 -107
  61. package/dist/src/attributes.js +0 -341
  62. package/dist/src/converter.d.ts +0 -51
  63. package/dist/src/converter.js +0 -79
  64. package/dist/src/converterFlags.d.ts +0 -87
  65. package/dist/src/converterFlags.js +0 -222
  66. package/dist/src/converterRule.d.ts +0 -81
  67. package/dist/src/converterRule.js +0 -212
  68. package/dist/src/extLink.d.ts +0 -53
  69. package/dist/src/extLink.js +0 -121
  70. package/dist/src/gallery.d.ts +0 -55
  71. package/dist/src/gallery.js +0 -122
  72. package/dist/src/heading.d.ts +0 -72
  73. package/dist/src/heading.js +0 -127
  74. package/dist/src/hidden.d.ts +0 -21
  75. package/dist/src/hidden.js +0 -23
  76. package/dist/src/html.d.ts +0 -103
  77. package/dist/src/html.js +0 -222
  78. package/dist/src/imageParameter.d.ts +0 -66
  79. package/dist/src/imageParameter.js +0 -247
  80. package/dist/src/imagemap.d.ts +0 -57
  81. package/dist/src/imagemap.js +0 -148
  82. package/dist/src/imagemapLink.d.ts +0 -57
  83. package/dist/src/imagemapLink.js +0 -40
  84. package/dist/src/index.d.ts +0 -146
  85. package/dist/src/index.js +0 -777
  86. package/dist/src/link/base.d.ts +0 -52
  87. package/dist/src/link/base.js +0 -207
  88. package/dist/src/link/category.d.ts +0 -13
  89. package/dist/src/link/category.js +0 -29
  90. package/dist/src/link/file.d.ts +0 -96
  91. package/dist/src/link/file.js +0 -253
  92. package/dist/src/link/galleryImage.d.ts +0 -43
  93. package/dist/src/link/galleryImage.js +0 -106
  94. package/dist/src/link/index.d.ts +0 -53
  95. package/dist/src/link/index.js +0 -123
  96. package/dist/src/magicLink.d.ts +0 -69
  97. package/dist/src/magicLink.js +0 -147
  98. package/dist/src/nested.d.ts +0 -44
  99. package/dist/src/nested.js +0 -87
  100. package/dist/src/nowiki/base.d.ts +0 -46
  101. package/dist/src/nowiki/base.js +0 -42
  102. package/dist/src/nowiki/comment.d.ts +0 -39
  103. package/dist/src/nowiki/comment.js +0 -67
  104. package/dist/src/nowiki/dd.d.ts +0 -8
  105. package/dist/src/nowiki/dd.js +0 -25
  106. package/dist/src/nowiki/doubleUnderscore.d.ts +0 -43
  107. package/dist/src/nowiki/doubleUnderscore.js +0 -50
  108. package/dist/src/nowiki/hr.d.ts +0 -29
  109. package/dist/src/nowiki/hr.js +0 -14
  110. package/dist/src/nowiki/index.d.ts +0 -16
  111. package/dist/src/nowiki/index.js +0 -21
  112. package/dist/src/nowiki/list.d.ts +0 -29
  113. package/dist/src/nowiki/list.js +0 -48
  114. package/dist/src/nowiki/listBase.d.ts +0 -18
  115. package/dist/src/nowiki/listBase.js +0 -12
  116. package/dist/src/nowiki/noinclude.d.ts +0 -25
  117. package/dist/src/nowiki/noinclude.js +0 -25
  118. package/dist/src/nowiki/quote.d.ts +0 -22
  119. package/dist/src/nowiki/quote.js +0 -45
  120. package/dist/src/onlyinclude.d.ts +0 -16
  121. package/dist/src/onlyinclude.js +0 -57
  122. package/dist/src/paramTag/index.d.ts +0 -37
  123. package/dist/src/paramTag/index.js +0 -68
  124. package/dist/src/paramTag/inputbox.d.ts +0 -8
  125. package/dist/src/paramTag/inputbox.js +0 -23
  126. package/dist/src/parameter.d.ts +0 -84
  127. package/dist/src/parameter.js +0 -205
  128. package/dist/src/pre.d.ts +0 -28
  129. package/dist/src/pre.js +0 -51
  130. package/dist/src/syntax.d.ts +0 -24
  131. package/dist/src/syntax.js +0 -30
  132. package/dist/src/table/base.d.ts +0 -52
  133. package/dist/src/table/base.js +0 -78
  134. package/dist/src/table/index.d.ts +0 -229
  135. package/dist/src/table/index.js +0 -379
  136. package/dist/src/table/td.d.ts +0 -103
  137. package/dist/src/table/td.js +0 -261
  138. package/dist/src/table/tr.d.ts +0 -32
  139. package/dist/src/table/tr.js +0 -56
  140. package/dist/src/table/trBase.d.ts +0 -54
  141. package/dist/src/table/trBase.js +0 -158
  142. package/dist/src/tagPair/ext.d.ts +0 -58
  143. package/dist/src/tagPair/ext.js +0 -142
  144. package/dist/src/tagPair/include.d.ts +0 -52
  145. package/dist/src/tagPair/include.js +0 -58
  146. package/dist/src/tagPair/index.d.ts +0 -47
  147. package/dist/src/tagPair/index.js +0 -93
  148. package/dist/src/transclude.d.ts +0 -167
  149. package/dist/src/transclude.js +0 -689
  150. package/dist/util/constants.js +0 -108
  151. package/dist/util/debug.js +0 -64
  152. package/dist/util/diff.js +0 -72
  153. package/dist/util/lint.js +0 -46
  154. package/dist/util/string.js +0 -61
  155. package/errors/README +0 -1
  156. package/printed/README +0 -1
@@ -1,148 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImagemapToken = void 0;
4
- const lint_1 = require("../util/lint");
5
- const debug_1 = require("../util/debug");
6
- const constants_1 = require("../util/constants");
7
- const singleLine_1 = require("../mixin/singleLine");
8
- const Parser = require("../index");
9
- const index_1 = require("./index");
10
- const noinclude_1 = require("./nowiki/noinclude");
11
- const galleryImage_1 = require("./link/galleryImage");
12
- const imagemapLink_1 = require("./imagemapLink");
13
- /**
14
- * `<imagemap>`
15
- * @classdesc `{childNodes: ...NoincludeToken, GalleryImageToken, ...(NoincludeToken|ImagemapLinkToken|AstText)}`
16
- */
17
- class ImagemapToken extends index_1.Token {
18
- type = 'ext-inner';
19
- /** 图片 */
20
- get image() {
21
- return this.childNodes.find((child) => child.type === 'imagemap-image');
22
- }
23
- /* NOT FOR BROWSER */
24
- /** 链接 */
25
- get links() {
26
- return this.childNodes.filter((child) => child.type === 'imagemap-link');
27
- }
28
- /* NOT FOR BROWSER END */
29
- /** @param inner 标签内部wikitext */
30
- constructor(inner, config = Parser.getConfig(), accum = []) {
31
- super(undefined, config, accum, {
32
- GalleryImageToken: ':', ImagemapLinkToken: ':', SingleLineNoincludeToken: ':', AstText: ':',
33
- });
34
- if (!inner) {
35
- return;
36
- }
37
- const lines = inner.split('\n'), protocols = new Set(config.protocol.split('|')), SingleLineNoincludeToken = (0, singleLine_1.singleLine)(noinclude_1.NoincludeToken);
38
- let first = true, error = false;
39
- for (const line of lines) {
40
- const trimmed = line.trim();
41
- if (error || !trimmed || trimmed.startsWith('#')) {
42
- //
43
- }
44
- else if (first) {
45
- const [file, ...options] = line.split('|'), title = this.normalizeTitle(file, 0, true);
46
- if (title.valid
47
- && !title.interwiki
48
- && title.ns === 6) {
49
- const token = new galleryImage_1.GalleryImageToken('imagemap', file, options.length > 0 ? options.join('|') : undefined, config, accum);
50
- super.insertAt(token);
51
- first = false;
52
- continue;
53
- }
54
- else {
55
- Parser.error('<imagemap>标签内必须先包含一张合法图片!', line);
56
- error = true;
57
- }
58
- }
59
- else if (line.trim().split(/[\t ]/u)[0] === 'desc') {
60
- super.insertAt(line);
61
- continue;
62
- }
63
- else if (line.includes('[')) {
64
- const i = line.indexOf('['), substr = line.slice(i), mtIn = /^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u
65
- .exec(substr);
66
- if (mtIn) {
67
- if (this.normalizeTitle(mtIn[1], 0, true, false, true).valid) {
68
- super.insertAt(new imagemapLink_1.ImagemapLinkToken(line.slice(0, i), mtIn.slice(1), substr.slice(substr.indexOf(']]') + 2), config, accum));
69
- continue;
70
- }
71
- }
72
- else if (protocols.has(substr.slice(1, substr.indexOf(':') + 1))
73
- || protocols.has(substr.slice(1, substr.indexOf('//') + 2))) {
74
- const mtEx = /^\[([^\]\s]+)(?:(\s+)(\S[^\]]*)?)?\][\w\s]*$/u
75
- .exec(substr);
76
- if (mtEx) {
77
- super.insertAt(new imagemapLink_1.ImagemapLinkToken(line.slice(0, i), mtEx.slice(1), substr.slice(substr.indexOf(']') + 1), config, accum));
78
- continue;
79
- }
80
- }
81
- }
82
- super.insertAt(new SingleLineNoincludeToken(line, config, accum));
83
- }
84
- }
85
- /** @private */
86
- toString(omit) {
87
- return super.toString(omit, '\n');
88
- }
89
- /** @override */
90
- text() {
91
- return super.text('\n').replace(/\n{2,}/gu, '\n');
92
- }
93
- /** @private */
94
- getGaps() {
95
- return 1;
96
- }
97
- /** @override */
98
- lint(start = this.getAbsoluteIndex()) {
99
- const errors = super.lint(start), rect = { start, ...this.getRootNode().posFromIndex(start) };
100
- if (this.image) {
101
- errors.push(...this.childNodes.filter(child => {
102
- const str = String(child).trim();
103
- return child.type === 'noinclude' && str && !str.startsWith('#');
104
- }).map(child => (0, lint_1.generateForChild)(child, rect, 'invalid link in <imagemap>')));
105
- }
106
- else {
107
- errors.push((0, lint_1.generateForSelf)(this, rect, '<imagemap> without an image'));
108
- }
109
- return errors;
110
- }
111
- /** @override */
112
- print() {
113
- return super.print({ sep: '\n' });
114
- }
115
- /** @ignore */
116
- insertAt(token, i) {
117
- const { image } = this;
118
- if (!image && (typeof token === 'string' || token.type === 'imagemap-link' || token.type === 'text')) {
119
- throw new Error('当前缺少一张合法图片!');
120
- }
121
- else if (image && typeof token !== 'string' && token.type === 'imagemap-image') {
122
- throw new RangeError('已有一张合法图片!');
123
- }
124
- return super.insertAt(token, i);
125
- }
126
- /**
127
- * @override
128
- * @param i 移除位置
129
- * @throws `Error` 禁止移除图片
130
- */
131
- removeAt(i) {
132
- if (this.childNodes[i].type === 'imagemap-image') {
133
- throw new Error('禁止移除<imagemap>内的图片!');
134
- }
135
- return super.removeAt(i);
136
- }
137
- /** @override */
138
- cloneNode() {
139
- const cloned = this.cloneChildNodes();
140
- return debug_1.Shadow.run(() => {
141
- const token = new ImagemapToken(undefined, this.getAttribute('config'));
142
- token.append(...cloned);
143
- return token;
144
- });
145
- }
146
- }
147
- exports.ImagemapToken = ImagemapToken;
148
- constants_1.classes['ImagemapToken'] = __filename;
@@ -1,57 +0,0 @@
1
- import * as Parser from '../index';
2
- import { Token } from './index';
3
- import { NoincludeToken } from './nowiki/noinclude';
4
- import { LinkToken } from './link/index';
5
- import { ExtLinkToken } from './extLink';
6
- import type { Title } from '../lib/title';
7
- import type { AstText, ImagemapToken } from '../internal';
8
- declare const ImagemapLinkToken_base: ((abstract new (...args: any[]) => {
9
- removeAt(): never;
10
- insertAt(token: string, i?: number | undefined): Parser.AstText;
11
- insertAt<T extends Parser.AstNodes>(token: T, i?: number | undefined): T;
12
- readonly length: number;
13
- toString(omit?: Set<string> | undefined, separator?: string | undefined): string;
14
- text(separator?: string | undefined): string;
15
- afterBuild(): void;
16
- getAttribute<T_1 extends string>(key: T_1): TokenAttributeGetter<T_1>;
17
- setAttribute<T_2 extends string>(key: T_2, value: TokenAttributeSetter<T_2>): void;
18
- addEventListener(events: string | string[], listener: AstListener): void;
19
- replaceChildren(...elements: (string | Parser.AstNodes)[]): void;
20
- }) & {
21
- readonly fixed: true;
22
- }) & (abstract new (...args: any[]) => {
23
- toString(omit?: Set<string> | undefined): string;
24
- text(): string;
25
- readonly length: number;
26
- insertAt(token: unknown, i?: number | undefined): unknown;
27
- afterBuild(): void;
28
- getAttribute<T_1 extends string>(key: T_1): TokenAttributeGetter<T_1>;
29
- setAttribute<T_2 extends string>(key: T_2, value: TokenAttributeSetter<T_2>): void;
30
- addEventListener(events: string | string[], listener: AstListener): void;
31
- replaceChildren(...elements: (string | Parser.AstNodes)[]): void;
32
- }) & typeof Parser.Token;
33
- /**
34
- * `<imagemap>`内的链接
35
- * @classdesc `{childNodes: [AstText, LinkToken|ExtLinkToken, NoincludeToken]}`
36
- */
37
- export declare class ImagemapLinkToken extends ImagemapLinkToken_base {
38
- readonly type = "imagemap-link";
39
- readonly childNodes: [AstText, LinkToken | ExtLinkToken, NoincludeToken];
40
- abstract get children(): [LinkToken | ExtLinkToken, NoincludeToken];
41
- abstract get firstChild(): AstText;
42
- abstract get firstElementChild(): LinkToken | ExtLinkToken;
43
- abstract get lastChild(): NoincludeToken;
44
- abstract get lastElementChild(): NoincludeToken;
45
- abstract get parentNode(): ImagemapToken | undefined;
46
- abstract get parentElement(): ImagemapToken | undefined;
47
- /** 内外链接 */
48
- get link(): string | Title;
49
- set link(link: string);
50
- /**
51
- * @param pre 链接前的文本
52
- * @param linkStuff 内外链接
53
- * @param post 链接后的文本
54
- */
55
- constructor(pre: string, linkStuff: readonly [string, string | undefined, string | undefined] | readonly [string, string | undefined], post: string, config?: Parser.Config, accum?: Token[]);
56
- }
57
- export {};
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImagemapLinkToken = void 0;
4
- const constants_1 = require("../util/constants");
5
- const fixed_1 = require("../mixin/fixed");
6
- const singleLine_1 = require("../mixin/singleLine");
7
- const Parser = require("../index");
8
- const index_1 = require("./index");
9
- const noinclude_1 = require("./nowiki/noinclude");
10
- const index_2 = require("./link/index");
11
- const extLink_1 = require("./extLink");
12
- /**
13
- * `<imagemap>`内的链接
14
- * @classdesc `{childNodes: [AstText, LinkToken|ExtLinkToken, NoincludeToken]}`
15
- */
16
- class ImagemapLinkToken extends (0, fixed_1.fixed)((0, singleLine_1.singleLine)(index_1.Token)) {
17
- type = 'imagemap-link';
18
- /* NOT FOR BROWSER */
19
- /** 内外链接 */
20
- get link() {
21
- return this.childNodes[1].link;
22
- }
23
- set link(link) {
24
- this.childNodes[1].link = link;
25
- }
26
- /* NOT FOR BROWSER END */
27
- /**
28
- * @param pre 链接前的文本
29
- * @param linkStuff 内外链接
30
- * @param post 链接后的文本
31
- */
32
- constructor(pre, linkStuff, post, config = Parser.getConfig(), accum = []) {
33
- super(undefined, config, accum);
34
- this.append(pre, linkStuff.length === 2
35
- ? new index_2.LinkToken(...linkStuff, config, accum)
36
- : new extLink_1.ExtLinkToken(...linkStuff, config, accum), new noinclude_1.NoincludeToken(post, config, accum));
37
- }
38
- }
39
- exports.ImagemapLinkToken = ImagemapLinkToken;
40
- constants_1.classes['ImagemapLinkToken'] = __filename;
@@ -1,146 +0,0 @@
1
- import { AstRange } from '../lib/range';
2
- import * as Parser from '../index';
3
- import { AstElement } from '../lib/element';
4
- import { AstText } from '../lib/text';
5
- import type { Range } from '../lib/ranges';
6
- import type { Title } from '../lib/title';
7
- import type { AstNodes, IncludeToken, HtmlToken, ExtToken, TranscludeToken, CommentToken, FileToken } from '../internal';
8
- import type { CaretPosition } from '../lib/node';
9
- import type { TokenTypes } from '../util/constants';
10
- declare type TagToken = IncludeToken | ExtToken | HtmlToken;
11
- /**
12
- * 所有节点的基类
13
- * @classdesc `{childNodes: ...(AstText|Token)}`
14
- */
15
- export declare class Token extends AstElement {
16
- #private;
17
- type: TokenTypes;
18
- /** 所有图片,包括图库 */
19
- get images(): readonly FileToken[];
20
- /** 所有内链、外链和自由外链 */
21
- get links(): readonly Token[];
22
- /** 所有模板和模块 */
23
- get embeds(): readonly TranscludeToken[];
24
- /** @class */
25
- constructor(wikitext?: string, config?: Parser.Config, accum?: Token[], acceptable?: Acceptable);
26
- /**
27
- * @override
28
- * @param child 待插入的子节点
29
- * @param i 插入位置
30
- * @throws `RangeError` 不可插入的子节点
31
- */
32
- insertAt(child: string, i?: number): AstText;
33
- /** @ignore */
34
- insertAt<T extends AstNodes>(child: T, i?: number): T;
35
- /**
36
- * 规范化页面标题
37
- * @param title 标题(含或不含命名空间前缀)
38
- * @param defaultNs 命名空间
39
- * @param halfParsed 仅供内部使用
40
- * @param decode 是否需要解码
41
- * @param selfLink 是否允许selfLink
42
- */
43
- normalizeTitle(title: string, defaultNs?: number, halfParsed?: boolean, decode?: boolean, selfLink?: boolean): Title;
44
- /**
45
- * @override
46
- * @param i 移除位置
47
- * @throws `Error` 不可移除的子节点
48
- */
49
- removeAt(i: number): AstNodes;
50
- /**
51
- * 替换为同类节点
52
- * @param token 待替换的节点
53
- * @throws `Error` 不存在父节点
54
- * @throws `Error` 待替换的节点具有不同属性
55
- */
56
- safeReplaceWith(token: this): void;
57
- /**
58
- * 创建HTML注释
59
- * @param data 注释内容
60
- */
61
- createComment(data?: string): CommentToken;
62
- /**
63
- * 创建标签
64
- * @param tagName 标签名
65
- * @param options 选项
66
- * @param options.selfClosing 是否自封闭
67
- * @param options.closing 是否是闭合标签
68
- * @throws `RangeError` 非法的标签名
69
- */
70
- createElement(tagName: string, { selfClosing, closing }?: {
71
- selfClosing?: boolean;
72
- closing?: boolean;
73
- }): TagToken;
74
- /**
75
- * 创建纯文本节点
76
- * @param data 文本内容
77
- */
78
- createTextNode(data?: string): AstText;
79
- /** 创建AstRange对象 */
80
- createRange(): AstRange;
81
- /**
82
- * 找到给定位置
83
- * @param index 位置
84
- */
85
- caretPositionFromIndex(index?: number): CaretPosition | undefined;
86
- /**
87
- * 找到给定位置
88
- * @param x 列数
89
- * @param y 行数
90
- */
91
- caretPositionFromPoint(x: number, y: number): CaretPosition | undefined;
92
- /**
93
- * 找到给定位置所在的最外层节点
94
- * @param index 位置
95
- */
96
- elementFromIndex(index?: number): AstNodes | undefined;
97
- /**
98
- * 找到给定位置所在的最外层节点
99
- * @param x 列数
100
- * @param y 行数
101
- */
102
- elementFromPoint(x: number, y: number): AstNodes | undefined;
103
- /**
104
- * 找到给定位置所在的所有节点
105
- * @param index 位置
106
- */
107
- elementsFromIndex(index?: number): readonly AstNodes[];
108
- /**
109
- * 找到给定位置所在的所有节点
110
- * @param x 列数
111
- * @param y 行数
112
- */
113
- elementsFromPoint(x: number, y: number): readonly AstNodes[];
114
- /**
115
- * 判断标题是否是跨维基链接
116
- * @param title 标题
117
- */
118
- isInterwiki(title: string): RegExpExecArray | null;
119
- /**
120
- * 深拷贝节点
121
- * @throws `Error` 未定义复制方法
122
- */
123
- cloneNode(): this;
124
- /** 获取全部章节 */
125
- sections(): (AstText | Token)[][] | undefined;
126
- /**
127
- * 获取指定章节
128
- * @param n 章节序号
129
- */
130
- section(n: number): (AstText | Token)[] | undefined;
131
- /**
132
- * 获取指定的外层HTML标签
133
- * @param tag HTML标签名
134
- * @throws `RangeError` 非法的标签或空标签
135
- */
136
- findEnclosingHtml(tag?: string): AstRange | undefined;
137
- /** 获取全部分类 */
138
- getCategories(): readonly [string, string | undefined][];
139
- /** 重新解析单引号 */
140
- redoQuotes(): void;
141
- /** 解析部分魔术字 */
142
- solveConst(): void;
143
- /** 合并普通节点的普通子节点 */
144
- flatten(): void;
145
- }
146
- export {};