wikiparser-node 1.15.1 → 1.16.1

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.
@@ -1,47 +1,47 @@
1
- export type { AstNodes, } from './lib/node';
2
- export type * from './lib/text';
1
+ export type { AstNodes } from './lib/node';
2
+ export type { AstText } from './lib/text';
3
3
  export type { Token } from './src/index';
4
- export type * from './src/redirect';
5
- export type * from './src/link/redirectTarget';
6
- export type * from './src/onlyinclude';
7
- export type * from './src/nowiki/noinclude';
8
- export type * from './src/tagPair/include';
9
- export type * from './src/nowiki/comment';
10
- export type * from './src/atom';
4
+ export type { RedirectToken } from './src/redirect';
5
+ export type { RedirectTargetToken } from './src/link/redirectTarget';
6
+ export type { OnlyincludeToken } from './src/onlyinclude';
7
+ export type { NoincludeToken } from './src/nowiki/noinclude';
8
+ export type { IncludeToken } from './src/tagPair/include';
9
+ export type { CommentToken } from './src/nowiki/comment';
10
+ export type { AtomToken } from './src/atom';
11
11
  export type { AttributeToken } from './src/attribute';
12
- export type * from './src/attributes';
13
- export type * from './src/tagPair/ext';
14
- export type * from './src/hidden';
15
- export type * from './src/arg';
16
- export type * from './src/syntax';
17
- export type * from './src/parameter';
18
- export type * from './src/transclude';
19
- export type * from './src/heading';
20
- export type * from './src/html';
12
+ export type { AttributesToken } from './src/attributes';
13
+ export type { ExtToken } from './src/tagPair/ext';
14
+ export type { HiddenToken } from './src/hidden';
15
+ export type { ArgToken } from './src/arg';
16
+ export type { SyntaxToken } from './src/syntax';
17
+ export type { ParameterToken } from './src/parameter';
18
+ export type { TranscludeToken } from './src/transclude';
19
+ export type { HeadingToken } from './src/heading';
20
+ export type { HtmlToken } from './src/html';
21
21
  export type { TdToken } from './src/table/td';
22
- export type * from './src/table/tr';
22
+ export type { TrToken } from './src/table/tr';
23
23
  export type { TableToken } from './src/table/index';
24
- export type * from './src/nowiki/hr';
25
- export type * from './src/nowiki/doubleUnderscore';
26
- export type * from './src/link/index';
27
- export type * from './src/link/category';
24
+ export type { HrToken } from './src/nowiki/hr';
25
+ export type { DoubleUnderscoreToken } from './src/nowiki/doubleUnderscore';
26
+ export type { LinkToken } from './src/link/index';
27
+ export type { CategoryToken } from './src/link/category';
28
28
  export type { ImageParameterToken } from './src/imageParameter';
29
- export type * from './src/link/file';
30
- export type * from './src/link/galleryImage';
31
- export type * from './src/nowiki/quote';
32
- export type * from './src/magicLink';
33
- export type * from './src/extLink';
29
+ export type { FileToken } from './src/link/file';
30
+ export type { GalleryImageToken } from './src/link/galleryImage';
31
+ export type { QuoteToken } from './src/nowiki/quote';
32
+ export type { MagicLinkToken } from './src/magicLink';
33
+ export type { ExtLinkToken } from './src/extLink';
34
34
  export type { ListRangeToken } from './src/nowiki/listBase';
