wikiparser-node 1.18.4 → 1.20.0

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 (108) hide show
  1. package/README.md +3 -0
  2. package/bundle/bundle-es7.min.js +25 -32
  3. package/bundle/bundle-lsp.min.js +26 -99
  4. package/bundle/bundle.min.js +25 -32
  5. package/config/default.json +49 -3
  6. package/config/minimum.json +5 -1
  7. package/data/ext/math.json +660 -0
  8. package/dist/addon/table.js +24 -5
  9. package/dist/addon/transclude.js +5 -5
  10. package/dist/base.d.mts +4 -3
  11. package/dist/base.d.ts +4 -3
  12. package/dist/bin/config.js +26 -8
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +10 -1
  15. package/dist/internal.d.ts +2 -0
  16. package/dist/lib/document.d.ts +5 -0
  17. package/dist/lib/document.js +31 -2
  18. package/dist/lib/element.js +15 -21
  19. package/dist/lib/lsp.js +104 -42
  20. package/dist/lib/node.js +21 -24
  21. package/dist/lib/text.js +3 -4
  22. package/dist/lib/title.js +2 -1
  23. package/dist/mixin/attributesParent.js +1 -1
  24. package/dist/mixin/fixed.d.ts +1 -2
  25. package/dist/mixin/fixed.js +2 -3
  26. package/dist/mixin/gapped.d.ts +4 -0
  27. package/dist/mixin/gapped.js +24 -0
  28. package/dist/mixin/hidden.js +1 -1
  29. package/dist/mixin/multiLine.d.ts +4 -0
  30. package/dist/mixin/multiLine.js +33 -0
  31. package/dist/mixin/noEscape.js +1 -1
  32. package/dist/mixin/padded.d.ts +5 -0
  33. package/dist/mixin/padded.js +24 -0
  34. package/dist/mixin/singleLine.js +1 -1
  35. package/dist/mixin/sol.js +1 -1
  36. package/dist/mixin/syntax.js +3 -3
  37. package/dist/parser/braces.js +9 -13
  38. package/dist/parser/commentAndExt.js +18 -2
  39. package/dist/parser/magicLinks.js +2 -2
  40. package/dist/parser/selector.js +5 -2
  41. package/dist/src/arg.js +10 -13
  42. package/dist/src/atom.js +2 -7
  43. package/dist/src/attribute.js +6 -6
  44. package/dist/src/attributes.js +8 -12
  45. package/dist/src/commented.d.ts +26 -0
  46. package/dist/src/commented.js +52 -0
  47. package/dist/src/converter.js +3 -6
  48. package/dist/src/converterFlags.js +266 -223
  49. package/dist/src/converterRule.d.ts +2 -2
  50. package/dist/src/converterRule.js +2 -2
  51. package/dist/src/extLink.d.ts +2 -3
  52. package/dist/src/extLink.js +222 -175
  53. package/dist/src/gallery.d.ts +4 -5
  54. package/dist/src/gallery.js +177 -144
  55. package/dist/src/heading.js +11 -11
  56. package/dist/src/hidden.js +2 -7
  57. package/dist/src/imageParameter.d.ts +2 -2
  58. package/dist/src/imageParameter.js +13 -10
  59. package/dist/src/imagemap.d.ts +2 -2
  60. package/dist/src/imagemap.js +155 -123
  61. package/dist/src/imagemapLink.d.ts +2 -2
  62. package/dist/src/index.js +51 -27
  63. package/dist/src/link/base.d.ts +2 -3
  64. package/dist/src/link/base.js +13 -15
  65. package/dist/src/link/file.d.ts +2 -3
  66. package/dist/src/link/file.js +3 -3
  67. package/dist/src/link/galleryImage.d.ts +2 -3
  68. package/dist/src/link/galleryImage.js +7 -13
  69. package/dist/src/magicLink.js +7 -9
  70. package/dist/src/nested.d.ts +2 -2
  71. package/dist/src/nested.js +4 -7
  72. package/dist/src/nowiki/comment.js +2 -5
  73. package/dist/src/nowiki/doubleUnderscore.js +2 -5
  74. package/dist/src/nowiki/index.d.ts +2 -2
  75. package/dist/src/nowiki/index.js +2 -1
  76. package/dist/src/onlyinclude.js +6 -13
  77. package/dist/src/paramTag/index.d.ts +2 -2
  78. package/dist/src/paramTag/index.js +102 -66
  79. package/dist/src/paramTag/inputbox.js +9 -4
  80. package/dist/src/parameter.d.ts +4 -5
  81. package/dist/src/parameter.js +13 -13
  82. package/dist/src/pre.d.ts +4 -5
  83. package/dist/src/pre.js +8 -17
  84. package/dist/src/syntax.d.ts +1 -1
  85. package/dist/src/syntax.js +2 -7
  86. package/dist/src/table/base.d.ts +2 -2
  87. package/dist/src/table/base.js +8 -8
  88. package/dist/src/table/index.js +1 -1
  89. package/dist/src/table/td.d.ts +3 -3
  90. package/dist/src/table/td.js +9 -9
  91. package/dist/src/table/tr.d.ts +2 -2
  92. package/dist/src/tagPair/ext.js +39 -32
  93. package/dist/src/tagPair/index.d.ts +1 -1
  94. package/dist/src/tagPair/index.js +2 -5
  95. package/dist/src/tagPair/translate.d.ts +38 -0
  96. package/dist/src/tagPair/translate.js +129 -0
  97. package/dist/src/transclude.js +6 -7
  98. package/dist/util/html.js +16 -4
  99. package/dist/util/lint.js +17 -30
  100. package/dist/util/sharable.js +29 -1
  101. package/dist/util/sharable.mjs +31 -3
  102. package/dist/util/string.js +14 -1
  103. package/extensions/dist/base.js +1 -1
  104. package/extensions/dist/lsp.js +13 -2
  105. package/extensions/typings.d.ts +2 -2
  106. package/package.json +9 -7
  107. package/extensions/es7/base.js +0 -320
  108. package/extensions/es7/lint.js +0 -97
