wikiparser-node 1.10.0 → 1.11.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.
Files changed (173) hide show
  1. package/bundle/bundle.min.js +38 -0
  2. package/config/enwiki.json +1 -814
  3. package/config/llwiki.json +1 -35
  4. package/config/moegirl.json +1 -44
  5. package/config/zhwiki.json +1 -466
  6. package/extensions/dist/base.js +64 -0
  7. package/extensions/dist/editor.js +159 -0
  8. package/extensions/dist/highlight.js +56 -0
  9. package/extensions/dist/lint.js +72 -0
  10. package/extensions/editor.css +64 -0
  11. package/extensions/ui.css +144 -0
  12. package/i18n/zh-hans.json +1 -1
  13. package/i18n/zh-hant.json +1 -1
  14. package/package.json +43 -33
  15. package/config/.schema.json +0 -186
  16. package/dist/addon/table.js +0 -486
  17. package/dist/addon/token.js +0 -324
  18. package/dist/addon/transclude.js +0 -185
  19. package/dist/base.d.ts +0 -81
  20. package/dist/base.js +0 -39
  21. package/dist/index.d.ts +0 -33
  22. package/dist/index.js +0 -231
  23. package/dist/internal.d.ts +0 -46
  24. package/dist/lib/element.d.ts +0 -125
  25. package/dist/lib/element.js +0 -374
  26. package/dist/lib/node.d.ts +0 -173
  27. package/dist/lib/node.js +0 -478
  28. package/dist/lib/range.d.ts +0 -105
  29. package/dist/lib/range.js +0 -406
  30. package/dist/lib/ranges.d.ts +0 -28
  31. package/dist/lib/ranges.js +0 -126
  32. package/dist/lib/rect.d.ts +0 -18
  33. package/dist/lib/rect.js +0 -34
  34. package/dist/lib/text.d.ts +0 -58
  35. package/dist/lib/text.js +0 -361
  36. package/dist/lib/title.d.ts +0 -42
  37. package/dist/lib/title.js +0 -205
  38. package/dist/mixin/attributesParent.d.ts +0 -49
  39. package/dist/mixin/attributesParent.js +0 -79
  40. package/dist/mixin/fixed.d.ts +0 -5
  41. package/dist/mixin/fixed.js +0 -32
  42. package/dist/mixin/flagsParent.d.ts +0 -41
  43. package/dist/mixin/flagsParent.js +0 -60
  44. package/dist/mixin/hidden.d.ts +0 -7
  45. package/dist/mixin/hidden.js +0 -37
  46. package/dist/mixin/magicLinkParent.d.ts +0 -19
  47. package/dist/mixin/magicLinkParent.js +0 -43
  48. package/dist/mixin/singleLine.d.ts +0 -5
  49. package/dist/mixin/singleLine.js +0 -25
  50. package/dist/mixin/sol.d.ts +0 -6
  51. package/dist/mixin/sol.js +0 -44
  52. package/dist/mixin/syntax.d.ts +0 -8
  53. package/dist/mixin/syntax.js +0 -46
  54. package/dist/parser/braces.js +0 -150
  55. package/dist/parser/commentAndExt.js +0 -79
  56. package/dist/parser/converter.js +0 -39
  57. package/dist/parser/externalLinks.js +0 -37
  58. package/dist/parser/hrAndDoubleUnderscore.js +0 -42
  59. package/dist/parser/html.js +0 -38
  60. package/dist/parser/links.js +0 -101
  61. package/dist/parser/list.js +0 -99
  62. package/dist/parser/magicLinks.js +0 -53
  63. package/dist/parser/quotes.js +0 -67
  64. package/dist/parser/redirect.js +0 -26
  65. package/dist/parser/selector.js +0 -394
  66. package/dist/parser/table.js +0 -123
  67. package/dist/src/arg.d.ts +0 -51
  68. package/dist/src/arg.js +0 -214
  69. package/dist/src/atom.d.ts +0 -14
  70. package/dist/src/atom.js +0 -52
  71. package/dist/src/attribute.d.ts +0 -64
  72. package/dist/src/attribute.js +0 -483
  73. package/dist/src/attributes.d.ts +0 -101
  74. package/dist/src/attributes.js +0 -382
  75. package/dist/src/converter.d.ts +0 -28
  76. package/dist/src/converter.js +0 -147
  77. package/dist/src/converterFlags.d.ts +0 -80
  78. package/dist/src/converterFlags.js +0 -242
  79. package/dist/src/converterRule.d.ts +0 -71
  80. package/dist/src/converterRule.js +0 -216
  81. package/dist/src/extLink.d.ts +0 -36
  82. package/dist/src/extLink.js +0 -198
  83. package/dist/src/gallery.d.ts +0 -47
  84. package/dist/src/gallery.js +0 -142
  85. package/dist/src/heading.d.ts +0 -40
  86. package/dist/src/heading.js +0 -191
  87. package/dist/src/hidden.d.ts +0 -9
  88. package/dist/src/hidden.js +0 -80
  89. package/dist/src/html.d.ts +0 -57
  90. package/dist/src/html.js +0 -343
  91. package/dist/src/imageParameter.d.ts +0 -58
  92. package/dist/src/imageParameter.js +0 -247
  93. package/dist/src/imagemap.d.ts +0 -47
  94. package/dist/src/imagemap.js +0 -146
  95. package/dist/src/imagemapLink.d.ts +0 -31
  96. package/dist/src/imagemapLink.js +0 -97
  97. package/dist/src/index.d.ts +0 -141
  98. package/dist/src/index.js +0 -795
  99. package/dist/src/link/base.d.ts +0 -54
  100. package/dist/src/link/base.js +0 -263
  101. package/dist/src/link/category.d.ts +0 -22
  102. package/dist/src/link/category.js +0 -34
  103. package/dist/src/link/file.d.ts +0 -96
  104. package/dist/src/link/file.js +0 -276
  105. package/dist/src/link/galleryImage.d.ts +0 -29
  106. package/dist/src/link/galleryImage.js +0 -132
  107. package/dist/src/link/index.d.ts +0 -39
  108. package/dist/src/link/index.js +0 -99
  109. package/dist/src/link/redirectTarget.d.ts +0 -27
  110. package/dist/src/link/redirectTarget.js +0 -72
  111. package/dist/src/magicLink.d.ts +0 -61
  112. package/dist/src/magicLink.js +0 -261
  113. package/dist/src/nested.d.ts +0 -40
  114. package/dist/src/nested.js +0 -106
  115. package/dist/src/nowiki/base.d.ts +0 -30
  116. package/dist/src/nowiki/base.js +0 -89
  117. package/dist/src/nowiki/comment.d.ts +0 -14
  118. package/dist/src/nowiki/comment.js +0 -124
  119. package/dist/src/nowiki/dd.d.ts +0 -8
  120. package/dist/src/nowiki/dd.js +0 -72
  121. package/dist/src/nowiki/doubleUnderscore.d.ts +0 -15
  122. package/dist/src/nowiki/doubleUnderscore.js +0 -97
  123. package/dist/src/nowiki/hr.d.ts +0 -5
  124. package/dist/src/nowiki/hr.js +0 -70
  125. package/dist/src/nowiki/index.d.ts +0 -14
  126. package/dist/src/nowiki/index.js +0 -31
  127. package/dist/src/nowiki/list.d.ts +0 -5
  128. package/dist/src/nowiki/list.js +0 -65
  129. package/dist/src/nowiki/listBase.d.ts +0 -17
  130. package/dist/src/nowiki/listBase.js +0 -75
  131. package/dist/src/nowiki/noinclude.d.ts +0 -6
  132. package/dist/src/nowiki/noinclude.js +0 -75
  133. package/dist/src/nowiki/quote.d.ts +0 -14
  134. package/dist/src/nowiki/quote.js +0 -135
  135. package/dist/src/onlyinclude.d.ts +0 -13
  136. package/dist/src/onlyinclude.js +0 -58
  137. package/dist/src/paramTag/index.d.ts +0 -30
  138. package/dist/src/paramTag/index.js +0 -78
  139. package/dist/src/paramTag/inputbox.d.ts +0 -8
  140. package/dist/src/paramTag/inputbox.js +0 -22
  141. package/dist/src/parameter.d.ts +0 -60
  142. package/dist/src/parameter.js +0 -268
  143. package/dist/src/pre.d.ts +0 -28
  144. package/dist/src/pre.js +0 -60
  145. package/dist/src/redirect.d.ts +0 -30
  146. package/dist/src/redirect.js +0 -126
  147. package/dist/src/syntax.d.ts +0 -17
  148. package/dist/src/syntax.js +0 -87
  149. package/dist/src/table/base.d.ts +0 -28
  150. package/dist/src/table/base.js +0 -81
  151. package/dist/src/table/index.d.ts +0 -230
  152. package/dist/src/table/index.js +0 -505
  153. package/dist/src/table/td.d.ts +0 -72
  154. package/dist/src/table/td.js +0 -370
  155. package/dist/src/table/tr.d.ts +0 -30
  156. package/dist/src/table/tr.js +0 -59
  157. package/dist/src/table/trBase.d.ts +0 -49
  158. package/dist/src/table/trBase.js +0 -164
  159. package/dist/src/tagPair/ext.d.ts +0 -29
  160. package/dist/src/tagPair/ext.js +0 -220
  161. package/dist/src/tagPair/include.d.ts +0 -33
  162. package/dist/src/tagPair/include.js +0 -130
  163. package/dist/src/tagPair/index.d.ts +0 -23
  164. package/dist/src/tagPair/index.js +0 -128
  165. package/dist/src/transclude.d.ts +0 -159
  166. package/dist/src/transclude.js +0 -587
  167. package/dist/util/constants.js +0 -25
  168. package/dist/util/debug.js +0 -95
  169. package/dist/util/diff.js +0 -83
  170. package/dist/util/lint.js +0 -32
  171. package/dist/util/string.js +0 -84
  172. package/errors/README +0 -3
  173. package/printed/README +0 -3
