wikiparser-node 0.11.0 → 1.0.0-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.
- package/README.md +10 -9
- package/bundle/bundle.min.js +37 -0
- package/config/llwiki.json +1 -35
- package/config/minimum.json +136 -0
- package/config/moegirl.json +1 -44
- package/config/zhwiki.json +1 -466
- package/extensions/dist/base.js +105 -0
- package/extensions/dist/editor.js +172 -0
- package/extensions/dist/highlight.js +46 -0
- package/extensions/dist/lint.js +43 -0
- package/extensions/editor.css +63 -0
- package/extensions/ui.css +119 -0
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +38 -31
- package/config/.schema.json +0 -134
- package/dist/index.d.ts +0 -114
- package/dist/lib/element.d.ts +0 -162
- package/dist/lib/node.d.ts +0 -291
- package/dist/lib/ranges.d.ts +0 -37
- package/dist/lib/text.d.ts +0 -64
- package/dist/lib/title.d.ts +0 -21
- package/dist/mixin/attributeParent.d.ts +0 -9
- package/dist/mixin/fixedToken.d.ts +0 -8
- package/dist/mixin/hidden.d.ts +0 -8
- package/dist/mixin/singleLine.d.ts +0 -8
- package/dist/mixin/sol.d.ts +0 -8
- package/dist/parser/brackets.d.ts +0 -12
- package/dist/parser/commentAndExt.d.ts +0 -8
- package/dist/parser/converter.d.ts +0 -7
- package/dist/parser/externalLinks.d.ts +0 -7
- package/dist/parser/hrAndDoubleUnderscore.d.ts +0 -11
- package/dist/parser/html.d.ts +0 -7
- package/dist/parser/links.d.ts +0 -7
- package/dist/parser/list.d.ts +0 -7
- package/dist/parser/magicLinks.d.ts +0 -7
- package/dist/parser/quotes.d.ts +0 -7
- package/dist/parser/selector.d.ts +0 -12
- package/dist/parser/table.d.ts +0 -11
- package/dist/src/arg.d.ts +0 -54
- package/dist/src/atom/hidden.d.ts +0 -5
- package/dist/src/atom/index.d.ts +0 -15
- package/dist/src/attribute.d.ts +0 -65
- package/dist/src/attributes.d.ts +0 -112
- package/dist/src/charinsert.d.ts +0 -32
- package/dist/src/converter.d.ts +0 -103
- package/dist/src/converterFlags.d.ts +0 -83
- package/dist/src/converterRule.d.ts +0 -75
- package/dist/src/extLink.d.ts +0 -62
- package/dist/src/gallery.d.ts +0 -33
- package/dist/src/hasNowiki/index.d.ts +0 -14
- package/dist/src/hasNowiki/pre.d.ts +0 -13
- package/dist/src/heading.d.ts +0 -44
- package/dist/src/html.d.ts +0 -56
- package/dist/src/imageParameter.d.ts +0 -65
- package/dist/src/imagemap.d.ts +0 -37
- package/dist/src/imagemapLink.d.ts +0 -21
- package/dist/src/index.d.ts +0 -186
- package/dist/src/link/category.d.ts +0 -16
- package/dist/src/link/file.d.ts +0 -85
- package/dist/src/link/galleryImage.d.ts +0 -15
- package/dist/src/link/index.d.ts +0 -88
- package/dist/src/magicLink.d.ts +0 -36
- package/dist/src/nested/choose.d.ts +0 -13
- package/dist/src/nested/combobox.d.ts +0 -13
- package/dist/src/nested/index.d.ts +0 -18
- package/dist/src/nested/references.d.ts +0 -13
- package/dist/src/nowiki/comment.d.ts +0 -31
- package/dist/src/nowiki/dd.d.ts +0 -17
- package/dist/src/nowiki/doubleUnderscore.d.ts +0 -22
- package/dist/src/nowiki/hr.d.ts +0 -13
- package/dist/src/nowiki/index.d.ts +0 -27
- package/dist/src/nowiki/list.d.ts +0 -8
- package/dist/src/nowiki/noinclude.d.ts +0 -8
- package/dist/src/nowiki/quote.d.ts +0 -13
- package/dist/src/onlyinclude.d.ts +0 -24
- package/dist/src/paramTag/index.d.ts +0 -29
- package/dist/src/paramTag/inputbox.d.ts +0 -8
- package/dist/src/parameter.d.ts +0 -75
- package/dist/src/syntax.d.ts +0 -20
- package/dist/src/table/index.d.ts +0 -273
- package/dist/src/table/td.d.ts +0 -100
- package/dist/src/table/tr.d.ts +0 -91
- package/dist/src/tagPair/ext.d.ts +0 -18
- package/dist/src/tagPair/include.d.ts +0 -25
- package/dist/src/tagPair/index.d.ts +0 -41
- package/dist/src/transclude.d.ts +0 -199
- package/dist/tool/index.d.ts +0 -420
- package/dist/util/base.d.ts +0 -10
- package/dist/util/debug.d.ts +0 -20
- package/dist/util/diff.d.ts +0 -8
- package/dist/util/lint.d.ts +0 -28
- package/dist/util/string.d.ts +0 -55
- package/index.js +0 -333
- package/lib/element.js +0 -618
- package/lib/node.js +0 -730
- package/lib/ranges.js +0 -130
- package/lib/text.js +0 -265
- package/lib/title.js +0 -83
- package/mixin/attributeParent.js +0 -117
- package/mixin/fixedToken.js +0 -40
- package/mixin/hidden.js +0 -21
- package/mixin/singleLine.js +0 -31
- package/mixin/sol.js +0 -54
- package/parser/brackets.js +0 -128
- package/parser/commentAndExt.js +0 -62
- package/parser/converter.js +0 -46
- package/parser/externalLinks.js +0 -33
- package/parser/hrAndDoubleUnderscore.js +0 -49
- package/parser/html.js +0 -42
- package/parser/links.js +0 -94
- package/parser/list.js +0 -59
- package/parser/magicLinks.js +0 -41
- package/parser/quotes.js +0 -64
- package/parser/selector.js +0 -180
- package/parser/table.js +0 -114
- package/src/arg.js +0 -207
- package/src/atom/hidden.js +0 -13
- package/src/atom/index.js +0 -43
- package/src/attribute.js +0 -472
- package/src/attributes.js +0 -453
- package/src/charinsert.js +0 -97
- package/src/converter.js +0 -176
- package/src/converterFlags.js +0 -284
- package/src/converterRule.js +0 -256
- package/src/extLink.js +0 -180
- package/src/gallery.js +0 -149
- package/src/hasNowiki/index.js +0 -44
- package/src/hasNowiki/pre.js +0 -40
- package/src/heading.js +0 -134
- package/src/html.js +0 -254
- package/src/imageParameter.js +0 -303
- package/src/imagemap.js +0 -199
- package/src/imagemapLink.js +0 -41
- package/src/index.js +0 -938
- package/src/link/category.js +0 -44
- package/src/link/file.js +0 -287
- package/src/link/galleryImage.js +0 -120
- package/src/link/index.js +0 -388
- package/src/magicLink.js +0 -151
- package/src/nested/choose.js +0 -24
- package/src/nested/combobox.js +0 -23
- package/src/nested/index.js +0 -96
- package/src/nested/references.js +0 -23
- package/src/nowiki/comment.js +0 -71
- package/src/nowiki/dd.js +0 -59
- package/src/nowiki/doubleUnderscore.js +0 -56
- package/src/nowiki/hr.js +0 -41
- package/src/nowiki/index.js +0 -56
- package/src/nowiki/list.js +0 -16
- package/src/nowiki/noinclude.js +0 -28
- package/src/nowiki/quote.js +0 -69
- package/src/onlyinclude.js +0 -64
- package/src/paramTag/index.js +0 -89
- package/src/paramTag/inputbox.js +0 -35
- package/src/parameter.js +0 -239
- package/src/syntax.js +0 -91
- package/src/table/index.js +0 -985
- package/src/table/td.js +0 -343
- package/src/table/tr.js +0 -319
- package/src/tagPair/ext.js +0 -146
- package/src/tagPair/include.js +0 -50
- package/src/tagPair/index.js +0 -131
- package/src/transclude.js +0 -843
- package/tool/index.js +0 -1209
- package/typings/api.d.ts +0 -9
- package/typings/array.d.ts +0 -29
- package/typings/event.d.ts +0 -22
- package/typings/index.d.ts +0 -118
- package/typings/node.d.ts +0 -35
- package/typings/parser.d.ts +0 -12
- package/typings/table.d.ts +0 -10
- package/typings/token.d.ts +0 -31
- package/typings/tool.d.ts +0 -6
- package/util/base.js +0 -17
- package/util/debug.js +0 -73
- package/util/diff.js +0 -76
- package/util/lint.js +0 -57
- package/util/string.js +0 -126
package/dist/mixin/hidden.d.ts
DELETED
package/dist/mixin/sol.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export = parseBrackets;
|
|
2
|
-
/**
|
|
3
|
-
* 解析花括号
|
|
4
|
-
* @param {string} text wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
* @throws TranscludeToken.constructor()
|
|
7
|
-
*/
|
|
8
|
-
declare function parseBrackets(text: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
9
|
-
declare namespace parseBrackets {
|
|
10
|
-
export { BracketExecArray };
|
|
11
|
-
}
|
|
12
|
-
type BracketExecArray = import('../../typings/parser').BracketExecArray;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export = parseCommentAndExt;
|
|
2
|
-
/**
|
|
3
|
-
* 解析HTML注释和扩展标签
|
|
4
|
-
* @param {string} text wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
* @param {boolean} includeOnly 是否嵌入
|
|
7
|
-
*/
|
|
8
|
-
declare function parseCommentAndExt(text: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum, includeOnly?: boolean): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseConverter;
|
|
2
|
-
/**
|
|
3
|
-
* 解析语言变体转换
|
|
4
|
-
* @param {string} wikitext wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseConverter(wikitext: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseExternalLinks;
|
|
2
|
-
/**
|
|
3
|
-
* 解析外部链接
|
|
4
|
-
* @param {string} wikitext wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseExternalLinks(wikitext: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export = parseHrAndDoubleUnderscore;
|
|
2
|
-
/**
|
|
3
|
-
* 解析\<hr\>和状态开关
|
|
4
|
-
* @param {Token & {firstChild: AstText}} root 根节点
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseHrAndDoubleUnderscore({ firstChild: { data }, type, name }: Token & {
|
|
8
|
-
firstChild: AstText;
|
|
9
|
-
}, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
10
|
-
import Token = require("../src");
|
|
11
|
-
import AstText = require("../lib/text");
|
package/dist/parser/html.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseHtml;
|
|
2
|
-
/**
|
|
3
|
-
* 解析HTML标签
|
|
4
|
-
* @param {string} wikitext wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseHtml(wikitext: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
package/dist/parser/links.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseLinks;
|
|
2
|
-
/**
|
|
3
|
-
* 解析内部链接
|
|
4
|
-
* @param {string} wikitext wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseLinks(wikitext: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
package/dist/parser/list.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseList;
|
|
2
|
-
/**
|
|
3
|
-
* 解析列表
|
|
4
|
-
* @param {string} text wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseList(text: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseMagicLinks;
|
|
2
|
-
/**
|
|
3
|
-
* 解析自由外链
|
|
4
|
-
* @param {string} wikitext wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseMagicLinks(wikitext: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
package/dist/parser/quotes.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export = parseQuotes;
|
|
2
|
-
/**
|
|
3
|
-
* 解析单引号
|
|
4
|
-
* @param {string} text wikitext
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseQuotes(text: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export = parseSelector;
|
|
2
|
-
/**
|
|
3
|
-
* 解析选择器
|
|
4
|
-
* @param {string} selector
|
|
5
|
-
* @throws `SyntaxError` 非法的选择器
|
|
6
|
-
*/
|
|
7
|
-
declare function parseSelector(selector: string): import("../../typings/parser").SelectorArray[][];
|
|
8
|
-
declare namespace parseSelector {
|
|
9
|
-
export { SelectorArray, pseudo };
|
|
10
|
-
}
|
|
11
|
-
type SelectorArray = import('../../typings/parser').SelectorArray;
|
|
12
|
-
type pseudo = import('../../typings/parser').pseudo;
|
package/dist/parser/table.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export = parseTable;
|
|
2
|
-
/**
|
|
3
|
-
* 解析表格,注意`tr`和`td`包含开头的换行
|
|
4
|
-
* @param {Token & {firstChild: AstText}} root 根节点
|
|
5
|
-
* @param {import('../../typings/token').accum} accum
|
|
6
|
-
*/
|
|
7
|
-
declare function parseTable({ firstChild: { data }, type, name }: Token & {
|
|
8
|
-
firstChild: AstText;
|
|
9
|
-
}, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum): string;
|
|
10
|
-
import Token = require("../src");
|
|
11
|
-
import AstText = require("../lib/text");
|
package/dist/src/arg.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export = ArgToken;
|
|
2
|
-
/**
|
|
3
|
-
* `{{{}}}`包裹的参数
|
|
4
|
-
* @classdesc `{childNodes: [AtomToken, ?Token, ...HiddenToken]}`
|
|
5
|
-
*/
|
|
6
|
-
declare class ArgToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {string[]} parts 以'|'分隔的各部分
|
|
9
|
-
* @param {import('../../typings/token').accum} accum
|
|
10
|
-
* @complexity `n`
|
|
11
|
-
*/
|
|
12
|
-
constructor(parts: string[], config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
13
|
-
/** default */
|
|
14
|
-
get default(): string | false;
|
|
15
|
-
/**
|
|
16
|
-
* @override
|
|
17
|
-
* @param {string} selector
|
|
18
|
-
*/
|
|
19
|
-
override toString(selector: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* @override
|
|
22
|
-
* @returns {string}
|
|
23
|
-
*/
|
|
24
|
-
override text(): string;
|
|
25
|
-
/** @override */
|
|
26
|
-
override print(): string;
|
|
27
|
-
/** @override */
|
|
28
|
-
override cloneNode(): ArgToken;
|
|
29
|
-
/**
|
|
30
|
-
* 移除无效部分
|
|
31
|
-
* @complexity `n`
|
|
32
|
-
*/
|
|
33
|
-
removeRedundant(): void;
|
|
34
|
-
/**
|
|
35
|
-
* @override
|
|
36
|
-
* @param {Token} token 待插入的子节点
|
|
37
|
-
* @param {number} i 插入位置
|
|
38
|
-
* @throws `RangeError` 不可插入多余子节点
|
|
39
|
-
*/
|
|
40
|
-
override insertAt(token: Token, i?: number): Token;
|
|
41
|
-
/**
|
|
42
|
-
* 设置参数名
|
|
43
|
-
* @param {string} name 新参数名
|
|
44
|
-
* @throws `SyntaxError` 非法的参数名
|
|
45
|
-
*/
|
|
46
|
-
setName(name: string): void;
|
|
47
|
-
/**
|
|
48
|
-
* 设置预设值
|
|
49
|
-
* @param {string} value 预设值
|
|
50
|
-
* @throws `SyntaxError` 非法的参数预设值
|
|
51
|
-
*/
|
|
52
|
-
setDefault(value: string): void;
|
|
53
|
-
}
|
|
54
|
-
import Token = require(".");
|
package/dist/src/atom/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export = AtomToken;
|
|
2
|
-
/**
|
|
3
|
-
* 不会被继续解析的plain Token
|
|
4
|
-
* @classdesc `{childNodes: ...AstText|Token}`
|
|
5
|
-
*/
|
|
6
|
-
declare class AtomToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {string} wikitext wikitext
|
|
9
|
-
* @param {string|undefined} type Token.type
|
|
10
|
-
* @param {import('../../../typings/token').accum} accum
|
|
11
|
-
* @param {import('../../../typings/token').acceptable} acceptable 可接受的子节点设置
|
|
12
|
-
*/
|
|
13
|
-
constructor(wikitext: string, type: string | undefined, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum, acceptable?: import('../../../typings/token').acceptable);
|
|
14
|
-
}
|
|
15
|
-
import Token = require("..");
|
package/dist/src/attribute.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export = AttributeToken;
|
|
2
|
-
/**
|
|
3
|
-
* 扩展和HTML标签属性
|
|
4
|
-
* @classdesc `{childNodes: [AtomToken, Token|AtomToken]}`
|
|
5
|
-
*/
|
|
6
|
-
declare class AttributeToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {'ext-attr'|'html-attr'|'table-attr'} type 标签类型
|
|
9
|
-
* @param {string} tag 标签名
|
|
10
|
-
* @param {string} key 属性名
|
|
11
|
-
* @param {string} equal 等号
|
|
12
|
-
* @param {string} value 属性值
|
|
13
|
-
* @param {string[]} quotes 引号
|
|
14
|
-
* @param {import('../../typings/token').accum} accum
|
|
15
|
-
*/
|
|
16
|
-
constructor(type: 'ext-attr' | 'html-attr' | 'table-attr', tag: string, key: string, equal?: string, value?: string, quotes?: string[], config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
17
|
-
/** 引号是否匹配 */
|
|
18
|
-
get balanced(): boolean;
|
|
19
|
-
set value(arg: string | true);
|
|
20
|
-
/** getValue()的getter */
|
|
21
|
-
get value(): string | true;
|
|
22
|
-
/** 标签名 */
|
|
23
|
-
get tag(): string;
|
|
24
|
-
type: "ext-attr" | "html-attr" | "table-attr";
|
|
25
|
-
/**
|
|
26
|
-
* @override
|
|
27
|
-
* @param {string} selector
|
|
28
|
-
* @returns {string}
|
|
29
|
-
*/
|
|
30
|
-
override toString(selector: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* @override
|
|
33
|
-
* @returns {string}
|
|
34
|
-
*/
|
|
35
|
-
override text(): string;
|
|
36
|
-
/** @override */
|
|
37
|
-
override print(): string;
|
|
38
|
-
/** 获取属性值 */
|
|
39
|
-
getValue(): string | true;
|
|
40
|
-
/** @override */
|
|
41
|
-
override cloneNode(): import("./attribute");
|
|
42
|
-
/** 转义等号 */
|
|
43
|
-
escape(): void;
|
|
44
|
-
/** 闭合引号 */
|
|
45
|
-
close(): void;
|
|
46
|
-
/**
|
|
47
|
-
* 设置属性值
|
|
48
|
-
* @param {string|boolean} value 参数值
|
|
49
|
-
* @throws `SyntaxError` 非法的标签属性
|
|
50
|
-
*/
|
|
51
|
-
setValue(value: string | boolean): void;
|
|
52
|
-
/**
|
|
53
|
-
* 修改属性名
|
|
54
|
-
* @param {string} key 新属性名
|
|
55
|
-
* @throws `Error` title属性不能更名
|
|
56
|
-
* @throws `SyntaxError` 非法的模板参数名
|
|
57
|
-
*/
|
|
58
|
-
rename(key: string): void;
|
|
59
|
-
#private;
|
|
60
|
-
}
|
|
61
|
-
declare namespace AttributeToken {
|
|
62
|
-
export { ParserConfig };
|
|
63
|
-
}
|
|
64
|
-
import Token = require(".");
|
|
65
|
-
type ParserConfig = import('../../typings/token').ParserConfig;
|
package/dist/src/attributes.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
export = AttributesToken;
|
|
2
|
-
/**
|
|
3
|
-
* 扩展和HTML标签属性
|
|
4
|
-
* @classdesc `{childNodes: ...AtomToken|AttributeToken}`
|
|
5
|
-
*/
|
|
6
|
-
declare class AttributesToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {string} attr 标签属性
|
|
9
|
-
* @param {'ext-attrs'|'html-attrs'|'table-attrs'} type 标签类型
|
|
10
|
-
* @param {string} name 标签名
|
|
11
|
-
* @param {import('../../typings/token').accum} accum
|
|
12
|
-
*/
|
|
13
|
-
constructor(attr: string, type: 'ext-attrs' | 'html-attrs' | 'table-attrs', name: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
14
|
-
/** getAttrs()方法的getter写法 */
|
|
15
|
-
get attributes(): {
|
|
16
|
-
[k: string]: string | boolean;
|
|
17
|
-
};
|
|
18
|
-
set className(arg: string);
|
|
19
|
-
/** 以字符串表示的class属性 */
|
|
20
|
-
get className(): string;
|
|
21
|
-
/** 以Set表示的class属性 */
|
|
22
|
-
get classList(): Set<string>;
|
|
23
|
-
set id(arg: string);
|
|
24
|
-
/** id属性 */
|
|
25
|
-
get id(): string;
|
|
26
|
-
/** 是否含有无效属性 */
|
|
27
|
-
get sanitized(): boolean;
|
|
28
|
-
type: "ext-attrs" | "html-attrs" | "table-attrs";
|
|
29
|
-
/**
|
|
30
|
-
* 所有指定属性名的AttributeToken
|
|
31
|
-
* @param {string} key 属性名
|
|
32
|
-
* @returns {AttributeToken[]}
|
|
33
|
-
*/
|
|
34
|
-
getAttrTokens(key: string): AttributeToken[];
|
|
35
|
-
/**
|
|
36
|
-
* 制定属性名的最后一个AttributeToken
|
|
37
|
-
* @param {string} key 属性名
|
|
38
|
-
*/
|
|
39
|
-
getAttrToken(key: string): AttributeToken;
|
|
40
|
-
/**
|
|
41
|
-
* 获取标签属性
|
|
42
|
-
* @param {string} key 属性键
|
|
43
|
-
*/
|
|
44
|
-
getAttr(key: string): string | true;
|
|
45
|
-
/**
|
|
46
|
-
* @override
|
|
47
|
-
* @this {AttributesToken & {parentNode: HtmlToken}}
|
|
48
|
-
*/
|
|
49
|
-
override print(this: AttributesToken & {
|
|
50
|
-
parentNode: import("./html");
|
|
51
|
-
}): string;
|
|
52
|
-
/** 清理标签属性 */
|
|
53
|
-
sanitize(): void;
|
|
54
|
-
/** @override */
|
|
55
|
-
override cloneNode(): AttributesToken;
|
|
56
|
-
/**
|
|
57
|
-
* 所有无效属性
|
|
58
|
-
* @returns {AtomToken[]}
|
|
59
|
-
*/
|
|
60
|
-
getDirtyAttrs(): AtomToken[];
|
|
61
|
-
/**
|
|
62
|
-
* @override
|
|
63
|
-
* @param {AttributeToken} token 待插入的子节点
|
|
64
|
-
* @param {number} i 插入位置
|
|
65
|
-
* @throws `RangeError` 不是AttributeToken或标签不匹配
|
|
66
|
-
*/
|
|
67
|
-
override insertAt(token: AttributeToken, i?: number): AttributeToken;
|
|
68
|
-
/**
|
|
69
|
-
* 设置标签属性
|
|
70
|
-
* @param {string} key 属性键
|
|
71
|
-
* @param {string|boolean} value 属性值
|
|
72
|
-
* @throws `RangeError` 扩展标签属性不能包含">"
|
|
73
|
-
* @throws `RangeError` 无效的属性名
|
|
74
|
-
*/
|
|
75
|
-
setAttr(key: string, value: string | boolean): void;
|
|
76
|
-
/**
|
|
77
|
-
* 标签是否具有某属性
|
|
78
|
-
* @param {string} key 属性键
|
|
79
|
-
*/
|
|
80
|
-
hasAttr(key: string): boolean;
|
|
81
|
-
/** 获取全部的标签属性名 */
|
|
82
|
-
getAttrNames(): Set<any>;
|
|
83
|
-
/** 标签是否具有任意属性 */
|
|
84
|
-
hasAttrs(): boolean;
|
|
85
|
-
/** 获取全部标签属性 */
|
|
86
|
-
getAttrs(): {
|
|
87
|
-
[k: string]: string | boolean;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* 移除标签属性
|
|
91
|
-
* @param {string} key 属性键
|
|
92
|
-
*/
|
|
93
|
-
removeAttr(key: string): void;
|
|
94
|
-
/**
|
|
95
|
-
* 开关标签属性
|
|
96
|
-
* @param {string} key 属性键
|
|
97
|
-
* @param {boolean|undefined} force 强制开启或关闭
|
|
98
|
-
* @throws `RangeError` 不为Boolean类型的属性值
|
|
99
|
-
*/
|
|
100
|
-
toggleAttr(key: string, force: boolean | undefined): void;
|
|
101
|
-
/**
|
|
102
|
-
* @override
|
|
103
|
-
* @param {string} selector
|
|
104
|
-
*/
|
|
105
|
-
override toString(selector: string): string;
|
|
106
|
-
/** @override */
|
|
107
|
-
override text(): string;
|
|
108
|
-
#private;
|
|
109
|
-
}
|
|
110
|
-
import Token = require(".");
|
|
111
|
-
import AttributeToken = require("./attribute");
|
|
112
|
-
import AtomToken = require("./atom");
|
package/dist/src/charinsert.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export = CharinsertToken;
|
|
2
|
-
/**
|
|
3
|
-
* `<charinsert>`
|
|
4
|
-
* @classdesc `{childNodes: [...HasNowikiToken]}`
|
|
5
|
-
*/
|
|
6
|
-
declare class CharinsertToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {string} wikitext wikitext
|
|
9
|
-
* @param {import('../../typings/token').accum} accum
|
|
10
|
-
*/
|
|
11
|
-
constructor(wikitext: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
12
|
-
/**
|
|
13
|
-
* @override
|
|
14
|
-
* @param {string} selector
|
|
15
|
-
*/
|
|
16
|
-
override toString(selector: string): string;
|
|
17
|
-
/** @override */
|
|
18
|
-
override print(): string;
|
|
19
|
-
/** @override */
|
|
20
|
-
override cloneNode(): CharinsertToken;
|
|
21
|
-
/**
|
|
22
|
-
* 获取某一行的插入选项
|
|
23
|
-
* @param {number|HasNowikiToken} child 行号或子节点
|
|
24
|
-
*/
|
|
25
|
-
getLineItems(child: number | HasNowikiToken): (string | string[])[];
|
|
26
|
-
/** 获取所有插入选项 */
|
|
27
|
-
getAllItems(): (string | string[])[];
|
|
28
|
-
/** @override */
|
|
29
|
-
override text(): string;
|
|
30
|
-
}
|
|
31
|
-
import Token = require(".");
|
|
32
|
-
import HasNowikiToken = require("./hasNowiki");
|
package/dist/src/converter.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
export = ConverterToken;
|
|
2
|
-
/**
|
|
3
|
-
* 转换
|
|
4
|
-
* @classdesc `{childNodes: [ConverterFlagsToken, ...ConverterRuleToken]}`
|
|
5
|
-
*/
|
|
6
|
-
declare class ConverterToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {string[]} flags 转换类型标记
|
|
9
|
-
* @param {string[]} rules 转换规则
|
|
10
|
-
* @param {import('../../typings/token').accum} accum
|
|
11
|
-
*/
|
|
12
|
-
constructor(flags: string[], rules: string[], config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
13
|
-
/**
|
|
14
|
-
* 是否无转换
|
|
15
|
-
* @this {ConverterToken & {lastChild: ConverterRuleToken}}
|
|
16
|
-
*/
|
|
17
|
-
get noConvert(): boolean;
|
|
18
|
-
/** flags */
|
|
19
|
-
get flags(): Set<string>;
|
|
20
|
-
/**
|
|
21
|
-
* @override
|
|
22
|
-
* @param {string} selector
|
|
23
|
-
* @returns {string}
|
|
24
|
-
*/
|
|
25
|
-
override toString(selector: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* @override
|
|
28
|
-
* @returns {string}
|
|
29
|
-
*/
|
|
30
|
-
override text(): string;
|
|
31
|
-
/**
|
|
32
|
-
* @override
|
|
33
|
-
* @param {number} i 子节点位置
|
|
34
|
-
*/
|
|
35
|
-
override getGaps(i?: number): 1 | 0;
|
|
36
|
-
/** @override */
|
|
37
|
-
override print(): string;
|
|
38
|
-
/** @override */
|
|
39
|
-
override cloneNode(): ConverterToken;
|
|
40
|
-
/**
|
|
41
|
-
* 获取所有转换类型标记
|
|
42
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
43
|
-
*/
|
|
44
|
-
getAllFlags(this: {
|
|
45
|
-
firstChild: ConverterFlagsToken;
|
|
46
|
-
}): Set<string>;
|
|
47
|
-
/**
|
|
48
|
-
* 获取有效的转换类型标记
|
|
49
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
50
|
-
*/
|
|
51
|
-
getEffectiveFlags(this: {
|
|
52
|
-
firstChild: ConverterFlagsToken;
|
|
53
|
-
}): Set<string>;
|
|
54
|
-
/**
|
|
55
|
-
* 获取未知的转换类型标记
|
|
56
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
57
|
-
*/
|
|
58
|
-
getUnknownFlags(this: {
|
|
59
|
-
firstChild: ConverterFlagsToken;
|
|
60
|
-
}): Set<string>;
|
|
61
|
-
/**
|
|
62
|
-
* 是否具有某转换类型标记
|
|
63
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
64
|
-
* @param {string} flag 转换类型标记
|
|
65
|
-
*/
|
|
66
|
-
hasFlag(this: {
|
|
67
|
-
firstChild: ConverterFlagsToken;
|
|
68
|
-
}, flag: string): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* 是否具有某有效的转换类型标记
|
|
71
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
72
|
-
* @param {string} flag 转换类型标记
|
|
73
|
-
*/
|
|
74
|
-
hasEffectiveFlag(this: {
|
|
75
|
-
firstChild: ConverterFlagsToken;
|
|
76
|
-
}, flag: string): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* 移除转换类型标记
|
|
79
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
80
|
-
* @param {string} flag 转换类型标记
|
|
81
|
-
*/
|
|
82
|
-
removeFlag(this: {
|
|
83
|
-
firstChild: ConverterFlagsToken;
|
|
84
|
-
}, flag: string): void;
|
|
85
|
-
/**
|
|
86
|
-
* 设置转换类型标记
|
|
87
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
88
|
-
* @param {string} flag 转换类型标记
|
|
89
|
-
*/
|
|
90
|
-
setFlag(this: {
|
|
91
|
-
firstChild: ConverterFlagsToken;
|
|
92
|
-
}, flag: string): void;
|
|
93
|
-
/**
|
|
94
|
-
* 开关某转换类型标记
|
|
95
|
-
* @this {{firstChild: ConverterFlagsToken}}
|
|
96
|
-
* @param {string} flag 转换类型标记
|
|
97
|
-
*/
|
|
98
|
-
toggleFlag(this: {
|
|
99
|
-
firstChild: ConverterFlagsToken;
|
|
100
|
-
}, flag: string): void;
|
|
101
|
-
}
|
|
102
|
-
import Token = require(".");
|
|
103
|
-
import ConverterFlagsToken = require("./converterFlags");
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
export = ConverterFlagsToken;
|
|
2
|
-
/**
|
|
3
|
-
* 转换flags
|
|
4
|
-
* @classdesc `{childNodes: ...AtomToken}`
|
|
5
|
-
*/
|
|
6
|
-
declare class ConverterFlagsToken extends Token {
|
|
7
|
-
/**
|
|
8
|
-
* @param {string[]} flags 转换类型标记
|
|
9
|
-
* @param {import('../../typings/token').accum} accum
|
|
10
|
-
*/
|
|
11
|
-
constructor(flags: string[], config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
12
|
-
/**
|
|
13
|
-
* @override
|
|
14
|
-
* @param {string} selector
|
|
15
|
-
*/
|
|
16
|
-
override toString(selector: string): string;
|
|
17
|
-
/** @override */
|
|
18
|
-
override text(): string;
|
|
19
|
-
/** @override */
|
|
20
|
-
override print(): string;
|
|
21
|
-
/**
|
|
22
|
-
* 获取未知转换类型标记
|
|
23
|
-
* @complexity `n`
|
|
24
|
-
*/
|
|
25
|
-
getUnknownFlags(): Set<string>;
|
|
26
|
-
/** 获取指定语言变体的转换标记 */
|
|
27
|
-
getVariantFlags(): Set<string>;
|
|
28
|
-
/** @override */
|
|
29
|
-
override cloneNode(): ConverterFlagsToken;
|
|
30
|
-
/**
|
|
31
|
-
* @override
|
|
32
|
-
* @param {AtomToken} token 待插入的子节点
|
|
33
|
-
* @param {number} i 插入位置
|
|
34
|
-
* @complexity `n`
|
|
35
|
-
*/
|
|
36
|
-
override insertAt(token: AtomToken, i?: number): AtomToken;
|
|
37
|
-
/** 获取所有转换类型标记 */
|
|
38
|
-
getAllFlags(): Set<string>;
|
|
39
|
-
/**
|
|
40
|
-
* 获取转换类型标记节点
|
|
41
|
-
* @param {string} flag 转换类型标记
|
|
42
|
-
* @returns {AtomToken[]}
|
|
43
|
-
* @complexity `n`
|
|
44
|
-
*/
|
|
45
|
-
getFlagToken(flag: string): AtomToken[];
|
|
46
|
-
/**
|
|
47
|
-
* 获取有效转换类型标记
|
|
48
|
-
* @complexity `n`
|
|
49
|
-
*/
|
|
50
|
-
getEffectiveFlags(): Set<string>;
|
|
51
|
-
/**
|
|
52
|
-
* 是否具有某转换类型标记
|
|
53
|
-
* @param {string} flag 转换类型标记
|
|
54
|
-
*/
|
|
55
|
-
hasFlag(flag: string): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* 是否具有某有效转换类型标记
|
|
58
|
-
* @param {string} flag 转换类型标记
|
|
59
|
-
* @complexity `n`
|
|
60
|
-
*/
|
|
61
|
-
hasEffectiveFlag(flag: string): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* 移除某转换类型标记
|
|
64
|
-
* @param {string} flag 转换类型标记
|
|
65
|
-
* @complexity `n²`
|
|
66
|
-
*/
|
|
67
|
-
removeFlag(flag: string): void;
|
|
68
|
-
/**
|
|
69
|
-
* 设置转换类型标记
|
|
70
|
-
* @param {string} flag 转换类型标记
|
|
71
|
-
* @complexity `n`
|
|
72
|
-
*/
|
|
73
|
-
setFlag(flag: string): void;
|
|
74
|
-
/**
|
|
75
|
-
* 开关转换类型标记
|
|
76
|
-
* @param {string} flag 转换类型标记
|
|
77
|
-
* @complexity `n²`
|
|
78
|
-
*/
|
|
79
|
-
toggleFlag(flag: string): void;
|
|
80
|
-
#private;
|
|
81
|
-
}
|
|
82
|
-
import Token = require(".");
|
|
83
|
-
import AtomToken = require("./atom");
|