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.
Files changed (154) hide show
  1. package/README.md +1 -1
  2. package/bundle/bundle.es7.js +28 -28
  3. package/bundle/bundle.lsp.js +30 -30
  4. package/bundle/bundle.min.js +29 -29
  5. package/coverage/badge.svg +1 -1
  6. package/data/signatures.json +43 -0
  7. package/dist/addon/table.js +7 -4
  8. package/dist/addon/token.js +119 -113
  9. package/dist/addon/transclude.js +7 -5
  10. package/dist/base.d.mts +99 -30
  11. package/dist/base.d.ts +99 -30
  12. package/dist/index.d.ts +10 -4
  13. package/dist/index.js +59 -14
  14. package/dist/lib/attributes.js +2 -2
  15. package/dist/lib/element.d.ts +128 -29
  16. package/dist/lib/element.js +178 -32
  17. package/dist/lib/lsp.d.ts +62 -27
  18. package/dist/lib/lsp.js +395 -304
  19. package/dist/lib/node.d.ts +123 -54
  20. package/dist/lib/node.js +216 -87
  21. package/dist/lib/range.d.ts +83 -31
  22. package/dist/lib/range.js +83 -31
  23. package/dist/lib/ranges.d.ts +1 -1
  24. package/dist/lib/ranges.js +3 -2
  25. package/dist/lib/text.d.ts +40 -14
  26. package/dist/lib/text.js +47 -19
  27. package/dist/lib/title.d.ts +54 -17
  28. package/dist/lib/title.js +101 -47
  29. package/dist/mixin/attributesParent.d.ts +37 -21
  30. package/dist/mixin/attributesParent.js +18 -20
  31. package/dist/mixin/flagsParent.d.ts +38 -12
  32. package/dist/mixin/hidden.d.ts +0 -2
  33. package/dist/mixin/hidden.js +0 -2
  34. package/dist/mixin/magicLinkParent.d.ts +11 -5
  35. package/dist/mixin/singleLine.d.ts +0 -2
  36. package/dist/mixin/singleLine.js +3 -3
  37. package/dist/mixin/sol.d.ts +0 -2
  38. package/dist/mixin/sol.js +2 -3
  39. package/dist/mixin/syntax.d.ts +0 -2
  40. package/dist/mixin/syntax.js +0 -2
  41. package/dist/parser/braces.js +4 -2
  42. package/dist/parser/links.js +13 -7
  43. package/dist/parser/list.js +3 -1
  44. package/dist/parser/quotes.js +22 -2
  45. package/dist/parser/redirect.js +4 -1
  46. package/dist/parser/selector.js +1 -1
  47. package/dist/src/arg.d.ts +19 -9
  48. package/dist/src/arg.js +34 -15
  49. package/dist/src/atom.d.ts +5 -1
  50. package/dist/src/atom.js +5 -1
  51. package/dist/src/attribute.d.ts +26 -8
  52. package/dist/src/attribute.js +30 -11
  53. package/dist/src/attributes.d.ts +50 -22
  54. package/dist/src/attributes.js +54 -26
  55. package/dist/src/converter.d.ts +4 -2
  56. package/dist/src/converter.js +12 -9
  57. package/dist/src/converterFlags.d.ts +45 -15
  58. package/dist/src/converterFlags.js +45 -15
  59. package/dist/src/converterRule.d.ts +30 -11
  60. package/dist/src/converterRule.js +46 -16
  61. package/dist/src/extLink.d.ts +6 -2
  62. package/dist/src/extLink.js +14 -11
  63. package/dist/src/gallery.d.ts +13 -9
  64. package/dist/src/gallery.js +35 -21
  65. package/dist/src/heading.d.ts +13 -7
  66. package/dist/src/heading.js +28 -18
  67. package/dist/src/hidden.d.ts +5 -1
  68. package/dist/src/hidden.js +7 -3
  69. package/dist/src/html.d.ts +12 -10
  70. package/dist/src/html.js +17 -12
  71. package/dist/src/imageParameter.d.ts +27 -12
  72. package/dist/src/imageParameter.js +27 -12
  73. package/dist/src/imagemap.d.ts +4 -4
  74. package/dist/src/imagemap.js +9 -5
  75. package/dist/src/imagemapLink.d.ts +3 -1
  76. package/dist/src/imagemapLink.js +3 -1
  77. package/dist/src/index.d.ts +65 -64
  78. package/dist/src/index.js +111 -132
  79. package/dist/src/link/base.d.ts +14 -6
  80. package/dist/src/link/base.js +45 -21
  81. package/dist/src/link/category.d.ts +9 -4
  82. package/dist/src/link/category.js +20 -4
  83. package/dist/src/link/file.d.ts +71 -23
  84. package/dist/src/link/file.js +100 -36
  85. package/dist/src/link/galleryImage.d.ts +8 -4
  86. package/dist/src/link/galleryImage.js +15 -8
  87. package/dist/src/link/index.d.ts +14 -6
  88. package/dist/src/link/index.js +15 -5
  89. package/dist/src/link/redirectTarget.d.ts +4 -3
  90. package/dist/src/link/redirectTarget.js +5 -3
  91. package/dist/src/magicLink.d.ts +28 -12
  92. package/dist/src/magicLink.js +56 -34
  93. package/dist/src/nested.d.ts +5 -3
  94. package/dist/src/nested.js +9 -6
  95. package/dist/src/nowiki/base.d.ts +4 -2
  96. package/dist/src/nowiki/base.js +6 -5
  97. package/dist/src/nowiki/comment.d.ts +6 -2
  98. package/dist/src/nowiki/comment.js +8 -3
  99. package/dist/src/nowiki/dd.d.ts +0 -3
  100. package/dist/src/nowiki/dd.js +0 -8
  101. package/dist/src/nowiki/doubleUnderscore.d.ts +5 -1
  102. package/dist/src/nowiki/doubleUnderscore.js +5 -1
  103. package/dist/src/nowiki/index.d.ts +5 -1
  104. package/dist/src/nowiki/index.js +5 -1
  105. package/dist/src/nowiki/list.d.ts +5 -1
  106. package/dist/src/nowiki/list.js +5 -1
  107. package/dist/src/nowiki/listBase.d.ts +15 -5
  108. package/dist/src/nowiki/listBase.js +41 -10
  109. package/dist/src/nowiki/noinclude.d.ts +5 -1
  110. package/dist/src/nowiki/noinclude.js +5 -1
  111. package/dist/src/nowiki/quote.d.ts +15 -8
  112. package/dist/src/nowiki/quote.js +32 -12
  113. package/dist/src/onlyinclude.d.ts +4 -2
  114. package/dist/src/onlyinclude.js +4 -2
  115. package/dist/src/paramTag/index.d.ts +1 -1
  116. package/dist/src/paramTag/index.js +1 -1
  117. package/dist/src/parameter.d.ts +24 -12
  118. package/dist/src/parameter.js +45 -27
  119. package/dist/src/pre.d.ts +1 -1
  120. package/dist/src/pre.js +1 -1
  121. package/dist/src/redirect.d.ts +2 -0
  122. package/dist/src/redirect.js +2 -0
  123. package/dist/src/syntax.d.ts +5 -1
  124. package/dist/src/syntax.js +5 -1
  125. package/dist/src/table/base.d.ts +5 -1
  126. package/dist/src/table/base.js +11 -4
  127. package/dist/src/table/index.d.ts +134 -66
  128. package/dist/src/table/index.js +149 -81
  129. package/dist/src/table/td.d.ts +18 -10
  130. package/dist/src/table/td.js +23 -15
  131. package/dist/src/table/tr.d.ts +13 -3
  132. package/dist/src/table/tr.js +14 -6
  133. package/dist/src/table/trBase.d.ts +28 -12
  134. package/dist/src/table/trBase.js +28 -18
  135. package/dist/src/tagPair/ext.d.ts +3 -1
  136. package/dist/src/tagPair/ext.js +11 -10
  137. package/dist/src/tagPair/include.d.ts +8 -2
  138. package/dist/src/tagPair/include.js +8 -2
  139. package/dist/src/tagPair/index.d.ts +6 -2
  140. package/dist/src/tagPair/index.js +6 -2
  141. package/dist/src/transclude.d.ts +107 -33
  142. package/dist/src/transclude.js +139 -45
  143. package/dist/util/debug.js +2 -7
  144. package/dist/util/html.js +1 -14
  145. package/dist/util/string.js +7 -1
  146. package/extensions/dist/base.js +25 -8
  147. package/extensions/dist/codejar.js +2 -1
  148. package/extensions/dist/lsp.js +5 -10
  149. package/extensions/es7/base.js +25 -8
  150. package/extensions/ui.css +1 -162
  151. package/i18n/zh-hans.json +1 -1
  152. package/i18n/zh-hant.json +1 -1
  153. package/package.json +3 -3
  154. package/extensions/dist/test-page.js +0 -89
@@ -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
- return this.#title;
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) && !name.trim().startsWith(':')) {
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 textNode = linkText?.childNodes.find((c) => c.type === 'text' && c.data.includes('|'));
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 + textNode.getRelativeIndex();
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'), textNode = target.childNodes.find((c) => c.type === 'text' && c.data.includes('#'));
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: [e.startIndex + textNode.getRelativeIndex() + textNode.data.indexOf('#'), e.endIndex],
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, string_2.encode)(fragment);
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.parse(linkStr, this.getAttribute('include'), undefined, this.getAttribute('config'));
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 (0, html_1.font)(this, `<a${link.interwiki && ' class="extiw"'} href="${link.getUrl()}"${title && ` title="${title}"`}>${type === 'link' && length > 1
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, string_2.sanitize)(this.innerText)}</a>`);
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
- /* NOT FOR BROWSER */
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);
@@ -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;