@@ -1,4 +1,38 @@
1
1
  "use strict";
2
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
+ var _, done = false;
8
+ for (var i = decorators.length - 1; i >= 0; i--) {
9
+ var context = {};
10
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
+ if (kind === "accessor") {
15
+ if (result === void 0) continue;
16
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
+ if (_ = accept(result.get)) descriptor.get = _;
18
+ if (_ = accept(result.set)) descriptor.set = _;
19
+ if (_ = accept(result.init)) initializers.unshift(_);
20
+ }
21
+ else if (_ = accept(result)) {
22
+ if (kind === "field") initializers.unshift(_);
23
+ else descriptor[key] = _;
24
+ }
25
+ }
26
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
+ done = true;
28
+ };
29
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
+ var useValue = arguments.length > 2;
31
+ for (var i = 0; i < initializers.length; i++) {
32
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
+ }
34
+ return useValue ? value : void 0;
35
+ };
2
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
38
  };
@@ -6,12 +40,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
40
  exports.ExtLinkToken = void 0;
7
41
  const constants_1 = require("../util/constants");
8
42
  const lint_1 = require("../util/lint");
9
- const index_1 = __importDefault(require("../index"));
10
- const index_2 = require("./index");
43
+ const padded_1 = require("../mixin/padded");
44
+ const index_1 = require("./index");
11
45
  const magicLink_1 = require("./magicLink");
12
46
  /* NOT FOR BROWSER */
13
47
  const string_1 = require("../util/string");
14
48
  const debug_1 = require("../util/debug");
49
+ const index_2 = __importDefault(require("../index"));
15
50
  /* NOT FOR BROWSER END */
16
51
  /**
17
52
  * external link
@@ -19,192 +54,204 @@ const debug_1 = require("../util/debug");
19
54
  * 外链
20
55
  * @classdesc `{childNodes: [MagicLinkToken, ?Token]}`
21
56
  */
