wikiparser-node 0.10.0 → 0.11.0-m
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 +44 -32
- package/config/.schema.json +1 -8
- package/config/default.json +1 -2
- package/config/llwiki.json +1 -36
- package/config/moegirl.json +1 -45
- package/config/zhwiki.json +1 -467
- package/dist/index.d.ts +110 -0
- package/dist/lib/element.d.ts +48 -0
- package/dist/lib/node.d.ts +108 -0
- package/dist/lib/text.d.ts +30 -0
- package/dist/lib/title.d.ts +15 -0
- package/dist/mixin/hidden.d.ts +8 -0
- package/dist/parser/brackets.d.ts +12 -0
- package/dist/parser/commentAndExt.d.ts +8 -0
- package/dist/parser/converter.d.ts +7 -0
- package/dist/parser/externalLinks.d.ts +7 -0
- package/dist/parser/hrAndDoubleUnderscore.d.ts +11 -0
- package/dist/parser/html.d.ts +7 -0
- package/dist/parser/links.d.ts +7 -0
- package/dist/parser/list.d.ts +7 -0
- package/dist/parser/magicLinks.d.ts +7 -0
- package/dist/parser/quotes.d.ts +7 -0
- package/dist/parser/table.d.ts +11 -0
- package/dist/src/arg.d.ts +25 -0
- package/dist/src/atom/hidden.d.ts +5 -0
- package/dist/src/atom/index.d.ts +14 -0
- package/dist/src/attribute.d.ts +42 -0
- package/dist/src/attributes.d.ts +33 -0
- package/dist/src/converter.d.ts +29 -0
- package/dist/src/converterFlags.d.ts +27 -0
- package/dist/src/converterRule.d.ts +29 -0
- package/dist/src/extLink.d.ts +22 -0
- package/dist/src/gallery.d.ts +19 -0
- package/dist/src/hasNowiki/index.d.ts +14 -0
- package/dist/src/hasNowiki/pre.d.ts +13 -0
- package/dist/src/heading.d.ts +24 -0
- package/dist/src/html.d.ts +33 -0
- package/dist/src/imageParameter.d.ts +23 -0
- package/dist/src/imagemap.d.ts +26 -0
- package/dist/src/imagemapLink.d.ts +16 -0
- package/dist/src/index.d.ts +53 -0
- package/dist/src/link/category.d.ts +8 -0
- package/dist/src/link/file.d.ts +27 -0
- package/dist/src/link/galleryImage.d.ts +15 -0
- package/dist/src/link/index.d.ts +29 -0
- package/dist/src/magicLink.d.ts +14 -0
- package/dist/src/nested/choose.d.ts +13 -0
- package/dist/src/nested/combobox.d.ts +13 -0
- package/dist/src/nested/index.d.ts +20 -0
- package/dist/src/nested/references.d.ts +13 -0
- package/dist/src/nowiki/comment.d.ts +19 -0
- package/dist/src/nowiki/dd.d.ts +8 -0
- package/dist/src/nowiki/doubleUnderscore.d.ts +12 -0
- package/dist/src/nowiki/hr.d.ts +13 -0
- package/dist/src/nowiki/index.d.ts +18 -0
- package/dist/src/nowiki/list.d.ts +8 -0
- package/dist/src/nowiki/noinclude.d.ts +8 -0
- package/dist/src/nowiki/quote.d.ts +20 -0
- package/dist/src/onlyinclude.d.ts +17 -0
- package/dist/src/paramTag/index.d.ts +24 -0
- package/dist/src/paramTag/inputbox.d.ts +8 -0
- package/dist/src/parameter.d.ts +28 -0
- package/dist/src/syntax.d.ts +15 -0
- package/dist/src/table/index.d.ts +16 -0
- package/dist/src/table/td.d.ts +39 -0
- package/dist/src/table/tr.d.ts +17 -0
- package/dist/src/tagPair/ext.d.ts +17 -0
- package/dist/src/tagPair/include.d.ts +16 -0
- package/dist/src/tagPair/index.d.ts +28 -0
- package/dist/src/transclude.d.ts +75 -0
- package/dist/util/lint.d.ts +28 -0
- package/dist/util/string.d.ts +31 -0
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/index.js +5 -257
- package/lib/element.js +7 -482
- package/lib/node.js +11 -540
- package/lib/text.js +3 -96
- package/lib/title.js +1 -28
- package/mixin/hidden.js +0 -3
- package/package.json +11 -5
- package/parser/brackets.js +3 -2
- package/parser/commentAndExt.js +8 -6
- package/parser/converter.js +1 -2
- package/parser/externalLinks.js +1 -2
- package/parser/hrAndDoubleUnderscore.js +1 -2
- package/parser/html.js +1 -2
- package/parser/links.js +5 -6
- package/parser/list.js +1 -2
- package/parser/magicLinks.js +1 -2
- package/parser/quotes.js +1 -2
- package/parser/table.js +1 -2
- package/src/arg.js +4 -118
- package/src/atom/hidden.js +0 -2
- package/src/atom/index.js +1 -18
- package/src/attribute.js +6 -190
- package/src/attributes.js +5 -308
- package/src/converter.js +3 -109
- package/src/converterFlags.js +1 -188
- package/src/converterRule.js +2 -184
- package/src/extLink.js +2 -122
- package/src/gallery.js +2 -56
- package/src/hasNowiki/index.js +1 -13
- package/src/hasNowiki/pre.js +1 -13
- package/src/heading.js +4 -55
- package/src/html.js +5 -120
- package/src/imageParameter.js +3 -165
- package/src/imagemap.js +3 -62
- package/src/imagemapLink.js +2 -14
- package/src/index.js +9 -530
- package/src/link/category.js +1 -32
- package/src/link/file.js +3 -158
- package/src/link/galleryImage.js +3 -61
- package/src/link/index.js +4 -273
- package/src/magicLink.js +6 -87
- package/src/nested/choose.js +1 -2
- package/src/nested/combobox.js +1 -2
- package/src/nested/index.js +8 -32
- package/src/nested/references.js +1 -2
- package/src/nowiki/comment.js +2 -26
- package/src/nowiki/dd.js +1 -47
- package/src/nowiki/doubleUnderscore.js +1 -31
- package/src/nowiki/hr.js +2 -21
- package/src/nowiki/index.js +2 -24
- package/src/nowiki/list.js +2 -5
- package/src/nowiki/noinclude.js +0 -14
- package/src/nowiki/quote.js +2 -16
- package/src/onlyinclude.js +2 -27
- package/src/paramTag/index.js +2 -25
- package/src/paramTag/inputbox.js +2 -5
- package/src/parameter.js +6 -148
- package/src/syntax.js +1 -69
- package/src/table/index.js +2 -939
- package/src/table/td.js +6 -226
- package/src/table/tr.js +3 -248
- package/src/tagPair/ext.js +4 -23
- package/src/tagPair/include.js +1 -25
- package/src/tagPair/index.js +3 -52
- package/src/transclude.js +6 -513
- package/typings/api.d.ts +9 -0
- package/typings/index.d.ts +51 -0
- package/typings/node.d.ts +16 -0
- package/typings/parser.d.ts +5 -0
- package/typings/token.d.ts +28 -0
- package/util/lint.js +2 -0
- package/util/string.js +0 -51
- package/lib/ranges.js +0 -130
- package/mixin/attributeParent.js +0 -117
- package/mixin/fixedToken.js +0 -40
- package/mixin/singleLine.js +0 -31
- package/mixin/sol.js +0 -54
- package/parser/selector.js +0 -177
- package/src/charinsert.js +0 -97
- package/tool/index.js +0 -1202
- package/util/debug.js +0 -73
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export = GalleryToken;
|
|
2
|
+
/**
|
|
3
|
+
* gallery标签
|
|
4
|
+
* @classdesc `{childNodes: ...(GalleryImageToken|HiddenToken|AstText)}`
|
|
5
|
+
*/
|
|
6
|
+
declare class GalleryToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} inner 标签内部wikitext
|
|
9
|
+
* @param {import('../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(inner: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
12
|
+
/**
|
|
13
|
+
* @override
|
|
14
|
+
*/
|
|
15
|
+
override toString(selector: any): string;
|
|
16
|
+
/** @override */
|
|
17
|
+
override text(): string;
|
|
18
|
+
}
|
|
19
|
+
import Token = require(".");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export = HasNowikiToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<pre>`
|
|
4
|
+
* @classdesc `{childNodes: [...AstText|NoincludeToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class HasNowikiToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} wikitext wikitext
|
|
9
|
+
* @param {string} type type
|
|
10
|
+
* @param {import('../../../typings/token').accum} accum
|
|
11
|
+
*/
|
|
12
|
+
constructor(wikitext: string, type: string, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
13
|
+
}
|
|
14
|
+
import Token = require("..");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export = PreToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<pre>`
|
|
4
|
+
* @classdesc `{childNodes: [...AstText|NoincludeToken|ConverterToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class PreToken extends HasNowikiToken {
|
|
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
|
+
import HasNowikiToken = require(".");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export = HeadingToken;
|
|
2
|
+
/**
|
|
3
|
+
* 章节标题
|
|
4
|
+
* @classdesc `{childNodes: [Token, SyntaxToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class HeadingToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {number} level 标题层级
|
|
9
|
+
* @param {string[]} input 标题文字
|
|
10
|
+
* @param {import('../../typings/token').accum} accum
|
|
11
|
+
*/
|
|
12
|
+
constructor(level: number, input: string[], config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
13
|
+
/**
|
|
14
|
+
* @override
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
override toString(selector: any): string;
|
|
18
|
+
/**
|
|
19
|
+
* @override
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
override text(): string;
|
|
23
|
+
}
|
|
24
|
+
import Token = require(".");
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export = HtmlToken;
|
|
2
|
+
/**
|
|
3
|
+
* HTML标签
|
|
4
|
+
* @classdesc `{childNodes: [AttributesToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class HtmlToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} name 标签名
|
|
9
|
+
* @param {AttributesToken} attr 标签属性
|
|
10
|
+
* @param {boolean} closing 是否闭合
|
|
11
|
+
* @param {boolean} selfClosing 是否自封闭
|
|
12
|
+
* @param {import('../../typings/token').accum} accum
|
|
13
|
+
*/
|
|
14
|
+
constructor(name: string, attr: AttributesToken, closing: boolean, selfClosing: boolean, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
15
|
+
/** getter */
|
|
16
|
+
get closing(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @override
|
|
19
|
+
*/
|
|
20
|
+
override toString(selector: any): string;
|
|
21
|
+
/** @override */
|
|
22
|
+
override text(): string;
|
|
23
|
+
/**
|
|
24
|
+
* 搜索匹配的标签
|
|
25
|
+
* @complexity `n`
|
|
26
|
+
* @throws `SyntaxError` 同时闭合和自封闭的标签
|
|
27
|
+
* @throws `SyntaxError` 无效自封闭标签
|
|
28
|
+
* @throws `SyntaxError` 未闭合的标签
|
|
29
|
+
*/
|
|
30
|
+
findMatchingTag(): HtmlToken;
|
|
31
|
+
#private;
|
|
32
|
+
}
|
|
33
|
+
import Token = require(".");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export = ImageParameterToken;
|
|
2
|
+
/**
|
|
3
|
+
* 图片参数
|
|
4
|
+
* @classdesc `{childNodes: ...(AstText|Token)}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ImageParameterToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} str 图片参数
|
|
9
|
+
* @param {import('../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(str: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
12
|
+
/** 图片链接 */
|
|
13
|
+
get link(): string | Title;
|
|
14
|
+
/**
|
|
15
|
+
* @override
|
|
16
|
+
*/
|
|
17
|
+
override toString(selector: any): string;
|
|
18
|
+
/** @override */
|
|
19
|
+
override text(): string;
|
|
20
|
+
#private;
|
|
21
|
+
}
|
|
22
|
+
import Token = require(".");
|
|
23
|
+
import Title = require("../lib/title");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export = ImagemapToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<imagemap>`
|
|
4
|
+
* @classdesc `{childNodes: ...NoincludeToken, GalleryImageToken, ...(NoincludeToken|ImagemapLinkToken|AstText)}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ImagemapToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} inner 标签内部wikitext
|
|
9
|
+
* @param {import('../../typings/token').accum} accum
|
|
10
|
+
* @throws `SyntaxError` 没有合法图片
|
|
11
|
+
*/
|
|
12
|
+
constructor(inner: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
13
|
+
/**
|
|
14
|
+
* 图片
|
|
15
|
+
* @returns {GalleryImageToken}
|
|
16
|
+
*/
|
|
17
|
+
get image(): GalleryImageToken;
|
|
18
|
+
/**
|
|
19
|
+
* @override
|
|
20
|
+
*/
|
|
21
|
+
override toString(selector: any): string;
|
|
22
|
+
/** @override */
|
|
23
|
+
override text(): string;
|
|
24
|
+
}
|
|
25
|
+
import Token = require(".");
|
|
26
|
+
import GalleryImageToken = require("./link/galleryImage");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export = ImagemapLinkToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<imagemap>`内的链接
|
|
4
|
+
* @classdesc `{childNodes: [AstText, LinkToken|ExtLinkToken, NoincludeToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ImagemapLinkToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} pre 链接前的文本
|
|
9
|
+
* @param {[string, string, string|Title]} linkStuff 内外链接
|
|
10
|
+
* @param {string} post 链接后的文本
|
|
11
|
+
* @param {import('../../typings/token').accum} accum
|
|
12
|
+
*/
|
|
13
|
+
constructor(pre: string, linkStuff: [string, string, string | Title], post: string, config: any, accum: import('../../typings/token').accum);
|
|
14
|
+
}
|
|
15
|
+
import Token = require(".");
|
|
16
|
+
import Title = require("../lib/title");
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export = Token;
|
|
2
|
+
/**
|
|
3
|
+
* 所有节点的基类
|
|
4
|
+
* @classdesc `{childNodes: ...(AstText|Token)}`
|
|
5
|
+
*/
|
|
6
|
+
declare class Token extends AstElement {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} wikitext wikitext
|
|
9
|
+
* @param {import('../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(wikitext: string, config?: import("../../typings/token").ParserConfig, halfParsed?: boolean, accum?: import('../../typings/token').accum, acceptable?: any);
|
|
12
|
+
/**
|
|
13
|
+
* @override
|
|
14
|
+
* @template {string} T
|
|
15
|
+
* @param {T} key 属性键
|
|
16
|
+
* @param {TokenAttribute<T>} value 属性值
|
|
17
|
+
*/
|
|
18
|
+
override setAttribute<T extends string>(key: T, value: import("../../typings/node").TokenAttribute<T>): Token;
|
|
19
|
+
/** 是否是普通节点 */
|
|
20
|
+
isPlain(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @override
|
|
23
|
+
* @template {string|Token} T
|
|
24
|
+
* @param {T} token 待插入的子节点
|
|
25
|
+
* @param {number} i 插入位置
|
|
26
|
+
* @complexity `n`
|
|
27
|
+
* @returns {T extends Token ? Token : AstText}
|
|
28
|
+
*/
|
|
29
|
+
override insertAt<T_1 extends string | Token>(token: T_1, i?: number): T_1 extends Token ? Token : AstText;
|
|
30
|
+
/**
|
|
31
|
+
* 规范化页面标题
|
|
32
|
+
* @param {string} title 标题(含或不含命名空间前缀)
|
|
33
|
+
* @param {number} defaultNs 命名空间
|
|
34
|
+
* @param {boolean} decode 是否需要解码
|
|
35
|
+
* @param {boolean} selfLink 是否允许selfLink
|
|
36
|
+
*/
|
|
37
|
+
normalizeTitle(title: string, defaultNs?: number, halfParsed?: boolean, decode?: boolean, selfLink?: boolean): import("../lib/title");
|
|
38
|
+
/** 生成部分Token的`name`属性 */
|
|
39
|
+
afterBuild(): void;
|
|
40
|
+
/**
|
|
41
|
+
* 解析、重构、生成部分Token的`name`属性
|
|
42
|
+
* @param {number} n 最大解析层级
|
|
43
|
+
* @param {boolean} include 是否嵌入
|
|
44
|
+
*/
|
|
45
|
+
parse(n?: number, include?: boolean): Token;
|
|
46
|
+
#private;
|
|
47
|
+
}
|
|
48
|
+
declare namespace Token {
|
|
49
|
+
export { TokenAttribute };
|
|
50
|
+
}
|
|
51
|
+
import AstElement = require("../lib/element");
|
|
52
|
+
import AstText = require("../lib/text");
|
|
53
|
+
type TokenAttribute<T> = import('../../typings/node').TokenAttribute<T>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export = FileToken;
|
|
2
|
+
/**
|
|
3
|
+
* 图片
|
|
4
|
+
* @classdesc `{childNodes: [AtomToken, ...ImageParameterToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class FileToken extends LinkToken {
|
|
7
|
+
/**
|
|
8
|
+
* 获取所有图片参数节点
|
|
9
|
+
* @returns {ImageParameterToken[]}
|
|
10
|
+
*/
|
|
11
|
+
getAllArgs(): ImageParameterToken[];
|
|
12
|
+
/**
|
|
13
|
+
* 获取指定图片参数
|
|
14
|
+
* @param {string} key 参数名
|
|
15
|
+
* @complexity `n`
|
|
16
|
+
*/
|
|
17
|
+
getArgs(key: string): ImageParameterToken[];
|
|
18
|
+
/** 获取图片框架属性参数节点 */
|
|
19
|
+
getFrameArgs(): ImageParameterToken[];
|
|
20
|
+
/** 获取图片水平对齐参数节点 */
|
|
21
|
+
getHorizAlignArgs(): ImageParameterToken[];
|
|
22
|
+
/** 获取图片垂直对齐参数节点 */
|
|
23
|
+
getVertAlignArgs(): ImageParameterToken[];
|
|
24
|
+
#private;
|
|
25
|
+
}
|
|
26
|
+
import LinkToken = require(".");
|
|
27
|
+
import ImageParameterToken = require("../imageParameter");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export = GalleryImageToken;
|
|
2
|
+
/**
|
|
3
|
+
* 图片
|
|
4
|
+
* @classdesc `{childNodes: [AtomToken, ...ImageParameterToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class GalleryImageToken extends FileToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} link 图片文件名
|
|
9
|
+
* @param {string|undefined} text 图片参数
|
|
10
|
+
* @param {import('../../../typings/token').accum} accum
|
|
11
|
+
*/
|
|
12
|
+
constructor(link: string, text: string | undefined, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
13
|
+
#private;
|
|
14
|
+
}
|
|
15
|
+
import FileToken = require("./file");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export = LinkToken;
|
|
2
|
+
/**
|
|
3
|
+
* 内链
|
|
4
|
+
* @classdesc `{childNodes: [AtomToken, ?Token]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class LinkToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} link 链接标题
|
|
9
|
+
* @param {string|undefined} linkText 链接显示文字
|
|
10
|
+
* @param {import('../../../typings/token').accum} accum
|
|
11
|
+
* @param {string} delimiter `|`
|
|
12
|
+
*/
|
|
13
|
+
constructor(link: string, linkText: string | undefined, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum, delimiter?: string);
|
|
14
|
+
/**
|
|
15
|
+
* @override
|
|
16
|
+
* @template {string} T
|
|
17
|
+
* @param {T} key 属性键
|
|
18
|
+
* @param {import('../../../typings/node').TokenAttribute<T>} value 属性值
|
|
19
|
+
*/
|
|
20
|
+
override setAttribute<T extends string>(key: T, value: import("../../../typings/node").TokenAttribute<T>): LinkToken;
|
|
21
|
+
/**
|
|
22
|
+
* @override
|
|
23
|
+
*/
|
|
24
|
+
override toString(selector: any): string;
|
|
25
|
+
/** @override */
|
|
26
|
+
override text(): string;
|
|
27
|
+
#private;
|
|
28
|
+
}
|
|
29
|
+
import Token = require("..");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export = MagicLinkToken;
|
|
2
|
+
/**
|
|
3
|
+
* 自由外链
|
|
4
|
+
* @classdesc `{childNodes: [...AstText|CommentToken|IncludeToken|NoincludeToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class MagicLinkToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} url 网址
|
|
9
|
+
* @param {boolean} doubleSlash 是否接受"//"作为协议
|
|
10
|
+
* @param {import('../../typings/token').accum} accum
|
|
11
|
+
*/
|
|
12
|
+
constructor(url: string, doubleSlash: boolean, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
13
|
+
}
|
|
14
|
+
import Token = require(".");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export = ChooseToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<choose>`
|
|
4
|
+
* @classdesc `{childNodes: [...ExtToken|NoincludeToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ChooseToken extends NestedToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string|undefined} wikitext wikitext
|
|
9
|
+
* @param {import('../../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(wikitext: string | undefined, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
12
|
+
}
|
|
13
|
+
import NestedToken = require(".");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export = ComboboxToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<combobox>`
|
|
4
|
+
* @classdesc `{childNodes: [...ExtToken|NoincludeToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ComboboxToken extends NestedToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string|undefined} wikitext wikitext
|
|
9
|
+
* @param {import('../../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(wikitext: string | undefined, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
12
|
+
}
|
|
13
|
+
import NestedToken = require(".");
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export = NestedToken;
|
|
2
|
+
/**
|
|
3
|
+
* 嵌套式的扩展标签
|
|
4
|
+
* @classdesc `{childNodes: [...ExtToken|NoincludeToken|CommentToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class NestedToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string|undefined} wikitext wikitext
|
|
9
|
+
* @param {RegExp} regex 内层正则
|
|
10
|
+
* @param {string[]} tags 内层标签名
|
|
11
|
+
* @param {import('../../../typings/token').accum} accum
|
|
12
|
+
*/
|
|
13
|
+
constructor(wikitext: string | undefined, regex: RegExp, tags: string[], config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
14
|
+
/**
|
|
15
|
+
* @override
|
|
16
|
+
* @param {number} start 起始位置
|
|
17
|
+
*/
|
|
18
|
+
override lint(start?: number): any;
|
|
19
|
+
}
|
|
20
|
+
import Token = require("..");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export = ReferencesToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<references>`
|
|
4
|
+
* @classdesc `{childNodes: [...ExtToken|NoincludeToken|CommentToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ReferencesToken extends NestedToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string|undefined} wikitext wikitext
|
|
9
|
+
* @param {import('../../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(wikitext: string | undefined, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
12
|
+
}
|
|
13
|
+
import NestedToken = require(".");
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export = CommentToken;
|
|
2
|
+
/**
|
|
3
|
+
* HTML注释,不可见
|
|
4
|
+
* @classdesc `{childNodes: [AstText]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class CommentToken extends NowikiToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} wikitext wikitext
|
|
9
|
+
* @param {boolean} closed 是否闭合
|
|
10
|
+
* @param {import('../../../typings/token').accum} accum
|
|
11
|
+
*/
|
|
12
|
+
constructor(wikitext: string, closed?: boolean, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
13
|
+
closed: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @override
|
|
16
|
+
*/
|
|
17
|
+
override toString(selector: any): string;
|
|
18
|
+
}
|
|
19
|
+
import NowikiToken = require(".");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export = DoubleUnderscoreToken;
|
|
2
|
+
/**
|
|
3
|
+
* 状态开关
|
|
4
|
+
* @classdesc `{childNodes: [AstText]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class DoubleUnderscoreToken extends NowikiToken {
|
|
7
|
+
/**
|
|
8
|
+
* @override
|
|
9
|
+
*/
|
|
10
|
+
override toString(selector: any): string;
|
|
11
|
+
}
|
|
12
|
+
import NowikiToken = require(".");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export = HrToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<hr>`
|
|
4
|
+
* @classdesc `{childNodes: [AstText]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class HrToken extends NowikiToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {number} n 字符串长度
|
|
9
|
+
* @param {import('../../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(n: number, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
12
|
+
}
|
|
13
|
+
import NowikiToken = require(".");
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export = NowikiToken;
|
|
2
|
+
/**
|
|
3
|
+
* 纯文字Token,不会被解析
|
|
4
|
+
* @classdesc `{childNodes: [AstText]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class NowikiToken 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 {number} start 起始位置
|
|
15
|
+
*/
|
|
16
|
+
override lint(start?: number): any;
|
|
17
|
+
}
|
|
18
|
+
import Token = require("..");
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export = QuoteToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<hr>`
|
|
4
|
+
* @classdesc `{childNodes: [AstText]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class QuoteToken extends NowikiToken {
|
|
7
|
+
/**
|
|
8
|
+
* @param {number} n 字符串长度
|
|
9
|
+
* @param {import('../../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(n: number, config?: import("../../../typings/token").ParserConfig, accum?: import('../../../typings/token').accum);
|
|
12
|
+
/**
|
|
13
|
+
* @override
|
|
14
|
+
* @this {AstText}
|
|
15
|
+
* @param {number} start 起始位置
|
|
16
|
+
*/
|
|
17
|
+
override lint(this: AstText, start?: number): import("../../../typings/token").LintError[];
|
|
18
|
+
}
|
|
19
|
+
import NowikiToken = require(".");
|
|
20
|
+
import AstText = require("../../lib/text");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export = OnlyincludeToken;
|
|
2
|
+
/**
|
|
3
|
+
* 嵌入时的`<onlyinclude>`
|
|
4
|
+
* @classdesc `{childNodes: ...AstText|Token}`
|
|
5
|
+
*/
|
|
6
|
+
declare class OnlyincludeToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} inner 标签内部wikitext
|
|
9
|
+
* @param {import('../../typings/token').accum} accum
|
|
10
|
+
*/
|
|
11
|
+
constructor(inner: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
12
|
+
/**
|
|
13
|
+
* @override
|
|
14
|
+
*/
|
|
15
|
+
override toString(selector: any): string;
|
|
16
|
+
}
|
|
17
|
+
import Token = require(".");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export = ParamTagToken;
|
|
2
|
+
/**
|
|
3
|
+
* `<inputbox>`
|
|
4
|
+
* @classdesc `{childNodes: ...AtomToken}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ParamTagToken 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
|
+
*/
|
|
15
|
+
override toString(selector: any): string;
|
|
16
|
+
/** @override */
|
|
17
|
+
override text(): string;
|
|
18
|
+
/**
|
|
19
|
+
* @override
|
|
20
|
+
* @param {number} start 起始位置
|
|
21
|
+
*/
|
|
22
|
+
override lint(start?: number): any;
|
|
23
|
+
}
|
|
24
|
+
import Token = require("..");
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export = ParameterToken;
|
|
2
|
+
/**
|
|
3
|
+
* 模板或魔术字参数
|
|
4
|
+
* @classdesc `{childNodes: [Token, Token]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class ParameterToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string|number} key 参数名
|
|
9
|
+
* @param {string} value 参数值
|
|
10
|
+
* @param {import('../../typings/token').accum} accum
|
|
11
|
+
*/
|
|
12
|
+
constructor(key: string | number, value: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum);
|
|
13
|
+
/** 是否是匿名参数 */
|
|
14
|
+
get anon(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @override
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
override toString(selector: any): string;
|
|
20
|
+
/**
|
|
21
|
+
* @override
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
override text(): string;
|
|
25
|
+
/** @override */
|
|
26
|
+
override getGaps(): 1 | 0;
|
|
27
|
+
}
|
|
28
|
+
import Token = require(".");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export = SyntaxToken;
|
|
2
|
+
/**
|
|
3
|
+
* 满足特定语法格式的plain Token
|
|
4
|
+
* @classdesc `{childNodes: ...AstText|Token}`
|
|
5
|
+
*/
|
|
6
|
+
declare class SyntaxToken extends Token {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} wikitext 语法wikitext
|
|
9
|
+
* @param {RegExp} pattern 语法正则
|
|
10
|
+
* @param {string} type Token.type
|
|
11
|
+
* @param {import('../../typings/token').accum} accum
|
|
12
|
+
*/
|
|
13
|
+
constructor(wikitext: string, pattern: RegExp, type?: string, config?: import("../../typings/token").ParserConfig, accum?: import('../../typings/token').accum, acceptable?: any);
|
|
14
|
+
}
|
|
15
|
+
import Token = require(".");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export = TableToken;
|
|
2
|
+
/**
|
|
3
|
+
* 表格
|
|
4
|
+
* @classdesc `{childNodes: [SyntaxToken, AttributesToken, ?Token, ...TdToken, ...TrToken, ?SyntaxToken]}`
|
|
5
|
+
*/
|
|
6
|
+
declare class TableToken extends TrToken {
|
|
7
|
+
/** 表格是否闭合 */
|
|
8
|
+
get closed(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 闭合表格语法
|
|
11
|
+
* @complexity `n`
|
|
12
|
+
* @param {string} syntax 表格结尾语法
|
|
13
|
+
*/
|
|
14
|
+
close(syntax?: string, halfParsed?: boolean): void;
|
|
15
|
+
}
|
|
16
|
+
import TrToken = require("./tr");
|