35
- export type * from './src/nowiki/dd';
36
- export type * from './src/nowiki/list';
37
- export type * from './src/converterFlags';
38
- export type * from './src/converterRule';
39
- export type * from './src/converter';
40
- export type * from './src/nowiki/index';
41
- export type * from './src/pre';
42
- export type * from './src/paramTag/index';
43
- export type * from './src/paramTag/inputbox';
44
- export type * from './src/nested';
45
- export type * from './src/gallery';
46
- export type * from './src/imagemapLink';
47
- export type * from './src/imagemap';
35
+ export type { DdToken } from './src/nowiki/dd';
36
+ export type { ListToken } from './src/nowiki/list';
37
+ export type { ConverterFlagsToken } from './src/converterFlags';
38
+ export type { ConverterRuleToken } from './src/converterRule';
39
+ export type { ConverterToken } from './src/converter';
40
+ export type { NowikiToken } from './src/nowiki/index';
41
+ export type { PreToken } from './src/pre';
42
+ export type { ParamTagToken } from './src/paramTag/index';
43
+ export type { InputboxToken } from './src/paramTag/inputbox';
44
+ export type { NestedToken } from './src/nested';
45
+ export type { GalleryToken } from './src/gallery';
46
+ export type { ImagemapLinkToken } from './src/imagemapLink';
47
+ export type { ImagemapToken } from './src/imagemap';
@@ -274,7 +274,7 @@ class AstElement extends node_1.AstNode {
274
274
  */
275
275
  json(file, start = this.getAbsoluteIndex()) {
276
276
  const json = {
277
- ...this,
277
+ ...this, // eslint-disable-line @typescript-eslint/no-misused-spread
278
278
  type: this.type,
279
279
  range: [start, start + this.toString().length],
280
280
  childNodes: [],
@@ -0,0 +1,87 @@
1
+ import Parser from '../index';
2
+ import type { Range, Position, ColorInformation, ColorPresentation, FoldingRange, DocumentSymbol, DocumentLink, Location, WorkspaceEdit, Diagnostic, Hover, CodeAction, SignatureHelp } from 'vscode-languageserver-types';
3
+ import type { LanguageService as LanguageServiceBase, CompletionItem, SignatureData } from '../base';
4
+ export declare const tasks: WeakMap<object, Parser.LanguageService>;
5
+ /** VSCode-style language service */
6
+ export declare class LanguageService implements LanguageServiceBase {
7
+ #private;
8
+ /** @param uri 任务标识 */
9
+ constructor(uri: object);
10
+ /** @implements */
11
+ destroy(): void;
12
+ /**
13
+ * 提供颜色指示
14
+ * @param rgba 颜色解析函数
15
+ * @param text 源代码
16
+ * @param hsl 是否允许HSL颜色
17
+ */
18
+ provideDocumentColors(rgba: (s: string) => [number, number, number, number] | [], text: string, hsl?: boolean): Promise<ColorInformation[]>;
19
+ /** @implements */
20
+ provideColorPresentations(// eslint-disable-line @typescript-eslint/class-methods-use-this
21
+ { color: { red, green, blue, alpha }, range }: ColorInformation): ColorPresentation[];
22
+ /**
23
+ * 提供自动补全
24
+ * @param text 源代码
25
+ * @param position 位置
26
+ */
27
+ provideCompletionItems(text: string, position: Position): Promise<CompletionItem[] | undefined>;
28
+ /**
29
+ * 提供语法诊断
30
+ * @param wikitext 源代码
31
+ */
32
+ provideDiagnostics(wikitext: string): Promise<Diagnostic[]>;
33
+ /**
34
+ * 提供折叠范围
35
+ * @param text 源代码
36
+ */
37
+ provideFoldingRanges(text: string): Promise<FoldingRange[]>;
38
+ /**
39
+ * 提供链接
40
+ * @param text 源代码
41
+ */
42
+ provideLinks(text: string): Promise<DocumentLink[]>;
43
+ /**
44
+ * 提供引用
45
+ * @param text 源代码
46
+ * @param position 位置
47
+ */
48
+ provideReferences(text: string, position: Position): Promise<Omit<Location, 'uri'>[] | undefined>;
49
+ /**
50
+ * 提供定义
51
+ * @param text 源代码
52
+ * @param position 位置
53
+ */
54
+ provideDefinition(text: string, position: Position): Promise<Omit<Location, 'uri'>[] | undefined>;
55
+ /**
56
+ * 提供变量更名准备
57
+ * @param text 源代码
58
+ * @param position 位置
59
+ */
60
+ resolveRenameLocation(text: string, position: Position): Promise<Range | undefined>;
61
+ /**
62
+ * 变量更名
63
+ * @param text 源代码
64
+ * @param position 位置
65
+ * @param newName 新名称
66
+ */
67
+ provideRenameEdits(text: string, position: Position, newName: string): Promise<WorkspaceEdit | undefined>;
68
+ /**
69
+ * 提供悬停信息
70
+ * @param text 源代码
71
+ * @param position 位置
72
+ */
73
+ provideHover(text: string, position: Position): Promise<Hover | undefined>;
74
+ /**
75
+ * 提供魔术字帮助
76
+ * @param text 源代码
77
+ * @param position 位置
78
+ */
79
+ provideSignatureHelp(text: string, position: Position): Promise<SignatureHelp | undefined>;
80
+ /** @implements */
81
+ provideCodeAction(diagnostics: Diagnostic[]): CodeAction[];
82
+ /**
83
+ * 提供章节
84
+ * @param text 源代码
85
+ */
86
+ provideDocumentSymbols(text: string): Promise<DocumentSymbol[]>;
87
+ }