22
- class ExtLinkToken extends index_2.Token {
23
- #space;
24
- /* NOT FOR BROWSER END */
25
- get type() {
26
- return 'ext-link';
27
- }
28
- /* NOT FOR BROWSER */
29
- /** text of the link / 链接显示文字 */
30
- get innerText() {
31
- return this.length > 1
32
- ? this.lastChild.text()
33
- : `[${this.getRootNode().querySelectorAll('ext-link[childElementCount=1]').indexOf(this) + 1}]`;
34
- }
35
- set innerText(text) {
36
- this.setLinkText(text);
37
- }
38
- /** URL protocol / 协议 */
39
- get protocol() {
40
- return this.firstChild.protocol;
41
- }
42
- set protocol(value) {
43
- this.firstChild.protocol = value;
44
- }
45
- /** link / 链接 */
46
- get link() {
47
- return this.firstChild.link;
48
- }
49
- set link(url) {
50
- this.firstChild.link = url;
51
- }
52
- /* NOT FOR BROWSER END */
53
- /**
54
- * @param url 网址
55
- * @param space 空白字符
56
- * @param text 链接文字
57
- */
58
- constructor(url, space = '', text = '', config = index_1.default.getConfig(), accum = []) {
59
- super(undefined, config, accum, {
60
- MagicLinkToken: 0, Token: 1,
61
- });
62
- const link = url && /^\0\d+f\x7F$/u.test(url)
63
- ? accum[Number(url.slice(1, -2))]
64
- // @ts-expect-error abstract class
65
- : new magicLink_1.MagicLinkToken(url, 'ext-link-url', config, accum);
66
- this.insertAt(link);
67
- this.#space = space;
68
- if (text) {
69
- const inner = new index_2.Token(text, config, accum, {
70
- 'Stage-7': ':', ConverterToken: ':',
71
- });
72
- inner.type = 'ext-link-text';
73
- inner.setAttribute('stage', constants_1.MAX_STAGE - 1);
74
- this.insertAt(inner);
57
+ let ExtLinkToken = (() => {
58
+ let _classDecorators = [(0, padded_1.padded)('[')];
59
+ let _classDescriptor;
60
+ let _classExtraInitializers = [];
61
+ let _classThis;
62
+ let _classSuper = index_1.Token;
63
+ var ExtLinkToken = class extends _classSuper {
64
+ static { _classThis = this; }
65
+ static {
66
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
67
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68
+ ExtLinkToken = _classThis = _classDescriptor.value;
69
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
70
+ __runInitializers(_classThis, _classExtraInitializers);
75
71
  }
76
- /* NOT FOR BROWSER */
77
- this.protectChildren(0);
78
- }
79
- /** @private */
80
- toString(skip) {
81
- if (this.length === 1) {
82
- return `[${super.toString(skip)}${this.#space}]`;
83
- }
84
- /* NOT FOR BROWSER */
85
- this.#correct();
86
- (0, string_1.normalizeSpace)(this.lastChild);
87
- /* NOT FOR BROWSER END */
88
- return `[${super.toString(skip, this.#space)}]`;
89
- }
90
- /** @private */
91
- text() {
92
- /* NOT FOR BROWSER */
93
- (0, string_1.normalizeSpace)(this.childNodes[1]);
72
+ #space;
94
73
  /* NOT FOR BROWSER END */
95
- return `[${super.text(' ')}]`;
96
- }
97
- /** @private */
98
- getAttribute(key) {
99
- return key === 'padding' ? 1 : super.getAttribute(key);
100
- }
101
- /** @private */
102
- getGaps() {
74
+ get type() {
75
+ return 'ext-link';
76
+ }
103
77
  /* NOT FOR BROWSER */
104
- this.#correct();
105
- /* NOT FOR BROWSER END */
106
- return this.#space.length;
107
- }
108
- /** @private */
109
- lint(start = this.getAbsoluteIndex(), re) {
110
- const errors = super.lint(start, re);
111
- if (this.length === 1 && this.closest('heading-title')) {
112
- errors.push((0, lint_1.generateForSelf)(this, { start }, 'var-anchor', 'variable anchor in a section header'));
78
+ /** text of the link / 链接显示文字 */
79
+ get innerText() {
80
+ return this.length > 1
81
+ ? this.lastChild.text()
82
+ : `[${this.getRootNode().querySelectorAll('ext-link[childElementCount=1]').indexOf(this) + 1}]`;
113
83
  }
114
- return errors;
115
- }
116
- /** @private */
117
- print() {
118
- return super.print(this.length === 1 ? { pre: '[', post: `${this.#space}]` } : { pre: '[', sep: this.#space, post: ']' });
119
- }
120
- /* NOT FOR BROWSER */
121
- cloneNode() {
122
- const [url, text] = this.cloneChildNodes();
123
- return debug_1.Shadow.run(() => {
124
- // @ts-expect-error abstract class
125
- const token = new ExtLinkToken(undefined, this.#space, '', this.getAttribute('config'));
126
- token.firstChild.safeReplaceWith(url);
84
+ set innerText(text) {
85
+ this.setLinkText(text);
86
+ }
87
+ /** URL protocol / 协议 */
88
+ get protocol() {
89
+ return this.firstChild.protocol;
90
+ }
91
+ set protocol(value) {
92
+ this.firstChild.protocol = value;
93
+ }
94
+ /** link / 链接 */
95
+ get link() {
96
+ return this.firstChild.link;
97
+ }
98
+ set link(url) {
99
+ this.firstChild.link = url;
100
+ }
101
+ /* NOT FOR BROWSER END */
102
+ /**
103
+ * @param url 网址
104
+ * @param space 空白字符
105
+ * @param text 链接文字
106
+ */
107
+ constructor(url, space = '', text = '', config, accum = []) {
108
+ super(undefined, config, accum, {
109
+ MagicLinkToken: 0, Token: 1,
110
+ });
111
+ const link = url && /^\0\d+f\x7F$/u.test(url)
112
+ ? accum[Number(url.slice(1, -2))]
113
+ // @ts-expect-error abstract class
114
+ : new magicLink_1.MagicLinkToken(url, 'ext-link-url', config, accum);
115
+ this.insertAt(link);
116
+ this.#space = space;
127
117
  if (text) {
128
- token.insertAt(text);
118
+ const inner = new index_1.Token(text, config, accum, {
119
+ 'Stage-7': ':', ConverterToken: ':',
120
+ });
121
+ inner.type = 'ext-link-text';
122
+ inner.setAttribute('stage', constants_1.MAX_STAGE - 1);
123
+ this.insertAt(inner);
129
124
  }
130
- return token;
131
- });
132
- }
133
- /** 修正空白字符 */
134
- #correct() {
135
- const { lastChild, length } = this, { firstChild } = lastChild;
136
- if (!this.#space
137
- && length > 1
138
- && (firstChild?.type === 'text' || firstChild?.type === 'converter')
139
- // 都替换成`<`肯定不对,但无妨
140
- // eslint-disable-next-line es-x/no-regexp-unicode-property-escapes
141
- && /^[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]/u
142
- .test(lastChild.text().replace(/&[lg]t;/u, '<'))) {
143
- this.#space = ' ';
125
+ /* NOT FOR BROWSER */
126
+ this.protectChildren(0);
144
127
  }
145
- }
146
- /**
147
- * Set the text of the link
148
- *
149
- * 设置链接显示文字
150
- * @param str text of the link / 链接显示文字
151
- */
152
- setLinkText(str) {
153
- const root = index_1.default
154
- .parse(str, this.getAttribute('include'), 7, this.getAttribute('config'));
155
- if (this.length === 1) {
156
- root.type = 'ext-link-text';
157
- root.setAttribute('acceptable', {
158
- 'Stage-7': ':', ConverterToken: ':',
128
+ /** @private */
129
+ toString(skip) {
130
+ if (this.length === 1) {
131
+ return `[${super.toString(skip)}${this.#space}]`;
132
+ }
133
+ /* NOT FOR BROWSER */
134
+ this.#correct();
135
+ (0, string_1.normalizeSpace)(this.lastChild);
136
+ /* NOT FOR BROWSER END */
137
+ return `[${super.toString(skip, this.#space)}]`;
138
+ }
139
+ /** @private */
140
+ text() {
141
+ /* NOT FOR BROWSER */
142
+ (0, string_1.normalizeSpace)(this.childNodes[1]);
143
+ /* NOT FOR BROWSER END */
144
+ return `[${super.text(' ')}]`;
145
+ }
146
+ /** @private */
147
+ getGaps() {
148
+ /* NOT FOR BROWSER */
149
+ this.#correct();
150
+ /* NOT FOR BROWSER END */
151
+ return this.#space.length;
152
+ }
153
+ /** @private */
154
+ lint(start = this.getAbsoluteIndex(), re) {
155
+ const errors = super.lint(start, re);
156
+ if (this.length === 1 && this.closest('heading-title')) {
157
+ errors.push((0, lint_1.generateForSelf)(this, { start }, 'var-anchor', 'variable anchor in a section header'));
158
+ }
159
+ return errors;
160
+ }
161
+ /** @private */
162
+ print() {
163
+ return super.print(this.length === 1 ? { pre: '[', post: `${this.#space}]` } : { pre: '[', sep: this.#space, post: ']' });
164
+ }
165
+ /* NOT FOR BROWSER */
166
+ cloneNode() {
167
+ const [url, text] = this.cloneChildNodes();
168
+ return debug_1.Shadow.run(() => {
169
+ // @ts-expect-error abstract class
170
+ const token = new ExtLinkToken(undefined, this.#space, '', this.getAttribute('config'));
171
+ token.firstChild.safeReplaceWith(url);
172
+ if (text) {
173
+ token.insertAt(text);
174
+ }
175
+ return token;
159
176
  });
160
- this.insertAt(root);
161
177
  }
162
- else {
163
- this.lastChild.replaceChildren(...root.childNodes);
178
+ /** 修正空白字符 */
179
+ #correct() {
180
+ const { lastChild, length } = this, { firstChild } = lastChild;
181
+ if (!this.#space
182
+ && length > 1
183
+ && (firstChild?.type === 'text' || firstChild?.type === 'converter')
184
+ // 都替换成`<`肯定不对,但无妨
185
+ // eslint-disable-next-line es-x/no-regexp-unicode-property-escapes
186
+ && /^[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]/u
187
+ .test(lastChild.text().replace(/&[lg]t;/u, '<'))) {
188
+ this.#space = ' ';
189
+ }
164
190
  }
165
- this.#space ||= ' ';
166
- }
167
- /** @private */
168
- toHtmlInternal(opt) {
169
- const { length, lastChild } = this;
170
- let innerText, href;
171
- if (length > 1) {
172
- lastChild.normalize();
173
- const { childNodes } = lastChild, i = childNodes.findIndex(child => child.type === 'link'
174
- || child.is('file')
175
- && child.getValue('link')?.trim() !== '');
176
- if (i !== -1) {
177
- const after = childNodes.slice(i);
178
- this.after(...after);
191
+ /**
192
+ * Set the text of the link
193
+ *
194
+ * 设置链接显示文字
195
+ * @param str text of the link / 链接显示文字
196
+ */
197
+ setLinkText(str) {
198
+ const root = index_2.default
199
+ .parse(str, this.getAttribute('include'), 7, this.getAttribute('config'));
200
+ if (this.length === 1) {
201
+ root.type = 'ext-link-text';
202
+ root.setAttribute('acceptable', {
203
+ 'Stage-7': ':', ConverterToken: ':',
204
+ });
205
+ this.insertAt(root);
206
+ }
207
+ else {
208
+ this.lastChild.safeReplaceChildren(root.childNodes);
179
209
  }
180
- innerText = lastChild.toHtmlInternal(opt);
210
+ this.#space ||= ' ';
181
211
  }
182
- else {
183
- ({ innerText } = this);
212
+ /** @private */
213
+ toHtmlInternal(opt) {
214
+ const { length, lastChild } = this;
215
+ let innerText, href;
216
+ if (length > 1) {
217
+ lastChild.normalize();
218
+ const { childNodes } = lastChild, i = childNodes.findIndex(child => child.type === 'link'
219
+ || child.is('file')
220
+ && child.getValue('link')?.trim() !== '');
221
+ if (i !== -1) {
222
+ const after = childNodes.slice(i);
223
+ this.insertAdjacent(after, 1);
224
+ }
225
+ innerText = lastChild.toHtmlInternal(opt);
226
+ }
227
+ else {
228
+ ({ innerText } = this);
229
+ }
230
+ try {
231
+ ({ href } = this.getUrl());
232
+ }
233
+ catch { }
234
+ return `<a rel="nofollow" class="external"${href === undefined ? '' : ` href="${href}"`}>${innerText}</a>`;
184
235
  }
185
- try {
186
- ({ href } = this.getUrl());
236
+ /**
237
+ * Get the URL
238
+ *
239
+ * 获取网址
240
+ */
241
+ getUrl() {
242
+ return this.firstChild.getUrl();
187
243
  }
188
- catch { }
189
- return `<a rel="nofollow" class="external"${href === undefined ? '' : ` href="${href}"`}>${innerText}</a>`;
190
- }
191
- /**
192
- * Get the URL
193
- *
194
- * 获取网址
195
- */
196
- getUrl() {
197
- return this.firstChild.getUrl();
198
- }
199
- /**
200
- * Set the target of the link
201
- *
202
- * 设置外链目标
203
- * @param url URL containing the protocol / 含协议的网址
204
- */
205
- setTarget(url) {
206
- this.firstChild.setTarget(url);
207
- }
208
- }
244
+ /**
245
+ * Set the target of the link
246
+ *
247
+ * 设置外链目标
248
+ * @param url URL containing the protocol / 含协议的网址
249
+ */
250
+ setTarget(url) {
251
+ this.firstChild.setTarget(url);
252
+ }
253
+ };
254
+ return ExtLinkToken = _classThis;
255
+ })();
209
256
  exports.ExtLinkToken = ExtLinkToken;
210
257
  constants_1.classes['ExtLinkToken'] = __filename;
@@ -1,8 +1,7 @@
1
- import Parser from '../index';
2
1
  import { Token } from './index';
3
2
  import { GalleryImageToken } from './link/galleryImage';
4
3
  import { NoincludeToken } from './nowiki/noinclude';
5
- import type { LintError, AST } from '../base';
4
+ import type { Config, LintError, AST } from '../base';
6
5
  import type { AstText, AttributesToken, ExtToken, AstNodes } from '../internal';
7
6
  declare type Child = GalleryImageToken | NoincludeToken;
8
7
  /**
@@ -18,13 +17,13 @@ export declare abstract class GalleryToken extends Token {
18
17
  abstract get firstChild(): Child | AstText | undefined;
19
18
  abstract get lastChild(): Child | AstText | undefined;
20
19
  abstract get nextSibling(): undefined;
21
- abstract get previousSibling(): AttributesToken;
20
+ abstract get previousSibling(): AttributesToken | undefined;
22
21
  abstract get parentNode(): ExtToken | undefined;
23
22
  abstract get children(): Child[];
24
23
  abstract get firstElementChild(): Child | undefined;
25
24
  abstract get lastElementChild(): Child | undefined;
26
25
  abstract get nextElementSibling(): undefined;
27
- abstract get previousElementSibling(): AttributesToken;
26
+ abstract get previousElementSibling(): AttributesToken | undefined;
28
27
  abstract get parentElement(): ExtToken | undefined;
29
28
  get type(): 'ext-inner';
30
29
  /** image widths / 图片宽度 */
@@ -34,7 +33,7 @@ export declare abstract class GalleryToken extends Token {
34
33
  /** all images / 所有图片 */
35
34
  get images(): GalleryImageToken[];
36
35
  /** @param inner 标签内部wikitext */
37
- constructor(inner?: string, config?: Parser.Config, accum?: Token[]);
36
+ constructor(inner?: string, config?: Config, accum?: Token[]);
38
37
  cloneNode(): this;
39
38
  /**
40
39
  * Insert an image