wikiparser-node 1.0.0-beta.3 → 1.0.1-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 (146) hide show
  1. package/README.md +10 -9
  2. package/bundle/bundle.min.js +37 -0
  3. package/config/llwiki.json +1 -35
  4. package/config/minimum.json +136 -0
  5. package/config/moegirl.json +1 -44
  6. package/config/zhwiki.json +1 -466
  7. package/extensions/dist/base.js +105 -0
  8. package/extensions/dist/editor.js +172 -0
  9. package/extensions/dist/highlight.js +46 -0
  10. package/extensions/dist/lint.js +43 -0
  11. package/extensions/editor.css +63 -0
  12. package/extensions/ui.css +119 -0
  13. package/package.json +35 -20
  14. package/config/.schema.json +0 -160
  15. package/dist/index.d.ts +0 -62
  16. package/dist/index.js +0 -305
  17. package/dist/internal.d.ts +0 -44
  18. package/dist/lib/element.d.ts +0 -186
  19. package/dist/lib/element.js +0 -659
  20. package/dist/lib/node.d.ts +0 -178
  21. package/dist/lib/node.js +0 -458
  22. package/dist/lib/range.d.ts +0 -132
  23. package/dist/lib/range.js +0 -387
  24. package/dist/lib/ranges.d.ts +0 -28
  25. package/dist/lib/ranges.js +0 -125
  26. package/dist/lib/text.d.ts +0 -78
  27. package/dist/lib/text.js +0 -227
  28. package/dist/lib/title.d.ts +0 -33
  29. package/dist/lib/title.js +0 -110
  30. package/dist/mixin/attributesParent.js +0 -93
  31. package/dist/mixin/fixed.js +0 -32
  32. package/dist/mixin/hidden.js +0 -23
  33. package/dist/mixin/singleLine.js +0 -26
  34. package/dist/mixin/sol.js +0 -44
  35. package/dist/parser/braces.js +0 -125
  36. package/dist/parser/commentAndExt.js +0 -58
  37. package/dist/parser/converter.js +0 -38
  38. package/dist/parser/externalLinks.js +0 -28
  39. package/dist/parser/hrAndDoubleUnderscore.js +0 -40
  40. package/dist/parser/html.js +0 -38
  41. package/dist/parser/links.js +0 -94
  42. package/dist/parser/list.js +0 -61
  43. package/dist/parser/magicLinks.js +0 -39
  44. package/dist/parser/quotes.js +0 -67
  45. package/dist/parser/selector.js +0 -165
  46. package/dist/parser/table.js +0 -117
  47. package/dist/src/arg.d.ts +0 -77
  48. package/dist/src/arg.js +0 -199
  49. package/dist/src/atom.d.ts +0 -11
  50. package/dist/src/atom.js +0 -24
  51. package/dist/src/attribute.d.ts +0 -106
  52. package/dist/src/attribute.js +0 -436
  53. package/dist/src/attributes.d.ts +0 -119
  54. package/dist/src/attributes.js +0 -366
  55. package/dist/src/converter.d.ts +0 -75
  56. package/dist/src/converter.js +0 -141
  57. package/dist/src/converterFlags.d.ts +0 -107
  58. package/dist/src/converterFlags.js +0 -238
  59. package/dist/src/converterRule.d.ts +0 -96
  60. package/dist/src/converterRule.js +0 -255
  61. package/dist/src/extLink.d.ts +0 -63
  62. package/dist/src/extLink.js +0 -157
  63. package/dist/src/gallery.d.ts +0 -70
  64. package/dist/src/gallery.js +0 -137
  65. package/dist/src/heading.d.ts +0 -82
  66. package/dist/src/heading.js +0 -135
  67. package/dist/src/hidden.d.ts +0 -19
  68. package/dist/src/hidden.js +0 -26
  69. package/dist/src/html.d.ts +0 -113
  70. package/dist/src/html.js +0 -245
  71. package/dist/src/imageParameter.d.ts +0 -82
  72. package/dist/src/imageParameter.js +0 -256
  73. package/dist/src/imagemap.d.ts +0 -77
  74. package/dist/src/imagemap.js +0 -169
  75. package/dist/src/imagemapLink.d.ts +0 -48
  76. package/dist/src/imagemapLink.js +0 -43
  77. package/dist/src/index.d.ts +0 -156
  78. package/dist/src/index.js +0 -819
  79. package/dist/src/link/base.d.ts +0 -69
  80. package/dist/src/link/base.js +0 -231
  81. package/dist/src/link/category.d.ts +0 -14
  82. package/dist/src/link/category.js +0 -28
  83. package/dist/src/link/file.d.ts +0 -105
  84. package/dist/src/link/file.js +0 -269
  85. package/dist/src/link/galleryImage.d.ts +0 -37
  86. package/dist/src/link/galleryImage.js +0 -100
  87. package/dist/src/link/index.d.ts +0 -50
  88. package/dist/src/link/index.js +0 -134
  89. package/dist/src/magicLink.d.ts +0 -46
  90. package/dist/src/magicLink.js +0 -131
  91. package/dist/src/nested.d.ts +0 -47
  92. package/dist/src/nested.js +0 -92
  93. package/dist/src/nowiki/base.d.ts +0 -38
  94. package/dist/src/nowiki/base.js +0 -31
  95. package/dist/src/nowiki/comment.d.ts +0 -42
  96. package/dist/src/nowiki/comment.js +0 -64
  97. package/dist/src/nowiki/dd.d.ts +0 -22
  98. package/dist/src/nowiki/dd.js +0 -46
  99. package/dist/src/nowiki/doubleUnderscore.d.ts +0 -35
  100. package/dist/src/nowiki/doubleUnderscore.js +0 -48
  101. package/dist/src/nowiki/hr.d.ts +0 -30
  102. package/dist/src/nowiki/hr.js +0 -36
  103. package/dist/src/nowiki/index.d.ts +0 -19
  104. package/dist/src/nowiki/index.js +0 -23
  105. package/dist/src/nowiki/list.d.ts +0 -16
  106. package/dist/src/nowiki/list.js +0 -13
  107. package/dist/src/nowiki/noinclude.d.ts +0 -21
  108. package/dist/src/nowiki/noinclude.js +0 -24
  109. package/dist/src/nowiki/quote.d.ts +0 -27
  110. package/dist/src/nowiki/quote.js +0 -58
  111. package/dist/src/onlyinclude.d.ts +0 -38
  112. package/dist/src/onlyinclude.js +0 -66
  113. package/dist/src/paramTag/index.d.ts +0 -50
  114. package/dist/src/paramTag/index.js +0 -78
  115. package/dist/src/paramTag/inputbox.d.ts +0 -7
  116. package/dist/src/paramTag/inputbox.js +0 -21
  117. package/dist/src/parameter.d.ts +0 -95
  118. package/dist/src/parameter.js +0 -204
  119. package/dist/src/pre.d.ts +0 -27
  120. package/dist/src/pre.js +0 -44
  121. package/dist/src/syntax.d.ts +0 -22
  122. package/dist/src/syntax.js +0 -67
  123. package/dist/src/table/base.d.ts +0 -60
  124. package/dist/src/table/base.js +0 -80
  125. package/dist/src/table/index.d.ts +0 -247
  126. package/dist/src/table/index.js +0 -783
  127. package/dist/src/table/td.d.ts +0 -119
  128. package/dist/src/table/td.js +0 -268
  129. package/dist/src/table/tr.d.ts +0 -31
  130. package/dist/src/table/tr.js +0 -50
  131. package/dist/src/table/trBase.d.ts +0 -62
  132. package/dist/src/table/trBase.js +0 -157
  133. package/dist/src/tagPair/ext.d.ts +0 -54
  134. package/dist/src/tagPair/ext.js +0 -150
  135. package/dist/src/tagPair/include.d.ts +0 -43
  136. package/dist/src/tagPair/include.js +0 -43
  137. package/dist/src/tagPair/index.d.ts +0 -57
  138. package/dist/src/tagPair/index.js +0 -113
  139. package/dist/src/transclude.d.ts +0 -200
  140. package/dist/src/transclude.js +0 -732
  141. package/dist/util/debug.js +0 -42
  142. package/dist/util/diff.js +0 -71
  143. package/dist/util/lint.js +0 -38
  144. package/dist/util/string.js +0 -74
  145. package/errors/README +0 -1
  146. package/printed/README +0 -1