@@ -1,141 +0,0 @@
1
- import { Ranges } from '../lib/ranges';
2
- import Parser from '../index';
3
- import { AstElement } from '../lib/element';
4
- import { AstText } from '../lib/text';
5
- import type { LintError, TokenTypes } from '../base';
6
- import type { AstRange } from '../lib/range';
7
- import type { Range } from '../lib/ranges';
8
- import type { Title } from '../lib/title';
9
- import type { AstNodes, IncludeToken, HtmlToken, ExtToken, TranscludeToken, CommentToken, FileToken, LinkToken, RedirectTargetToken, ExtLinkToken, MagicLinkToken, ImageParameterToken } from '../internal';
10
- import type { CaretPosition } from '../lib/node';
11
- export type TagToken = IncludeToken | ExtToken | HtmlToken;
12
- /**
13
- * 所有节点的基类
14
- * @classdesc `{childNodes: ...(AstText|Token)}`
15
- */
16
- export declare class Token extends AstElement {
17
- #private;
18
- get type(): TokenTypes;
19
- set type(value: TokenTypes);
20
- /** 所有图片,包括图库 */
21
- get images(): FileToken[];
22
- /** 所有内链、外链和自由外链 */
23
- get links(): (LinkToken | RedirectTargetToken | ExtLinkToken | MagicLinkToken | ImageParameterToken)[];
24
- /** 所有模板和模块 */
25
- get embeds(): TranscludeToken[];
26
- /** @class */
27
- constructor(wikitext?: string, config?: Parser.Config, accum?: Token[], acceptable?: Acceptable);
28
- /**
29
- * @override
30
- * @param child 待插入的子节点
31
- * @param i 插入位置
32
- */
33
- insertAt(child: string, i?: number): AstText;
34
- insertAt<T extends AstNodes>(child: T, i?: number): T;
35
- /**
36
- * @override
37
- * @param i 移除位置
38
- */
39
- removeAt(i: number): AstNodes;
40
- /**
41
- * 替换为同类节点
42
- * @param token 待替换的节点
43
- * @throws `Error` 不存在父节点
44
- */
45
- safeReplaceWith(token: this): void;
46
- /**
47
- * 创建HTML注释
48
- * @param data 注释内容
49
- */
50
- createComment(data?: string): CommentToken;
51
- /**
52
- * 创建标签
53
- * @param tagName 标签名
54
- * @param options 选项
55
- * @param options.selfClosing 是否自封闭
56
- * @param options.closing 是否是闭合标签
57
- * @throws `RangeError` 非法的标签名
58
- */
59
- createElement(tagName: string, options?: {
60
- selfClosing?: boolean;
61
- closing?: boolean;
62
- }): TagToken;
63
- /**
64
- * 创建纯文本节点
65
- * @param data 文本内容
66
- */
67
- createTextNode(data?: string): AstText;
68
- /** 创建AstRange对象 */
69
- createRange(): AstRange;
70
- /**
71
- * 找到给定位置
72
- * @param index 位置
73
- */
74
- caretPositionFromIndex(index?: number): CaretPosition | undefined;
75
- /**
76
- * 找到给定位置
77
- * @param x 列数
78
- * @param y 行数
79
- */
80
- caretPositionFromPoint(x: number, y: number): CaretPosition | undefined;
81
- /**
82
- * 找到给定位置所在的最外层节点
83
- * @param index 位置
84
- */
85
- elementFromIndex(index?: number): AstNodes | undefined;
86
- /**
87
- * 找到给定位置所在的最外层节点
88
- * @param x 列数
89
- * @param y 行数
90
- */
91
- elementFromPoint(x: number, y: number): AstNodes | undefined;
92
- /**
93
- * 找到给定位置所在的所有节点
94
- * @param index 位置
95
- */
96
- elementsFromIndex(index?: number): AstNodes[];
97
- /**
98
- * 找到给定位置所在的所有节点
99
- * @param x 列数
100
- * @param y 行数
101
- */
102
- elementsFromPoint(x: number, y: number): AstNodes[];
103
- /**
104
- * 判断标题是否是跨维基链接
105
- * @param title 标题
106
- */
107
- isInterwiki(title: string): RegExpExecArray | null;
108
- /** 深拷贝节点 */
109
- cloneNode(): this;
110
- /** 获取全部章节 */
111
- sections(): AstRange[] | undefined;
112
- /**
113
- * 获取指定章节
114
- * @param n 章节序号
115
- */
116
- section(n: number): AstRange | undefined;
117
- /**
118
- * 获取指定的外层HTML标签
119
- * @param tag HTML标签名
120
- * @throws `RangeError` 非法的标签或空标签
121
- */
122
- findEnclosingHtml(tag?: string): AstRange | undefined;
123
- /** 获取全部分类 */
124
- getCategories(): [string, string | undefined][];
125
- /** 重新解析单引号 */
126
- redoQuotes(): void;
127
- /**
128
- * 展开模板
129
- * @param context 模板调用环境
130
- */
131
- expand(context?: false): Token;
132
- /** 解析部分魔术字 */
133
- solveConst(): Token;
134
- /** 合并普通节点的普通子节点 */
135
- flatten(): void;
136
- /**
137
- * 生成HTML
138
- * @param nowrap 是否不换行
139
- */
140
- toHtml(nowrap?: boolean): string;
141
- }