wikiparser-node 1.16.3 → 1.16.5
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.
- package/README.md +1 -1
- package/bundle/bundle.es7.js +28 -28
- package/bundle/bundle.lsp.js +30 -30
- package/bundle/bundle.min.js +29 -29
- package/coverage/badge.svg +1 -1
- package/data/signatures.json +43 -0
- package/dist/addon/table.js +7 -4
- package/dist/addon/token.js +119 -113
- package/dist/addon/transclude.js +7 -5
- package/dist/base.d.mts +99 -30
- package/dist/base.d.ts +99 -30
- package/dist/index.d.ts +10 -4
- package/dist/index.js +59 -14
- package/dist/lib/attributes.js +2 -2
- package/dist/lib/element.d.ts +128 -29
- package/dist/lib/element.js +178 -32
- package/dist/lib/lsp.d.ts +62 -27
- package/dist/lib/lsp.js +395 -304
- package/dist/lib/node.d.ts +123 -54
- package/dist/lib/node.js +216 -87
- package/dist/lib/range.d.ts +83 -31
- package/dist/lib/range.js +83 -31
- package/dist/lib/ranges.d.ts +1 -1
- package/dist/lib/ranges.js +3 -2
- package/dist/lib/text.d.ts +40 -14
- package/dist/lib/text.js +47 -19
- package/dist/lib/title.d.ts +54 -17
- package/dist/lib/title.js +101 -47
- package/dist/mixin/attributesParent.d.ts +37 -21
- package/dist/mixin/attributesParent.js +18 -20
- package/dist/mixin/flagsParent.d.ts +38 -12
- package/dist/mixin/hidden.d.ts +0 -2
- package/dist/mixin/hidden.js +0 -2
- package/dist/mixin/magicLinkParent.d.ts +11 -5
- package/dist/mixin/singleLine.d.ts +0 -2
- package/dist/mixin/singleLine.js +3 -3
- package/dist/mixin/sol.d.ts +0 -2
- package/dist/mixin/sol.js +2 -3
- package/dist/mixin/syntax.d.ts +0 -2
- package/dist/mixin/syntax.js +0 -2
- package/dist/parser/braces.js +4 -2
- package/dist/parser/links.js +13 -7
- package/dist/parser/list.js +3 -1
- package/dist/parser/quotes.js +22 -2
- package/dist/parser/redirect.js +4 -1
- package/dist/parser/selector.js +1 -1
- package/dist/src/arg.d.ts +19 -9
- package/dist/src/arg.js +34 -15
- package/dist/src/atom.d.ts +5 -1
- package/dist/src/atom.js +5 -1
- package/dist/src/attribute.d.ts +26 -8
- package/dist/src/attribute.js +30 -11
- package/dist/src/attributes.d.ts +50 -22
- package/dist/src/attributes.js +54 -26
- package/dist/src/converter.d.ts +4 -2
- package/dist/src/converter.js +12 -9
- package/dist/src/converterFlags.d.ts +45 -15
- package/dist/src/converterFlags.js +45 -15
- package/dist/src/converterRule.d.ts +30 -11
- package/dist/src/converterRule.js +46 -16
- package/dist/src/extLink.d.ts +6 -2
- package/dist/src/extLink.js +14 -11
- package/dist/src/gallery.d.ts +13 -9
- package/dist/src/gallery.js +35 -21
- package/dist/src/heading.d.ts +13 -7
- package/dist/src/heading.js +28 -18
- package/dist/src/hidden.d.ts +5 -1
- package/dist/src/hidden.js +7 -3
- package/dist/src/html.d.ts +12 -10
- package/dist/src/html.js +17 -12
- package/dist/src/imageParameter.d.ts +27 -12
- package/dist/src/imageParameter.js +27 -12
- package/dist/src/imagemap.d.ts +4 -4
- package/dist/src/imagemap.js +9 -5
- package/dist/src/imagemapLink.d.ts +3 -1
- package/dist/src/imagemapLink.js +3 -1
- package/dist/src/index.d.ts +65 -64
- package/dist/src/index.js +111 -132
- package/dist/src/link/base.d.ts +14 -6
- package/dist/src/link/base.js +45 -21
- package/dist/src/link/category.d.ts +9 -4
- package/dist/src/link/category.js +20 -4
- package/dist/src/link/file.d.ts +71 -23
- package/dist/src/link/file.js +100 -36
- package/dist/src/link/galleryImage.d.ts +8 -4
- package/dist/src/link/galleryImage.js +15 -8
- package/dist/src/link/index.d.ts +14 -6
- package/dist/src/link/index.js +15 -5
- package/dist/src/link/redirectTarget.d.ts +4 -3
- package/dist/src/link/redirectTarget.js +5 -3
- package/dist/src/magicLink.d.ts +28 -12
- package/dist/src/magicLink.js +56 -34
- package/dist/src/nested.d.ts +5 -3
- package/dist/src/nested.js +9 -6
- package/dist/src/nowiki/base.d.ts +4 -2
- package/dist/src/nowiki/base.js +6 -5
- package/dist/src/nowiki/comment.d.ts +6 -2
- package/dist/src/nowiki/comment.js +8 -3
- package/dist/src/nowiki/dd.d.ts +0 -3
- package/dist/src/nowiki/dd.js +0 -8
- package/dist/src/nowiki/doubleUnderscore.d.ts +5 -1
- package/dist/src/nowiki/doubleUnderscore.js +5 -1
- package/dist/src/nowiki/index.d.ts +5 -1
- package/dist/src/nowiki/index.js +5 -1
- package/dist/src/nowiki/list.d.ts +5 -1
- package/dist/src/nowiki/list.js +5 -1
- package/dist/src/nowiki/listBase.d.ts +15 -5
- package/dist/src/nowiki/listBase.js +41 -10
- package/dist/src/nowiki/noinclude.d.ts +5 -1
- package/dist/src/nowiki/noinclude.js +5 -1
- package/dist/src/nowiki/quote.d.ts +15 -8
- package/dist/src/nowiki/quote.js +32 -12
- package/dist/src/onlyinclude.d.ts +4 -2
- package/dist/src/onlyinclude.js +4 -2
- package/dist/src/paramTag/index.d.ts +1 -1
- package/dist/src/paramTag/index.js +1 -1
- package/dist/src/parameter.d.ts +24 -12
- package/dist/src/parameter.js +45 -27
- package/dist/src/pre.d.ts +1 -1
- package/dist/src/pre.js +1 -1
- package/dist/src/redirect.d.ts +2 -0
- package/dist/src/redirect.js +2 -0
- package/dist/src/syntax.d.ts +5 -1
- package/dist/src/syntax.js +5 -1
- package/dist/src/table/base.d.ts +5 -1
- package/dist/src/table/base.js +11 -4
- package/dist/src/table/index.d.ts +134 -66
- package/dist/src/table/index.js +149 -81
- package/dist/src/table/td.d.ts +18 -10
- package/dist/src/table/td.js +23 -15
- package/dist/src/table/tr.d.ts +13 -3
- package/dist/src/table/tr.js +14 -6
- package/dist/src/table/trBase.d.ts +28 -12
- package/dist/src/table/trBase.js +28 -18
- package/dist/src/tagPair/ext.d.ts +3 -1
- package/dist/src/tagPair/ext.js +11 -10
- package/dist/src/tagPair/include.d.ts +8 -2
- package/dist/src/tagPair/include.js +8 -2
- package/dist/src/tagPair/index.d.ts +6 -2
- package/dist/src/tagPair/index.js +6 -2
- package/dist/src/transclude.d.ts +107 -33
- package/dist/src/transclude.js +139 -45
- package/dist/util/debug.js +2 -7
- package/dist/util/html.js +1 -14
- package/dist/util/string.js +7 -1
- package/extensions/dist/base.js +25 -8
- package/extensions/dist/codejar.js +2 -1
- package/extensions/dist/lsp.js +5 -10
- package/extensions/es7/base.js +25 -8
- package/extensions/ui.css +1 -162
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/package.json +3 -3
- package/extensions/dist/test-page.js +0 -89
package/dist/src/link/base.js
CHANGED
|
@@ -10,8 +10,6 @@ const index_2 = require("../index");
|
|
|
10
10
|
const atom_1 = require("../atom");
|
|
11
11
|
/* NOT FOR BROWSER */
|
|
12
12
|
const debug_1 = require("../../util/debug");
|
|
13
|
-
const string_2 = require("../../util/string");
|
|
14
|
-
const html_1 = require("../../util/html");
|
|
15
13
|
/* NOT FOR BROWSER END */
|
|
16
14
|
/**
|
|
17
15
|
* 是否为普通内链
|
|
@@ -19,27 +17,34 @@ const html_1 = require("../../util/html");
|
|
|
19
17
|
*/
|
|
20
18
|
const isLink = (type) => type === 'redirect-target' || type === 'link';
|
|
21
19
|
/**
|
|
20
|
+
* internal link
|
|
21
|
+
*
|
|
22
22
|
* 内链
|
|
23
|
-
* @classdesc `{childNodes: [AtomToken, ...Token]}`
|
|
23
|
+
* @classdesc `{childNodes: [AtomToken, ...Token[]]}`
|
|
24
24
|
*/
|
|
25
25
|
class LinkBaseToken extends index_2.Token {
|
|
26
26
|
#bracket = true;
|
|
27
27
|
#delimiter;
|
|
28
28
|
#title;
|
|
29
|
-
|
|
29
|
+
/* NOT FOR BROWSER END */
|
|
30
|
+
/** full link / 完整链接 */
|
|
30
31
|
get link() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
set link(link) {
|
|
34
|
-
this.setTarget(link);
|
|
32
|
+
// eslint-disable-next-line no-unused-labels
|
|
33
|
+
LSP: return this.#title;
|
|
35
34
|
}
|
|
35
|
+
/* PRINT ONLY */
|
|
36
36
|
/** 片段标识符 */
|
|
37
37
|
get fragment() {
|
|
38
38
|
return this.#title.fragment;
|
|
39
39
|
}
|
|
40
|
+
/* PRINT ONLY END */
|
|
41
|
+
/* NOT FOR BROWSER */
|
|
40
42
|
set fragment(fragment) {
|
|
41
43
|
this.setFragment(fragment);
|
|
42
44
|
}
|
|
45
|
+
set link(link) {
|
|
46
|
+
this.setTarget(link);
|
|
47
|
+
}
|
|
43
48
|
/** interwiki */
|
|
44
49
|
get interwiki() {
|
|
45
50
|
return this.#title.interwiki;
|
|
@@ -103,7 +108,8 @@ class LinkBaseToken extends index_2.Token {
|
|
|
103
108
|
(0, debug_1.undo)(e, data);
|
|
104
109
|
throw new Error(`${type === 'category' ? 'Category' : 'File'} link cannot change namespace: ${name}`);
|
|
105
110
|
}
|
|
106
|
-
else if (type === 'link' && !interwiki && (ns === 6 || ns === 14)
|
|
111
|
+
else if (type === 'link' && !interwiki && (ns === 6 || ns === 14)
|
|
112
|
+
&& !name.trim().startsWith(':')) {
|
|
107
113
|
const { firstChild } = prevTarget;
|
|
108
114
|
if (firstChild?.type === 'text') {
|
|
109
115
|
firstChild.insertData(0, ':');
|
|
@@ -163,9 +169,9 @@ class LinkBaseToken extends index_2.Token {
|
|
|
163
169
|
errors.push(e);
|
|
164
170
|
}
|
|
165
171
|
if (type === 'link' || type === 'category') {
|
|
166
|
-
const
|
|
172
|
+
const j = linkText?.childNodes.findIndex(c => c.type === 'text' && c.data.includes('|')), textNode = linkText?.childNodes[j];
|
|
167
173
|
if (textNode) {
|
|
168
|
-
const e = (0, lint_1.generateForChild)(linkText, rect, 'pipe-like', 'additional "|" in the link text', 'warning'), i = e.startIndex +
|
|
174
|
+
const e = (0, lint_1.generateForChild)(linkText, rect, 'pipe-like', 'additional "|" in the link text', 'warning'), i = e.startIndex + linkText.getRelativeIndex(j);
|
|
169
175
|
e.suggestions = [
|
|
170
176
|
{
|
|
171
177
|
desc: 'escape',
|
|
@@ -177,10 +183,13 @@ class LinkBaseToken extends index_2.Token {
|
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
185
|
if (fragment !== undefined && !isLink(type)) {
|
|
180
|
-
const e = (0, lint_1.generateForChild)(target, rect, 'no-ignored', 'useless fragment'),
|
|
186
|
+
const e = (0, lint_1.generateForChild)(target, rect, 'no-ignored', 'useless fragment'), j = target.childNodes.findIndex(c => c.type === 'text' && c.data.includes('#')), textNode = target.childNodes[j];
|
|
181
187
|
if (textNode) {
|
|
182
188
|
e.fix = {
|
|
183
|
-
range: [
|
|
189
|
+
range: [
|
|
190
|
+
e.startIndex + target.getRelativeIndex(j) + textNode.data.indexOf('#'),
|
|
191
|
+
e.endIndex,
|
|
192
|
+
],
|
|
184
193
|
text: '',
|
|
185
194
|
desc: 'remove',
|
|
186
195
|
};
|
|
@@ -190,13 +199,21 @@ class LinkBaseToken extends index_2.Token {
|
|
|
190
199
|
return errors;
|
|
191
200
|
}
|
|
192
201
|
/** @private */
|
|
193
|
-
getTitle(halfParsed) {
|
|
194
|
-
return this.normalizeTitle(this.firstChild.toString(true), 0, halfParsed, true, true);
|
|
202
|
+
getTitle(temporary, halfParsed) {
|
|
203
|
+
return this.normalizeTitle(this.firstChild.toString(true), 0, temporary, halfParsed, true, true);
|
|
195
204
|
}
|
|
196
205
|
/** @private */
|
|
197
206
|
print() {
|
|
198
207
|
return super.print(this.#bracket ? { pre: '[[', post: ']]', sep: this.#delimiter } : { sep: this.#delimiter });
|
|
199
208
|
}
|
|
209
|
+
/** @private */
|
|
210
|
+
json(_, start = this.getAbsoluteIndex()) {
|
|
211
|
+
const json = super.json(undefined, start), { type, fragment } = this;
|
|
212
|
+
if (fragment !== undefined && (type === 'link' || type === 'redirect-target')) {
|
|
213
|
+
json['fragment'] = fragment;
|
|
214
|
+
}
|
|
215
|
+
return json;
|
|
216
|
+
}
|
|
200
217
|
/* NOT FOR BROWSER */
|
|
201
218
|
cloneNode() {
|
|
202
219
|
const [link, ...linkText] = this.cloneChildNodes();
|
|
@@ -208,8 +225,10 @@ class LinkBaseToken extends index_2.Token {
|
|
|
208
225
|
});
|
|
209
226
|
}
|
|
210
227
|
/**
|
|
228
|
+
* Set the link target
|
|
229
|
+
*
|
|
211
230
|
* 设置链接目标
|
|
212
|
-
* @param link 链接目标
|
|
231
|
+
* @param link link target / 链接目标
|
|
213
232
|
*/
|
|
214
233
|
setTarget(link) {
|
|
215
234
|
const config = this.getAttribute('config'), { childNodes } = index_1.default.parse(link, this.getAttribute('include'), 2, config), token = debug_1.Shadow.run(() => new atom_1.AtomToken(undefined, 'link-target', config, [], {
|
|
@@ -219,26 +238,31 @@ class LinkBaseToken extends index_2.Token {
|
|
|
219
238
|
this.firstChild.safeReplaceWith(token);
|
|
220
239
|
}
|
|
221
240
|
/**
|
|
241
|
+
* Set the fragment
|
|
242
|
+
*
|
|
222
243
|
* 设置片段标识符
|
|
223
244
|
* @param fragment 片段标识符
|
|
224
245
|
*/
|
|
225
246
|
setFragment(fragment) {
|
|
226
247
|
const { type, name } = this;
|
|
227
248
|
if (fragment === undefined || isLink(type)) {
|
|
228
|
-
fragment &&= (0,
|
|
249
|
+
fragment &&= (0, string_1.encode)(fragment);
|
|
229
250
|
this.setTarget(name + (fragment === undefined ? '' : `#${fragment}`));
|
|
230
251
|
}
|
|
231
252
|
}
|
|
232
253
|
/**
|
|
254
|
+
* Set the link text
|
|
255
|
+
*
|
|
233
256
|
* 设置链接显示文字
|
|
234
|
-
* @param linkStr 链接显示文字
|
|
257
|
+
* @param linkStr link text / 链接显示文字
|
|
235
258
|
*/
|
|
236
259
|
setLinkText(linkStr) {
|
|
237
260
|
if (linkStr === undefined) {
|
|
238
261
|
this.childNodes[1]?.remove();
|
|
239
262
|
return;
|
|
240
263
|
}
|
|
241
|
-
const root = index_1.default
|
|
264
|
+
const root = index_1.default
|
|
265
|
+
.parse(linkStr, this.getAttribute('include'), undefined, this.getAttribute('config'));
|
|
242
266
|
if (this.length === 1) {
|
|
243
267
|
root.type = 'link-text';
|
|
244
268
|
root.setAttribute('acceptable', {
|
|
@@ -254,9 +278,9 @@ class LinkBaseToken extends index_2.Token {
|
|
|
254
278
|
toHtmlInternal(opt) {
|
|
255
279
|
if (this.is('link') || this.is('redirect-target')) {
|
|
256
280
|
const { link, length, lastChild, type } = this, title = link.getTitleAttr();
|
|
257
|
-
return
|
|
281
|
+
return `<a${link.interwiki && ' class="extiw"'} href="${link.getUrl()}"${title && ` title="${title}"`}>${type === 'link' && length > 1
|
|
258
282
|
? lastChild.toHtmlInternal({ ...opt, nowrap: true })
|
|
259
|
-
: (0,
|
|
283
|
+
: (0, string_1.sanitize)(this.innerText)}</a>`;
|
|
260
284
|
}
|
|
261
285
|
return '';
|
|
262
286
|
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { LinkBaseToken } from './base';
|
|
2
|
-
import type { Token, AtomToken } from '../../internal';
|
|
3
2
|
import type { Title } from '../../lib/title';
|
|
3
|
+
import type { AST } from '../../base';
|
|
4
|
+
import type { Token, AtomToken } from '../../internal';
|
|
4
5
|
/**
|
|
6
|
+
* category
|
|
7
|
+
*
|
|
5
8
|
* 分类
|
|
6
9
|
* @classdesc `{childNodes: [AtomToken, ?Token]}`
|
|
7
10
|
*/
|
|
8
11
|
export declare abstract class CategoryToken extends LinkBaseToken {
|
|
9
12
|
readonly childNodes: readonly [AtomToken] | readonly [AtomToken, Token];
|
|
10
|
-
abstract get children(): [AtomToken] | [AtomToken, Token];
|
|
11
13
|
abstract get link(): Title;
|
|
14
|
+
abstract get children(): [AtomToken] | [AtomToken, Token];
|
|
12
15
|
abstract set link(link: string);
|
|
13
16
|
get type(): 'category';
|
|
14
|
-
/** 分类排序关键字 */
|
|
17
|
+
/** sort key / 分类排序关键字 */
|
|
15
18
|
get sortkey(): string | undefined;
|
|
16
19
|
set sortkey(text: string | undefined);
|
|
17
20
|
/**
|
|
21
|
+
* Set the sort key
|
|
22
|
+
*
|
|
18
23
|
* 设置排序关键字
|
|
19
|
-
* @param text 排序关键字
|
|
24
|
+
* @param text sort key / 排序关键字
|
|
20
25
|
*/
|
|
21
26
|
setSortkey(text?: string): void;
|
|
22
27
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CategoryToken = void 0;
|
|
4
|
+
const string_1 = require("../../util/string");
|
|
4
5
|
const base_1 = require("./base");
|
|
5
6
|
/* NOT FOR BROWSER */
|
|
6
|
-
const string_1 = require("../../util/string");
|
|
7
7
|
const constants_1 = require("../../util/constants");
|
|
8
8
|
/* NOT FOR BROWSER END */
|
|
9
9
|
/**
|
|
10
|
+
* category
|
|
11
|
+
*
|
|
10
12
|
* 分类
|
|
11
13
|
* @classdesc `{childNodes: [AtomToken, ?Token]}`
|
|
12
14
|
*/
|
|
@@ -15,18 +17,32 @@ class CategoryToken extends base_1.LinkBaseToken {
|
|
|
15
17
|
get type() {
|
|
16
18
|
return 'category';
|
|
17
19
|
}
|
|
18
|
-
/*
|
|
19
|
-
/** 分类排序关键字 */
|
|
20
|
+
/* PRINT ONLY */
|
|
21
|
+
/** sort key / 分类排序关键字 */
|
|
20
22
|
get sortkey() {
|
|
21
23
|
const { childNodes: [, child] } = this;
|
|
22
24
|
return child && (0, string_1.decodeHtml)(child.text());
|
|
23
25
|
}
|
|
26
|
+
/* PRINT ONLY END */
|
|
27
|
+
/* NOT FOR BROWSER */
|
|
24
28
|
set sortkey(text) {
|
|
25
29
|
this.setSortkey(text);
|
|
26
30
|
}
|
|
31
|
+
/* NOT FOR BROWSER END */
|
|
32
|
+
/** @private */
|
|
33
|
+
json(_, start = this.getAbsoluteIndex()) {
|
|
34
|
+
const json = super.json(undefined, start), { sortkey } = this;
|
|
35
|
+
if (sortkey) {
|
|
36
|
+
json['sortkey'] = sortkey;
|
|
37
|
+
}
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
/* NOT FOR BROWSER */
|
|
27
41
|
/**
|
|
42
|
+
* Set the sort key
|
|
43
|
+
*
|
|
28
44
|
* 设置排序关键字
|
|
29
|
-
* @param text 排序关键字
|
|
45
|
+
* @param text sort key / 排序关键字
|
|
30
46
|
*/
|
|
31
47
|
setSortkey(text) {
|
|
32
48
|
this.setLinkText(text);
|
package/dist/src/link/file.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import Parser from '../../index';
|
|
2
2
|
import { LinkBaseToken } from './base';
|
|
3
3
|
import { ImageParameterToken } from '../imageParameter';
|
|
4
|
-
import type { LintError } from '../../base';
|
|
4
|
+
import type { LintError, AST } from '../../base';
|
|
5
5
|
import type { Token, AtomToken } from '../../internal';
|
|
6
6
|
import { Title } from '../../lib/title';
|
|
7
7
|
/**
|
|
8
|
+
* image
|
|
9
|
+
*
|
|
8
10
|
* 图片
|
|
9
|
-
* @classdesc `{childNodes: [AtomToken, ...ImageParameterToken]}`
|
|
11
|
+
* @classdesc `{childNodes: [AtomToken, ...ImageParameterToken[]]}`
|
|
10
12
|
*/
|
|
11
13
|
export declare abstract class FileToken extends LinkBaseToken {
|
|
12
14
|
#private;
|
|
@@ -15,12 +17,12 @@ export declare abstract class FileToken extends LinkBaseToken {
|
|
|
15
17
|
abstract get children(): [AtomToken, ...ImageParameterToken[]];
|
|
16
18
|
abstract get lastElementChild(): AtomToken | ImageParameterToken;
|
|
17
19
|
get type(): 'file' | 'gallery-image' | 'imagemap-image';
|
|
18
|
-
/** 扩展名 */
|
|
20
|
+
/** file extension / 扩展名 */
|
|
19
21
|
get extension(): string | undefined;
|
|
20
|
-
/** 图片链接 */
|
|
22
|
+
/** image link / 图片链接 */
|
|
21
23
|
get link(): string | Title;
|
|
22
24
|
set link(value: string);
|
|
23
|
-
/** 图片大小 */
|
|
25
|
+
/** image size / 图片大小 */
|
|
24
26
|
get size(): {
|
|
25
27
|
width: string;
|
|
26
28
|
height: string;
|
|
@@ -29,10 +31,10 @@ export declare abstract class FileToken extends LinkBaseToken {
|
|
|
29
31
|
width: string;
|
|
30
32
|
height: string;
|
|
31
33
|
} | undefined);
|
|
32
|
-
/** 图片宽度 */
|
|
34
|
+
/** image width / 图片宽度 */
|
|
33
35
|
get width(): string | undefined;
|
|
34
36
|
set width(width: string | undefined);
|
|
35
|
-
/** 图片高度 */
|
|
37
|
+
/** image height / 图片高度 */
|
|
36
38
|
get height(): string | undefined;
|
|
37
39
|
set height(height: string | undefined);
|
|
38
40
|
/**
|
|
@@ -41,56 +43,102 @@ export declare abstract class FileToken extends LinkBaseToken {
|
|
|
41
43
|
* @param delimiter `|`
|
|
42
44
|
*/
|
|
43
45
|
constructor(link: string, text?: string, config?: Parser.Config, accum?: Token[], delimiter?: string);
|
|
44
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Get all image parameter tokens
|
|
48
|
+
*
|
|
49
|
+
* 获取所有图片参数节点
|
|
50
|
+
*/
|
|
45
51
|
getAllArgs(): ImageParameterToken[];
|
|
46
52
|
/**
|
|
53
|
+
* Get image parameters with the specified name
|
|
54
|
+
*
|
|
47
55
|
* 获取指定图片参数
|
|
48
|
-
* @param key 参数名
|
|
56
|
+
* @param key parameter name / 参数名
|
|
49
57
|
*/
|
|
50
58
|
getArgs(key: string): ImageParameterToken[];
|
|
51
59
|
/**
|
|
60
|
+
* Get the effective image parameter with the specified name
|
|
61
|
+
*
|
|
52
62
|
* 获取生效的指定图片参数
|
|
53
|
-
* @param key 参数名
|
|
63
|
+
* @param key parameter name / 参数名
|
|
54
64
|
*/
|
|
55
65
|
getArg(key: string): ImageParameterToken | undefined;
|
|
56
66
|
/**
|
|
67
|
+
* Get the effective image parameter value
|
|
68
|
+
*
|
|
57
69
|
* 获取生效的指定图片参数值
|
|
58
|
-
* @param key 参数名
|
|
70
|
+
* @param key parameter name / 参数名
|
|
59
71
|
*/
|
|
60
72
|
getValue(key: string): string | true | undefined;
|
|
61
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Get image frame parameter tokens
|
|
75
|
+
*
|
|
76
|
+
* 获取图片框架属性参数节点
|
|
77
|
+
*/
|
|
62
78
|
getFrameArgs(): ImageParameterToken[];
|
|
63
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Get image horizontal alignment parameter tokens
|
|
81
|
+
*
|
|
82
|
+
* 获取图片水平对齐参数节点
|
|
83
|
+
*/
|
|
64
84
|
getHorizAlignArgs(): ImageParameterToken[];
|
|
65
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Get image vertical alignment parameter tokens
|
|
87
|
+
*
|
|
88
|
+
* 获取图片垂直对齐参数节点
|
|
89
|
+
*/
|
|
66
90
|
getVertAlignArgs(): ImageParameterToken[];
|
|
67
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Get the effective image frame paremter value
|
|
93
|
+
*
|
|
94
|
+
* 获取生效的图片框架属性参数
|
|
95
|
+
*/
|
|
68
96
|
getFrame(): string | Title | undefined;
|
|
69
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Get the effective image horizontal alignment parameter value
|
|
99
|
+
*
|
|
100
|
+
* 获取生效的图片水平对齐参数
|
|
101
|
+
*/
|
|
70
102
|
getHorizAlign(): string | undefined;
|
|
71
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* Get the effective image vertical alignment parameter value
|
|
105
|
+
*
|
|
106
|
+
* 获取生效的图片垂直对齐参数
|
|
107
|
+
*/
|
|
72
108
|
getVertAlign(): string | undefined;
|
|
73
109
|
/**
|
|
110
|
+
* Check if the image contains the specified parameter
|
|
111
|
+
*
|
|
74
112
|
* 是否具有指定图片参数
|
|
75
|
-
* @param key 参数名
|
|
113
|
+
* @param key parameter name / 参数名
|
|
76
114
|
*/
|
|
77
115
|
hasArg(key: string): boolean;
|
|
78
116
|
/**
|
|
117
|
+
* Remove the specified image parameter
|
|
118
|
+
*
|
|
79
119
|
* 移除指定图片参数
|
|
80
|
-
* @param key 参数名
|
|
120
|
+
* @param key parameter name / 参数名
|
|
81
121
|
*/
|
|
82
122
|
removeArg(key: string): void;
|
|
83
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Get all image parameter names
|
|
125
|
+
*
|
|
126
|
+
* 获取图片参数名
|
|
127
|
+
*/
|
|
84
128
|
getKeys(): Set<string>;
|
|
85
129
|
/**
|
|
130
|
+
* Get the image parameter values with the specified name
|
|
131
|
+
*
|
|
86
132
|
* 获取指定的图片参数值
|
|
87
|
-
* @param key 参数名
|
|
133
|
+
* @param key parameter name / 参数名
|
|
88
134
|
*/
|
|
89
135
|
getValues(key: string): (string | true)[];
|
|
90
136
|
/**
|
|
137
|
+
* Set the image parameter
|
|
138
|
+
*
|
|
91
139
|
* 设置图片参数
|
|
92
|
-
* @param key 参数名
|
|
93
|
-
* @param value 参数值
|
|
140
|
+
* @param key parameter name / 参数名
|
|
141
|
+
* @param value parameter value / 参数值
|
|
94
142
|
* @throws `RangeError` 未定义的图片参数
|
|
95
143
|
*/
|
|
96
144
|
setValue(key: string, value?: string | boolean): void;
|