@@ -1,69 +0,0 @@
1
- import { Token } from '..';
2
- import { AtomToken } from '../atom';
3
- import type { LintError } from '../../index';
4
- import type { Title } from '../../lib/title';
5
- /**
6
- * 内链
7
- * @classdesc `{childNodes: [AtomToken, ...Token]}`
8
- */
9
- export declare abstract class LinkBaseToken extends Token {
10
- #private;
11
- type: 'link' | 'category' | 'file' | 'gallery-image' | 'imagemap-image';
12
- name: string;
13
- childNodes: [AtomToken, ...Token[]];
14
- abstract get children(): [AtomToken, ...Token[]];
15
- abstract get firstChild(): AtomToken;
16
- abstract get firstElementChild(): AtomToken;
17
- abstract get lastChild(): Token;
18
- abstract get lastElementChild(): Token;
19
- /** 完整链接 */
20
- get link(): string | Title;
21
- set link(link: string | Title);
22
- /** fragment */
23
- get fragment(): string | undefined;
24
- /** 链接显示文字 */
25
- get innerText(): string | undefined;
26
- /**
27
- * @browser
28
- * @param link 链接标题
29
- * @param linkText 链接显示文字
30
- * @param delimiter `|`
31
- */
32
- constructor(link: string, linkText?: string, config?: import("../../index").Config, accum?: Token[], delimiter?: string);
33
- /**
34
- * @override
35
- * @browser
36
- */
37
- toString(selector?: string): string;
38
- /**
39
- * @override
40
- * @browser
41
- */
42
- text(): string;
43
- /**
44
- * @override
45
- * @browser
46
- */
47
- print(): string;
48
- /**
49
- * @override
50
- * @browser
51
- */
52
- lint(start?: number): LintError[];
53
- /** @override */
54
- cloneNode(this: this & {
55
- constructor: new (...args: any[]) => unknown;
56
- }): this;
57
- /**
58
- * 设置链接目标
59
- * @param link 链接目标
60
- * @throws `SyntaxError` 非法的链接目标
61
- */
62
- setTarget(link: string | Title): void;
63
- /**
64
- * 设置链接显示文字
65
- * @param linkStr 链接显示文字
66
- * @throws `SyntaxError` 非法的链接显示文字
67
- */
68
- setLinkText(linkStr?: string): void;
69
- }
@@ -1,231 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LinkBaseToken = void 0;
4
- const lint_1 = require("../../util/lint");
5
- const string_1 = require("../../util/string");
6
- const debug_1 = require("../../util/debug");
7
- const index_1 = require("../../index");
8
- const __1 = require("..");
9
- const atom_1 = require("../atom");
10
- /**
11
- * 内链
12
- * @classdesc `{childNodes: [AtomToken, ...Token]}`
13
- */
14
- class LinkBaseToken extends __1.Token {
15
- #bracket = true;
16
- #delimiter;
17
- #fragment;
18
- #encoded = false;
19
- /** 完整链接 */
20
- get link() {
21
- return this.#getTitle();
22
- }
23
- set link(link) {
24
- this.setTarget(link);
25
- }
26
- /** fragment */
27
- get fragment() {
28
- return this.#getTitle().fragment;
29
- }
30
- /** 链接显示文字 */
31
- get innerText() {
32
- if (this.type === 'link') {
33
- return this.length > 1
34
- ? this.lastChild.text()
35
- : this.firstChild.text().replace(/^\s*:/u, '');
36
- }
37
- return undefined;
38
- }
39
- /**
40
- * @browser
41
- * @param link 链接标题
42
- * @param linkText 链接显示文字
43
- * @param delimiter `|`
44
- */
45
- constructor(link, linkText, config = index_1.default.getConfig(), accum = [], delimiter = '|') {
46
- super(undefined, config, true, accum, {
47
- AtomToken: 0, Token: 1,
48
- });
49
- this.insertAt(new atom_1.AtomToken(link, 'link-target', config, accum, {
50
- 'Stage-2': ':', '!ExtToken': '', '!HeadingToken': '',
51
- }));
52
- if (linkText !== undefined) {
53
- const inner = new __1.Token(linkText, config, true, accum, {
54
- 'Stage-5': ':', ConverterToken: ':',
55
- });
56
- inner.type = 'link-text';
57
- this.insertAt(inner.setAttribute('stage', index_1.default.MAX_STAGE - 1));
58
- }
59
- this.#delimiter = delimiter;
60
- this.protectChildren(0);
61
- }
62
- /** @private */
63
- afterBuild() {
64
- const titleObj = this.normalizeTitle(this.firstChild.text(), 0, false, true, true);
65
- this.setAttribute('name', titleObj.title);
66
- this.#fragment = titleObj.fragment;
67
- this.#encoded = titleObj.encoded;
68
- if (this.#delimiter.includes('\0')) {
69
- this.#delimiter = this.buildFromStr(this.#delimiter, 'string');
70
- }
71
- const /** @implements */ linkListener = (e, data) => {
72
- const { prevTarget } = e;
73
- if (prevTarget?.type === 'link-target') {
74
- const name = prevTarget.text(), { title, interwiki, ns, valid, fragment, encoded } = this.normalizeTitle(name, 0, false, true, true);
75
- if (!valid) {
76
- (0, debug_1.undo)(e, data);
77
- throw new Error(`非法的内链目标:${name}`);
78
- }
79
- else if (this.type === 'category' && (interwiki || ns !== 14)
80
- || this.type === 'file' && (interwiki || ns !== 6)) {
81
- (0, debug_1.undo)(e, data);
82
- throw new Error(`${this.type === 'file' ? '文件' : '分类'}链接不可更改命名空间:${name}`);
83
- }
84
- else if (this.type === 'link' && !interwiki && (ns === 6 || ns === 14)
85
- && !name.trim().startsWith(':')) {
86
- const { firstChild } = prevTarget;
87
- if (firstChild?.type === 'text') {
88
- firstChild.insertData(0, ':');
89
- }
90
- else {
91
- prevTarget.prepend(':');
92
- }
93
- }
94
- this.setAttribute('name', title);
95
- this.#fragment = fragment;
96
- this.#encoded = encoded;
97
- }
98
- };
99
- this.addEventListener(['remove', 'insert', 'replace', 'text'], linkListener);
100
- }
101
- /** @private */
102
- setAttribute(key, value) {
103
- if (key === 'bracket') {
104
- this.#bracket = Boolean(value);
105
- return this;
106
- }
107
- return super.setAttribute(key, value);
108
- }
109
- /**
110
- * @override
111
- * @browser
112
- */
113
- toString(selector) {
114
- const str = super.toString(selector, this.#delimiter);
115
- return this.#bracket && !(selector && this.matches(selector)) ? `[[${str}]]` : str;
116
- }
117
- /**
118
- * @override
119
- * @browser
120
- */
121
- text() {
122
- const str = super.text('|');
123
- return this.#bracket ? `[[${str}]]` : str;
124
- }
125
- /** @private */
126
- getPadding() {
127
- return 2;
128
- }
129
- /** @private */
130
- getGaps(i) {
131
- if (i >= this.length - 1) {
132
- return 0;
133
- }
134
- return i === 0 ? this.#delimiter.length : 1;
135
- }
136
- /**
137
- * @override
138
- * @browser
139
- */
140
- print() {
141
- return super.print(this.#bracket ? { pre: '[[', post: ']]', sep: this.#delimiter } : { sep: this.#delimiter });
142
- }
143
- /**
144
- * @override
145
- * @browser
146
- */
147
- lint(start = this.getAbsoluteIndex()) {
148
- const errors = super.lint(start), { childNodes: [target, linkText], type: linkType } = this;
149
- let rect;
150
- if (linkType === 'link' && target.childNodes.some(({ type }) => type === 'template')) {
151
- rect = { start, ...this.getRootNode().posFromIndex(start) };
152
- errors.push((0, lint_1.generateForChild)(target, rect, 'template in an internal link target', 'warning'));
153
- }
154
- if (this.#encoded) {
155
- rect ??= { start, ...this.getRootNode().posFromIndex(start) };
156
- errors.push((0, lint_1.generateForChild)(target, rect, 'unnecessary URL encoding in an internal link'));
157
- }
158
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
159
- if (linkType === 'link' && linkText?.childNodes?.some(child => child.type === 'text' && child.data.includes('|'))) {
160
- rect ??= { start, ...this.getRootNode().posFromIndex(start) };
161
- errors.push((0, lint_1.generateForChild)(linkText, rect, 'additional "|" in the link text', 'warning'));
162
- }
163
- else if (linkType !== 'link' && this.#fragment !== undefined) {
164
- rect ??= { start, ...this.getRootNode().posFromIndex(start) };
165
- errors.push((0, lint_1.generateForChild)(target, rect, 'useless fragment'));
166
- }
167
- return errors;
168
- }
169
- /** 生成Title对象 */
170
- #getTitle() {
171
- return this.normalizeTitle(this.firstChild.text(), 0, false, true, true);
172
- }
173
- /** @override */
174
- cloneNode() {
175
- const [link, ...linkText] = this.cloneChildNodes();
176
- return index_1.default.run(() => {
177
- const token = new this.constructor('', undefined, this.getAttribute('config'));
178
- token.firstChild.safeReplaceWith(link);
179
- token.append(...linkText);
180
- token.afterBuild();
181
- return token;
182
- });
183
- }
184
- /**
185
- * 设置链接目标
186
- * @param link 链接目标
187
- * @throws `SyntaxError` 非法的链接目标
188
- */
189
- setTarget(link) {
190
- let strLink = String(link);
191
- if (this.type === 'link' && !/^\s*[:#]/u.test(strLink)) {
192
- strLink = `:${strLink}`;
193
- }
194
- const root = index_1.default.parse(`[[${strLink}]]`, this.getAttribute('include'), 6, this.getAttribute('config')), { length, firstChild: wikiLink } = root;
195
- if (length !== 1 || wikiLink?.type !== this.type || wikiLink.length !== 1) {
196
- const msgs = { link: '内链', file: '文件链接', category: '分类' };
197
- throw new SyntaxError(`非法的${msgs[this.type]}目标:${strLink}`);
198
- }
199
- const { firstChild } = wikiLink;
200
- wikiLink.destroy();
201
- this.firstChild.safeReplaceWith(firstChild);
202
- }
203
- /**
204
- * 设置链接显示文字
205
- * @param linkStr 链接显示文字
206
- * @throws `SyntaxError` 非法的链接显示文字
207
- */
208
- setLinkText(linkStr = '') {
209
- let lastChild;
210
- const config = this.getAttribute('config');
211
- if (linkStr) {
212
- const root = index_1.default.parse(`[[${this.type === 'category' ? 'Category:' : ''}L|${linkStr}]]`, this.getAttribute('include'), 6, config), { length, firstChild: wikiLink } = root;
213
- if (length !== 1 || wikiLink?.type !== this.type || wikiLink.length !== 2) {
214
- throw new SyntaxError(`非法的${this.type === 'link' ? '内链文字' : '分类关键字'}:${(0, string_1.noWrap)(linkStr)}`);
215
- }
216
- ({ lastChild } = wikiLink);
217
- }
218
- else {
219
- lastChild = index_1.default.run(() => new __1.Token('', config));
220
- lastChild.setAttribute('stage', 7).type = 'link-text';
221
- }
222
- if (this.length === 1) {
223
- this.insertAt(lastChild);
224
- }
225
- else {
226
- this.lastChild.safeReplaceWith(lastChild);
227
- }
228
- }
229
- }
230
- exports.LinkBaseToken = LinkBaseToken;
231
- index_1.default.classes['LinkBaseToken'] = __filename;
@@ -1,14 +0,0 @@
1
- import { LinkToken } from '.';
2
- /** 分类 */
3
- export declare abstract class CategoryToken extends LinkToken {
4
- /** @browser */
5
- readonly type = "category";
6
- /** 分类排序关键字 */
7
- get sortkey(): string | undefined;
8
- set sortkey(text: string | undefined);
9
- /**
10
- * 设置排序关键字
11
- * @param text 排序关键字
12
- */
13
- setSortkey(text?: string): void;
14
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CategoryToken = void 0;
4
- const string_1 = require("../../util/string");
5
- const index_1 = require("../../index");
6
- const _1 = require(".");
7
- /** 分类 */
8
- class CategoryToken extends _1.LinkToken {
9
- /** @browser */
10
- type = 'category';
11
- /** 分类排序关键字 */
12
- get sortkey() {
13
- const { childNodes: [, child] } = this;
14
- return child && (0, string_1.decodeHtml)(child.text());
15
- }
16
- set sortkey(text) {
17
- this.setSortkey(text);
18
- }
19
- /**
20
- * 设置排序关键字
21
- * @param text 排序关键字
22
- */
23
- setSortkey(text) {
24
- this.setLinkText(text);
25
- }
26
- }
27
- exports.CategoryToken = CategoryToken;
28
- index_1.default.classes['CategoryToken'] = __filename;
@@ -1,105 +0,0 @@
1
- import { LinkBaseToken } from './base';
2
- import { ImageParameterToken } from '../imageParameter';
3
- import type { Title } from '../../lib/title';
4
- import type { LintError } from '../../index';
5
- import type { Token, AtomToken } from '../../internal';
6
- /**
7
- * 图片
8
- * @classdesc `{childNodes: [AtomToken, ...ImageParameterToken]}`
9
- */
10
- export declare abstract class FileToken extends LinkBaseToken {
11
- #private;
12
- /** @browser */
13
- readonly type: 'file' | 'gallery-image' | 'imagemap-image';
14
- childNodes: [AtomToken, ...ImageParameterToken[]];
15
- abstract get children(): [AtomToken, ...ImageParameterToken[]];
16
- abstract get lastChild(): ImageParameterToken;
17
- abstract get lastElementChild(): ImageParameterToken;
18
- /** 图片链接 */
19
- get link(): string | Title;
20
- set link(value: string | Title);
21
- /** 图片大小 */
22
- get size(): {
23
- width: string;
24
- height: string;
25
- } | undefined;
26
- /** 图片宽度 */
27
- get width(): string | undefined;
28
- set width(width: string | undefined);
29
- /** 图片高度 */
30
- get height(): string | undefined;
31
- set height(height: string | undefined);
32
- /**
33
- * @browser
34
- * @param link 文件名
35
- * @param text 图片参数
36
- * @param delimiter `|`
37
- */
38
- constructor(link: string, text?: string, config?: import("../../index").Config, accum?: Token[], delimiter?: string);
39
- /**
40
- * @override
41
- * @browser
42
- */
43
- lint(start?: number): LintError[];
44
- /**
45
- * 获取所有图片参数节点
46
- * @browser
47
- */
48
- getAllArgs(): ImageParameterToken[];
49
- /**
50
- * 获取指定图片参数
51
- * @browser
52
- * @param key 参数名
53
- */
54
- getArgs(key: string): ImageParameterToken[];
55
- /**
56
- * 获取图片框架属性参数节点
57
- * @browser
58
- */
59
- getFrameArgs(): ImageParameterToken[];
60
- /**
61
- * 获取图片水平对齐参数节点
62
- * @browser
63
- */
64
- getHorizAlignArgs(): ImageParameterToken[];
65
- /**
66
- * 获取图片垂直对齐参数节点
67
- * @browser
68
- */
69
- getVertAlignArgs(): ImageParameterToken[];
70
- /**
71
- * 获取生效的指定图片参数
72
- * @param key 参数名
73
- */
74
- getArg(key: string): ImageParameterToken | undefined;
75
- /**
76
- * 是否具有指定图片参数
77
- * @param key 参数名
78
- */
79
- hasArg(key: string): boolean;
80
- /**
81
- * 移除指定图片参数
82
- * @param key 参数名
83
- */
84
- removeArg(key: string): void;
85
- /** 获取图片参数名 */
86
- getKeys(): Set<string>;
87
- /**
88
- * 获取指定的图片参数值
89
- * @param key 参数名
90
- */
91
- getValues(key: string): (string | true)[];
92
- /**
93
- * 获取生效的指定图片参数值
94
- * @param key 参数名
95
- */
96
- getValue(key: string): string | true | undefined;
97
- /**
98
- * 设置图片参数
99
- * @param key 参数名
100
- * @param value 参数值
101
- * @throws `RangeError` 未定义的图片参数
102
- * @throws `SyntaxError` 非法的参数
103
- */
104
- setValue(key: string, value?: string | boolean): void;
105
- }