@cspell/cspell-types 9.4.0 → 9.6.0
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 +6 -6
- package/cspell.schema.json +36 -17
- package/dist/Parser/index.d.mts +129 -2
- package/dist/Parser/index.d.ts +129 -2
- package/dist/index.d.mts +48 -20
- package/dist/index.d.ts +48 -20
- package/package.json +2 -2
- package/dist/index-BtvDF-9G.d.ts +0 -129
- package/dist/index-TAd2zi6U.d.mts +0 -129
package/README.md
CHANGED
|
@@ -8,13 +8,13 @@ This package contains no dependencies to avoid any security issues.
|
|
|
8
8
|
|
|
9
9
|
<!--- @@inject: ../../static/sponsor.md --->
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- [](https://www.paypal.com/donate/?hosted_button_id=26LNBP2Q6MKCY)
|
|
13
|
-
- [](https://opencollective.com/cspell)
|
|
11
|
+
[](https://github.com/sponsors/streetsidesoftware)
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
[](https://opencollective.com/cspell)
|
|
14
|
+
|
|
15
|
+
[](https://streetsidesoftware.com/sponsor/)
|
|
16
|
+
|
|
17
|
+
[](https://www.paypal.com/donate/?hosted_button_id=26LNBP2Q6MKCY)
|
|
18
18
|
|
|
19
19
|
<!--- @@inject-end: ../../static/sponsor.md --->
|
|
20
20
|
|
package/cspell.schema.json
CHANGED
|
@@ -200,9 +200,9 @@
|
|
|
200
200
|
"type": "object"
|
|
201
201
|
},
|
|
202
202
|
"CustomDictionaryPath": {
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"
|
|
203
|
+
"description": "A path or url to a custom dictionary file.",
|
|
204
|
+
"markdownDescription": "A path or url to a custom dictionary file.",
|
|
205
|
+
"type": "string"
|
|
206
206
|
},
|
|
207
207
|
"CustomDictionaryScope": {
|
|
208
208
|
"description": "Specifies the scope of a dictionary.",
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
"DictionaryDefinitionAlternate": {
|
|
240
240
|
"additionalProperties": false,
|
|
241
241
|
"deprecated": true,
|
|
242
|
-
"deprecationMessage": "Use {@link DictionaryDefinitionPreferred } instead.",
|
|
242
|
+
"deprecationMessage": "Use {@link DictionaryDefinitionPreferred } instead.\nThis will be removed in a future release.",
|
|
243
243
|
"description": "Only for legacy dictionary definitions.",
|
|
244
244
|
"markdownDescription": "Only for legacy dictionary definitions.",
|
|
245
245
|
"properties": {
|
|
@@ -304,6 +304,12 @@
|
|
|
304
304
|
"description": "Used to provide extra data related to the dictionary",
|
|
305
305
|
"markdownDescription": "Used to provide extra data related to the dictionary",
|
|
306
306
|
"properties": {
|
|
307
|
+
"btrie": {
|
|
308
|
+
"$ref": "#/definitions/DictionaryPathToBTrie",
|
|
309
|
+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
|
|
310
|
+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
|
|
311
|
+
"since": "9.6.0"
|
|
312
|
+
},
|
|
307
313
|
"description": {
|
|
308
314
|
"description": "Optional description of the contents / purpose of the dictionary.",
|
|
309
315
|
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
|
|
@@ -329,8 +335,8 @@
|
|
|
329
335
|
},
|
|
330
336
|
"path": {
|
|
331
337
|
"$ref": "#/definitions/DictionaryPath",
|
|
332
|
-
"description": "Path to the file.",
|
|
333
|
-
"markdownDescription": "Path to the file."
|
|
338
|
+
"description": "Path or url to the dictionary file.",
|
|
339
|
+
"markdownDescription": "Path or url to the dictionary file."
|
|
334
340
|
},
|
|
335
341
|
"repMap": {
|
|
336
342
|
"$ref": "#/definitions/ReplaceMap",
|
|
@@ -371,6 +377,12 @@
|
|
|
371
377
|
"markdownDescription": "When `true`, let's the spell checker know that words can be added to this dictionary.",
|
|
372
378
|
"type": "boolean"
|
|
373
379
|
},
|
|
380
|
+
"btrie": {
|
|
381
|
+
"$ref": "#/definitions/DictionaryPathToBTrie",
|
|
382
|
+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
|
|
383
|
+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
|
|
384
|
+
"since": "9.6.0"
|
|
385
|
+
},
|
|
374
386
|
"description": {
|
|
375
387
|
"description": "Optional description of the contents / purpose of the dictionary.",
|
|
376
388
|
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
|
|
@@ -393,8 +405,8 @@
|
|
|
393
405
|
},
|
|
394
406
|
"path": {
|
|
395
407
|
"$ref": "#/definitions/CustomDictionaryPath",
|
|
396
|
-
"description": "
|
|
397
|
-
"markdownDescription": "
|
|
408
|
+
"description": "A file path or url to a custom dictionary file.",
|
|
409
|
+
"markdownDescription": "A file path or url to a custom dictionary file."
|
|
398
410
|
},
|
|
399
411
|
"repMap": {
|
|
400
412
|
"$ref": "#/definitions/ReplaceMap",
|
|
@@ -695,6 +707,12 @@
|
|
|
695
707
|
"DictionaryDefinitionPreferred": {
|
|
696
708
|
"additionalProperties": false,
|
|
697
709
|
"properties": {
|
|
710
|
+
"btrie": {
|
|
711
|
+
"$ref": "#/definitions/DictionaryPathToBTrie",
|
|
712
|
+
"description": "An alternative path to a bTrie dictionary file. It will be used in place of `path` if the version of CSpell being used supports btrie files.",
|
|
713
|
+
"markdownDescription": "An alternative path to a bTrie dictionary file.\nIt will be used in place of `path` if the version of CSpell being used\nsupports btrie files.",
|
|
714
|
+
"since": "9.6.0"
|
|
715
|
+
},
|
|
698
716
|
"description": {
|
|
699
717
|
"description": "Optional description of the contents / purpose of the dictionary.",
|
|
700
718
|
"markdownDescription": "Optional description of the contents / purpose of the dictionary.",
|
|
@@ -717,8 +735,8 @@
|
|
|
717
735
|
},
|
|
718
736
|
"path": {
|
|
719
737
|
"$ref": "#/definitions/DictionaryPath",
|
|
720
|
-
"description": "Path to the file.",
|
|
721
|
-
"markdownDescription": "Path to the file."
|
|
738
|
+
"description": "Path or url to the dictionary file.",
|
|
739
|
+
"markdownDescription": "Path or url to the dictionary file."
|
|
722
740
|
},
|
|
723
741
|
"repMap": {
|
|
724
742
|
"$ref": "#/definitions/ReplaceMap",
|
|
@@ -870,8 +888,14 @@
|
|
|
870
888
|
"type": "string"
|
|
871
889
|
},
|
|
872
890
|
"DictionaryPath": {
|
|
873
|
-
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:txt|trie|dic)(?:\\.gz)?$`",
|
|
874
|
-
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:txt|trie|dic)(?:\\.gz)?$`",
|
|
891
|
+
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:txt|trie|btrie|dic)(?:\\.gz)?$`",
|
|
892
|
+
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:txt|trie|btrie|dic)(?:\\.gz)?$`",
|
|
893
|
+
"type": "string"
|
|
894
|
+
},
|
|
895
|
+
"DictionaryPathToBTrie": {
|
|
896
|
+
"description": "A File System Path to a dictionary file. Pattern: `^.*\\.(?:btrie)(?:\\.gz)?$`",
|
|
897
|
+
"markdownDescription": "A File System Path to a dictionary file.\nPattern: `^.*\\.(?:btrie)(?:\\.gz)?$`",
|
|
898
|
+
"since": "9.6.0",
|
|
875
899
|
"type": "string"
|
|
876
900
|
},
|
|
877
901
|
"DictionaryRef": {
|
|
@@ -948,11 +972,6 @@
|
|
|
948
972
|
},
|
|
949
973
|
"type": "object"
|
|
950
974
|
},
|
|
951
|
-
"FsDictionaryPath": {
|
|
952
|
-
"description": "A File System Path. Relative paths are relative to the configuration file.",
|
|
953
|
-
"markdownDescription": "A File System Path. Relative paths are relative to the configuration file.",
|
|
954
|
-
"type": "string"
|
|
955
|
-
},
|
|
956
975
|
"FsPath": {
|
|
957
976
|
"description": "A File System Path. Relative paths are relative to the configuration file.",
|
|
958
977
|
"markdownDescription": "A File System Path. Relative paths are relative to the configuration file.",
|
package/dist/Parser/index.d.mts
CHANGED
|
@@ -1,2 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/Parser/index.d.ts
|
|
2
|
+
type ParserOptions = Record<string, unknown>;
|
|
3
|
+
type ParserName = string;
|
|
4
|
+
interface Parser {
|
|
5
|
+
/** Name of parser */
|
|
6
|
+
readonly name: ParserName;
|
|
7
|
+
/**
|
|
8
|
+
* Parse Method
|
|
9
|
+
* @param content - full content of the file
|
|
10
|
+
* @param filename - filename
|
|
11
|
+
*/
|
|
12
|
+
parse(content: string, filename: string): ParseResult;
|
|
13
|
+
}
|
|
14
|
+
interface ParseResult {
|
|
15
|
+
readonly content: string;
|
|
16
|
+
readonly filename: string;
|
|
17
|
+
readonly parsedTexts: Iterable<ParsedText>;
|
|
18
|
+
}
|
|
19
|
+
interface ParsedText {
|
|
20
|
+
/**
|
|
21
|
+
* The text extracted and possibly transformed
|
|
22
|
+
*/
|
|
23
|
+
readonly text: string;
|
|
24
|
+
/**
|
|
25
|
+
* The raw text before it has been transformed
|
|
26
|
+
*/
|
|
27
|
+
readonly rawText?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* start and end offsets of the text
|
|
30
|
+
*/
|
|
31
|
+
readonly range: Range;
|
|
32
|
+
/**
|
|
33
|
+
* The Scope annotation for a segment of text.
|
|
34
|
+
* Used by the spell checker to apply spell checking options
|
|
35
|
+
* based upon the value of the scope.
|
|
36
|
+
*/
|
|
37
|
+
readonly scope?: Scope | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The source map is used to support text transformations.
|
|
40
|
+
*
|
|
41
|
+
* See: {@link SourceMap}
|
|
42
|
+
*/
|
|
43
|
+
readonly map?: SourceMap | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Used to delegate parsing the contents of `text` to another parser.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
readonly delegate?: DelegateInfo | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A SourceMap is used to map transform a piece of text back to its original text.
|
|
52
|
+
* This is necessary in order to report the correct location of a spelling issue.
|
|
53
|
+
* An empty source map indicates that it was a 1:1 transformation.
|
|
54
|
+
*
|
|
55
|
+
* The values in a source map are number pairs (even, odd) relative to the beginning of each
|
|
56
|
+
* string segment.
|
|
57
|
+
* - even - offset in the source text
|
|
58
|
+
* - odd - offset in the transformed text
|
|
59
|
+
*
|
|
60
|
+
* Offsets start a 0
|
|
61
|
+
*
|
|
62
|
+
* Example:
|
|
63
|
+
*
|
|
64
|
+
* - Original text: `Grand Caf\u00e9 Bj\u00f8rvika`
|
|
65
|
+
* - Transformed text: `Grand Café Bjørvika`
|
|
66
|
+
* - Map: [9, 9, 15, 10, 18, 13, 24, 14]
|
|
67
|
+
*
|
|
68
|
+
* | offset | original | offset | transformed |
|
|
69
|
+
* | ------ | ----------- | ------ | ----------- |
|
|
70
|
+
* | 0-9 | `Grand Caf` | 0-9 | `Grand Caf` |
|
|
71
|
+
* | 9-15 | `\u00e9` | 9-10 | `é` |
|
|
72
|
+
* | 15-18 | ` Bj` | 10-13 | ` Bj` |
|
|
73
|
+
* | 18-24 | `\u00f8` | 13-14 | `ø` |
|
|
74
|
+
* | 24-29 | `rvika` | 14-19 | `rvika` |
|
|
75
|
+
*
|
|
76
|
+
* <!--- cspell:ignore Bjørvika rvika --->
|
|
77
|
+
*/
|
|
78
|
+
type SourceMap = number[];
|
|
79
|
+
type Range = readonly [start: number, end: number];
|
|
80
|
+
/**
|
|
81
|
+
* DelegateInfo is used by a parser to delegate parsing a subsection of a document to
|
|
82
|
+
* another parser. The following information is used by the spell checker to match
|
|
83
|
+
* the parser.
|
|
84
|
+
*/
|
|
85
|
+
interface DelegateInfo {
|
|
86
|
+
/**
|
|
87
|
+
* Proposed virtual file name including the extension.
|
|
88
|
+
* Format: `./${source_filename}/${block_number}.${ext}
|
|
89
|
+
* Example: `./README.md/1.js`
|
|
90
|
+
*/
|
|
91
|
+
readonly filename: string;
|
|
92
|
+
/**
|
|
93
|
+
* The filename of the origin of the virtual file block.
|
|
94
|
+
* Example: `./README.md`
|
|
95
|
+
*/
|
|
96
|
+
readonly originFilename: string;
|
|
97
|
+
/**
|
|
98
|
+
* Proposed file extension
|
|
99
|
+
* Example: `.js`
|
|
100
|
+
*/
|
|
101
|
+
readonly extension: string;
|
|
102
|
+
/**
|
|
103
|
+
* Filetype to use
|
|
104
|
+
* Example: `javascript`
|
|
105
|
+
*/
|
|
106
|
+
readonly fileType?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Scope - chain of scope going from local to global
|
|
110
|
+
*
|
|
111
|
+
* Example:
|
|
112
|
+
* ```
|
|
113
|
+
* `comment.block.documentation.ts` -> `meta.interface.ts` -> `source.ts`
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface ScopeChain {
|
|
117
|
+
readonly value: string;
|
|
118
|
+
readonly parent?: ScopeChain | undefined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A string representing a scope chain separated by spaces
|
|
122
|
+
*
|
|
123
|
+
* Example: `comment.block.documentation.ts meta.interface.ts source.ts`
|
|
124
|
+
*/
|
|
125
|
+
type ScopeString = string;
|
|
126
|
+
type Scope = ScopeChain | ScopeString;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { DelegateInfo, ParseResult, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap };
|
|
129
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/Parser/index.d.ts
CHANGED
|
@@ -1,2 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/Parser/index.d.ts
|
|
2
|
+
type ParserOptions = Record<string, unknown>;
|
|
3
|
+
type ParserName = string;
|
|
4
|
+
interface Parser {
|
|
5
|
+
/** Name of parser */
|
|
6
|
+
readonly name: ParserName;
|
|
7
|
+
/**
|
|
8
|
+
* Parse Method
|
|
9
|
+
* @param content - full content of the file
|
|
10
|
+
* @param filename - filename
|
|
11
|
+
*/
|
|
12
|
+
parse(content: string, filename: string): ParseResult;
|
|
13
|
+
}
|
|
14
|
+
interface ParseResult {
|
|
15
|
+
readonly content: string;
|
|
16
|
+
readonly filename: string;
|
|
17
|
+
readonly parsedTexts: Iterable<ParsedText>;
|
|
18
|
+
}
|
|
19
|
+
interface ParsedText {
|
|
20
|
+
/**
|
|
21
|
+
* The text extracted and possibly transformed
|
|
22
|
+
*/
|
|
23
|
+
readonly text: string;
|
|
24
|
+
/**
|
|
25
|
+
* The raw text before it has been transformed
|
|
26
|
+
*/
|
|
27
|
+
readonly rawText?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* start and end offsets of the text
|
|
30
|
+
*/
|
|
31
|
+
readonly range: Range;
|
|
32
|
+
/**
|
|
33
|
+
* The Scope annotation for a segment of text.
|
|
34
|
+
* Used by the spell checker to apply spell checking options
|
|
35
|
+
* based upon the value of the scope.
|
|
36
|
+
*/
|
|
37
|
+
readonly scope?: Scope | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The source map is used to support text transformations.
|
|
40
|
+
*
|
|
41
|
+
* See: {@link SourceMap}
|
|
42
|
+
*/
|
|
43
|
+
readonly map?: SourceMap | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Used to delegate parsing the contents of `text` to another parser.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
readonly delegate?: DelegateInfo | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A SourceMap is used to map transform a piece of text back to its original text.
|
|
52
|
+
* This is necessary in order to report the correct location of a spelling issue.
|
|
53
|
+
* An empty source map indicates that it was a 1:1 transformation.
|
|
54
|
+
*
|
|
55
|
+
* The values in a source map are number pairs (even, odd) relative to the beginning of each
|
|
56
|
+
* string segment.
|
|
57
|
+
* - even - offset in the source text
|
|
58
|
+
* - odd - offset in the transformed text
|
|
59
|
+
*
|
|
60
|
+
* Offsets start a 0
|
|
61
|
+
*
|
|
62
|
+
* Example:
|
|
63
|
+
*
|
|
64
|
+
* - Original text: `Grand Caf\u00e9 Bj\u00f8rvika`
|
|
65
|
+
* - Transformed text: `Grand Café Bjørvika`
|
|
66
|
+
* - Map: [9, 9, 15, 10, 18, 13, 24, 14]
|
|
67
|
+
*
|
|
68
|
+
* | offset | original | offset | transformed |
|
|
69
|
+
* | ------ | ----------- | ------ | ----------- |
|
|
70
|
+
* | 0-9 | `Grand Caf` | 0-9 | `Grand Caf` |
|
|
71
|
+
* | 9-15 | `\u00e9` | 9-10 | `é` |
|
|
72
|
+
* | 15-18 | ` Bj` | 10-13 | ` Bj` |
|
|
73
|
+
* | 18-24 | `\u00f8` | 13-14 | `ø` |
|
|
74
|
+
* | 24-29 | `rvika` | 14-19 | `rvika` |
|
|
75
|
+
*
|
|
76
|
+
* <!--- cspell:ignore Bjørvika rvika --->
|
|
77
|
+
*/
|
|
78
|
+
type SourceMap = number[];
|
|
79
|
+
type Range = readonly [start: number, end: number];
|
|
80
|
+
/**
|
|
81
|
+
* DelegateInfo is used by a parser to delegate parsing a subsection of a document to
|
|
82
|
+
* another parser. The following information is used by the spell checker to match
|
|
83
|
+
* the parser.
|
|
84
|
+
*/
|
|
85
|
+
interface DelegateInfo {
|
|
86
|
+
/**
|
|
87
|
+
* Proposed virtual file name including the extension.
|
|
88
|
+
* Format: `./${source_filename}/${block_number}.${ext}
|
|
89
|
+
* Example: `./README.md/1.js`
|
|
90
|
+
*/
|
|
91
|
+
readonly filename: string;
|
|
92
|
+
/**
|
|
93
|
+
* The filename of the origin of the virtual file block.
|
|
94
|
+
* Example: `./README.md`
|
|
95
|
+
*/
|
|
96
|
+
readonly originFilename: string;
|
|
97
|
+
/**
|
|
98
|
+
* Proposed file extension
|
|
99
|
+
* Example: `.js`
|
|
100
|
+
*/
|
|
101
|
+
readonly extension: string;
|
|
102
|
+
/**
|
|
103
|
+
* Filetype to use
|
|
104
|
+
* Example: `javascript`
|
|
105
|
+
*/
|
|
106
|
+
readonly fileType?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Scope - chain of scope going from local to global
|
|
110
|
+
*
|
|
111
|
+
* Example:
|
|
112
|
+
* ```
|
|
113
|
+
* `comment.block.documentation.ts` -> `meta.interface.ts` -> `source.ts`
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
interface ScopeChain {
|
|
117
|
+
readonly value: string;
|
|
118
|
+
readonly parent?: ScopeChain | undefined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A string representing a scope chain separated by spaces
|
|
122
|
+
*
|
|
123
|
+
* Example: `comment.block.documentation.ts meta.interface.ts source.ts`
|
|
124
|
+
*/
|
|
125
|
+
type ScopeString = string;
|
|
126
|
+
type Scope = ScopeChain | ScopeString;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { DelegateInfo, ParseResult, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap };
|
|
129
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParseResult, ParsedText, Parser, ParserName, ParserOptions } from "./Parser/index.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/SuggestionsConfiguration.d.ts
|
|
4
4
|
interface SuggestionsConfiguration {
|
|
@@ -750,9 +750,18 @@ interface DictionaryDefinitionBase {
|
|
|
750
750
|
supportNonStrictSearches?: boolean | undefined;
|
|
751
751
|
}
|
|
752
752
|
interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
753
|
-
/**
|
|
753
|
+
/**
|
|
754
|
+
* Path or url to the dictionary file.
|
|
755
|
+
*/
|
|
754
756
|
path: DictionaryPath;
|
|
755
757
|
/**
|
|
758
|
+
* An alternative path to a bTrie dictionary file.
|
|
759
|
+
* It will be used in place of `path` if the version of CSpell being used
|
|
760
|
+
* supports btrie files.
|
|
761
|
+
* @since 9.6.0
|
|
762
|
+
*/
|
|
763
|
+
btrie?: DictionaryPathToBTrie | undefined;
|
|
764
|
+
/**
|
|
756
765
|
* Only for legacy dictionary definitions.
|
|
757
766
|
* @deprecated true
|
|
758
767
|
* @deprecationMessage Use {@link path} instead.
|
|
@@ -760,10 +769,25 @@ interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
|
760
769
|
*/
|
|
761
770
|
file?: undefined;
|
|
762
771
|
}
|
|
772
|
+
interface HiddenPaths {
|
|
773
|
+
/**
|
|
774
|
+
* @hide
|
|
775
|
+
*/
|
|
776
|
+
path?: string | undefined;
|
|
777
|
+
/**
|
|
778
|
+
* @hide
|
|
779
|
+
*/
|
|
780
|
+
btrie?: string | undefined;
|
|
781
|
+
/**
|
|
782
|
+
* @hide
|
|
783
|
+
*/
|
|
784
|
+
file?: undefined;
|
|
785
|
+
}
|
|
786
|
+
interface DictionaryDefinitionBaseWithPathsHidden extends DictionaryDefinitionBase, HiddenPaths {}
|
|
763
787
|
/**
|
|
764
788
|
* An Empty Dictionary Definition
|
|
765
789
|
*/
|
|
766
|
-
interface DictionaryDefinitionSimple extends
|
|
790
|
+
interface DictionaryDefinitionSimple extends DictionaryDefinitionBaseWithPathsHidden {
|
|
767
791
|
/**
|
|
768
792
|
* @hide
|
|
769
793
|
*/
|
|
@@ -784,14 +808,6 @@ interface DictionaryDefinitionSimple extends DictionaryDefinitionBase {
|
|
|
784
808
|
* @hide
|
|
785
809
|
*/
|
|
786
810
|
type?: DictionaryFileTypes | undefined;
|
|
787
|
-
/**
|
|
788
|
-
* @hide
|
|
789
|
-
*/
|
|
790
|
-
path?: string | undefined;
|
|
791
|
-
/**
|
|
792
|
-
* @hide
|
|
793
|
-
*/
|
|
794
|
-
file?: undefined;
|
|
795
811
|
}
|
|
796
812
|
/**
|
|
797
813
|
* Used to provide extra data related to the dictionary
|
|
@@ -809,6 +825,11 @@ interface HiddenFields {
|
|
|
809
825
|
* Not used
|
|
810
826
|
* @hide
|
|
811
827
|
*/
|
|
828
|
+
btrie?: string | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Not used
|
|
831
|
+
* @hide
|
|
832
|
+
*/
|
|
812
833
|
file?: undefined;
|
|
813
834
|
/**
|
|
814
835
|
* Not used
|
|
@@ -862,12 +883,9 @@ type DictionaryDefinitionInline = DictionaryDefinitionInlineWords | DictionaryDe
|
|
|
862
883
|
* Only for legacy dictionary definitions.
|
|
863
884
|
* @deprecated true
|
|
864
885
|
* @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
|
|
886
|
+
* This will be removed in a future release.
|
|
865
887
|
*/
|
|
866
|
-
interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
867
|
-
/**
|
|
868
|
-
* @hidden
|
|
869
|
-
*/
|
|
870
|
-
path?: undefined;
|
|
888
|
+
interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase, Omit<HiddenPaths, "file"> {
|
|
871
889
|
/**
|
|
872
890
|
* Path to the file, only for legacy dictionary definitions.
|
|
873
891
|
* @deprecated true
|
|
@@ -881,9 +899,11 @@ interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
|
881
899
|
}
|
|
882
900
|
/**
|
|
883
901
|
* @deprecated true
|
|
902
|
+
* @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
|
|
903
|
+
* This will be removed in a future release.
|
|
884
904
|
* @hidden
|
|
885
905
|
*/
|
|
886
|
-
interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
906
|
+
interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase, Omit<HiddenPaths, "file" | "path"> {
|
|
887
907
|
/** Path to the file, if undefined the path to the extension dictionaries is assumed. */
|
|
888
908
|
path?: FsDictionaryPath;
|
|
889
909
|
/**
|
|
@@ -922,7 +942,9 @@ type CustomDictionaryScope = "user" | "workspace" | "folder";
|
|
|
922
942
|
* Note: only plain text files with one word per line are supported at this moment.
|
|
923
943
|
*/
|
|
924
944
|
interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
|
|
925
|
-
/**
|
|
945
|
+
/**
|
|
946
|
+
* A file path or url to a custom dictionary file.
|
|
947
|
+
*/
|
|
926
948
|
path: CustomDictionaryPath;
|
|
927
949
|
/**
|
|
928
950
|
* Defines the scope for when words will be added to the dictionary.
|
|
@@ -956,13 +978,19 @@ type ReplaceMap = ReplaceEntry[];
|
|
|
956
978
|
type FsDictionaryPath = string;
|
|
957
979
|
/**
|
|
958
980
|
* A File System Path to a dictionary file.
|
|
959
|
-
* Pattern: `^.*\.(?:txt|trie|dic)(?:\.gz)?$`
|
|
981
|
+
* Pattern: `^.*\.(?:txt|trie|btrie|dic)(?:\.gz)?$`
|
|
960
982
|
*/
|
|
961
983
|
type DictionaryPath = string;
|
|
962
984
|
/**
|
|
963
985
|
* A File System Path to a dictionary file.
|
|
986
|
+
* Pattern: `^.*\.(?:btrie)(?:\.gz)?$`
|
|
987
|
+
* @since 9.6.0
|
|
988
|
+
*/
|
|
989
|
+
type DictionaryPathToBTrie = string;
|
|
990
|
+
/**
|
|
991
|
+
* A path or url to a custom dictionary file.
|
|
964
992
|
*/
|
|
965
|
-
type CustomDictionaryPath =
|
|
993
|
+
type CustomDictionaryPath = string;
|
|
966
994
|
/**
|
|
967
995
|
* Reference to a dictionary by name.
|
|
968
996
|
* One of:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParseResult, ParsedText, Parser, ParserName, ParserOptions } from "./Parser/index.js";
|
|
2
2
|
|
|
3
3
|
//#region src/SuggestionsConfiguration.d.ts
|
|
4
4
|
interface SuggestionsConfiguration {
|
|
@@ -750,9 +750,18 @@ interface DictionaryDefinitionBase {
|
|
|
750
750
|
supportNonStrictSearches?: boolean | undefined;
|
|
751
751
|
}
|
|
752
752
|
interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
753
|
-
/**
|
|
753
|
+
/**
|
|
754
|
+
* Path or url to the dictionary file.
|
|
755
|
+
*/
|
|
754
756
|
path: DictionaryPath;
|
|
755
757
|
/**
|
|
758
|
+
* An alternative path to a bTrie dictionary file.
|
|
759
|
+
* It will be used in place of `path` if the version of CSpell being used
|
|
760
|
+
* supports btrie files.
|
|
761
|
+
* @since 9.6.0
|
|
762
|
+
*/
|
|
763
|
+
btrie?: DictionaryPathToBTrie | undefined;
|
|
764
|
+
/**
|
|
756
765
|
* Only for legacy dictionary definitions.
|
|
757
766
|
* @deprecated true
|
|
758
767
|
* @deprecationMessage Use {@link path} instead.
|
|
@@ -760,10 +769,25 @@ interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
|
760
769
|
*/
|
|
761
770
|
file?: undefined;
|
|
762
771
|
}
|
|
772
|
+
interface HiddenPaths {
|
|
773
|
+
/**
|
|
774
|
+
* @hide
|
|
775
|
+
*/
|
|
776
|
+
path?: string | undefined;
|
|
777
|
+
/**
|
|
778
|
+
* @hide
|
|
779
|
+
*/
|
|
780
|
+
btrie?: string | undefined;
|
|
781
|
+
/**
|
|
782
|
+
* @hide
|
|
783
|
+
*/
|
|
784
|
+
file?: undefined;
|
|
785
|
+
}
|
|
786
|
+
interface DictionaryDefinitionBaseWithPathsHidden extends DictionaryDefinitionBase, HiddenPaths {}
|
|
763
787
|
/**
|
|
764
788
|
* An Empty Dictionary Definition
|
|
765
789
|
*/
|
|
766
|
-
interface DictionaryDefinitionSimple extends
|
|
790
|
+
interface DictionaryDefinitionSimple extends DictionaryDefinitionBaseWithPathsHidden {
|
|
767
791
|
/**
|
|
768
792
|
* @hide
|
|
769
793
|
*/
|
|
@@ -784,14 +808,6 @@ interface DictionaryDefinitionSimple extends DictionaryDefinitionBase {
|
|
|
784
808
|
* @hide
|
|
785
809
|
*/
|
|
786
810
|
type?: DictionaryFileTypes | undefined;
|
|
787
|
-
/**
|
|
788
|
-
* @hide
|
|
789
|
-
*/
|
|
790
|
-
path?: string | undefined;
|
|
791
|
-
/**
|
|
792
|
-
* @hide
|
|
793
|
-
*/
|
|
794
|
-
file?: undefined;
|
|
795
811
|
}
|
|
796
812
|
/**
|
|
797
813
|
* Used to provide extra data related to the dictionary
|
|
@@ -809,6 +825,11 @@ interface HiddenFields {
|
|
|
809
825
|
* Not used
|
|
810
826
|
* @hide
|
|
811
827
|
*/
|
|
828
|
+
btrie?: string | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Not used
|
|
831
|
+
* @hide
|
|
832
|
+
*/
|
|
812
833
|
file?: undefined;
|
|
813
834
|
/**
|
|
814
835
|
* Not used
|
|
@@ -862,12 +883,9 @@ type DictionaryDefinitionInline = DictionaryDefinitionInlineWords | DictionaryDe
|
|
|
862
883
|
* Only for legacy dictionary definitions.
|
|
863
884
|
* @deprecated true
|
|
864
885
|
* @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
|
|
886
|
+
* This will be removed in a future release.
|
|
865
887
|
*/
|
|
866
|
-
interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
867
|
-
/**
|
|
868
|
-
* @hidden
|
|
869
|
-
*/
|
|
870
|
-
path?: undefined;
|
|
888
|
+
interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase, Omit<HiddenPaths, "file"> {
|
|
871
889
|
/**
|
|
872
890
|
* Path to the file, only for legacy dictionary definitions.
|
|
873
891
|
* @deprecated true
|
|
@@ -881,9 +899,11 @@ interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
|
881
899
|
}
|
|
882
900
|
/**
|
|
883
901
|
* @deprecated true
|
|
902
|
+
* @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
|
|
903
|
+
* This will be removed in a future release.
|
|
884
904
|
* @hidden
|
|
885
905
|
*/
|
|
886
|
-
interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
906
|
+
interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase, Omit<HiddenPaths, "file" | "path"> {
|
|
887
907
|
/** Path to the file, if undefined the path to the extension dictionaries is assumed. */
|
|
888
908
|
path?: FsDictionaryPath;
|
|
889
909
|
/**
|
|
@@ -922,7 +942,9 @@ type CustomDictionaryScope = "user" | "workspace" | "folder";
|
|
|
922
942
|
* Note: only plain text files with one word per line are supported at this moment.
|
|
923
943
|
*/
|
|
924
944
|
interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
|
|
925
|
-
/**
|
|
945
|
+
/**
|
|
946
|
+
* A file path or url to a custom dictionary file.
|
|
947
|
+
*/
|
|
926
948
|
path: CustomDictionaryPath;
|
|
927
949
|
/**
|
|
928
950
|
* Defines the scope for when words will be added to the dictionary.
|
|
@@ -956,13 +978,19 @@ type ReplaceMap = ReplaceEntry[];
|
|
|
956
978
|
type FsDictionaryPath = string;
|
|
957
979
|
/**
|
|
958
980
|
* A File System Path to a dictionary file.
|
|
959
|
-
* Pattern: `^.*\.(?:txt|trie|dic)(?:\.gz)?$`
|
|
981
|
+
* Pattern: `^.*\.(?:txt|trie|btrie|dic)(?:\.gz)?$`
|
|
960
982
|
*/
|
|
961
983
|
type DictionaryPath = string;
|
|
962
984
|
/**
|
|
963
985
|
* A File System Path to a dictionary file.
|
|
986
|
+
* Pattern: `^.*\.(?:btrie)(?:\.gz)?$`
|
|
987
|
+
* @since 9.6.0
|
|
988
|
+
*/
|
|
989
|
+
type DictionaryPathToBTrie = string;
|
|
990
|
+
/**
|
|
991
|
+
* A path or url to a custom dictionary file.
|
|
964
992
|
*/
|
|
965
|
-
type CustomDictionaryPath =
|
|
993
|
+
type CustomDictionaryPath = string;
|
|
966
994
|
/**
|
|
967
995
|
* Reference to a dictionary by name.
|
|
968
996
|
* One of:
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
7
|
-
"version": "9.
|
|
7
|
+
"version": "9.6.0",
|
|
8
8
|
"description": "Types for cspell and cspell-lib",
|
|
9
9
|
"type": "commonjs",
|
|
10
10
|
"sideEffects": false,
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"node": ">=20"
|
|
87
87
|
},
|
|
88
88
|
"homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-types#readme",
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "163793ddf2a0ad90bc7c90351698a106003297af"
|
|
90
90
|
}
|
package/dist/index-BtvDF-9G.d.ts
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
//#region src/Parser/index.d.ts
|
|
2
|
-
type ParserOptions = Record<string, unknown>;
|
|
3
|
-
type ParserName = string;
|
|
4
|
-
interface Parser {
|
|
5
|
-
/** Name of parser */
|
|
6
|
-
readonly name: ParserName;
|
|
7
|
-
/**
|
|
8
|
-
* Parse Method
|
|
9
|
-
* @param content - full content of the file
|
|
10
|
-
* @param filename - filename
|
|
11
|
-
*/
|
|
12
|
-
parse(content: string, filename: string): ParseResult;
|
|
13
|
-
}
|
|
14
|
-
interface ParseResult {
|
|
15
|
-
readonly content: string;
|
|
16
|
-
readonly filename: string;
|
|
17
|
-
readonly parsedTexts: Iterable<ParsedText>;
|
|
18
|
-
}
|
|
19
|
-
interface ParsedText {
|
|
20
|
-
/**
|
|
21
|
-
* The text extracted and possibly transformed
|
|
22
|
-
*/
|
|
23
|
-
readonly text: string;
|
|
24
|
-
/**
|
|
25
|
-
* The raw text before it has been transformed
|
|
26
|
-
*/
|
|
27
|
-
readonly rawText?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* start and end offsets of the text
|
|
30
|
-
*/
|
|
31
|
-
readonly range: Range;
|
|
32
|
-
/**
|
|
33
|
-
* The Scope annotation for a segment of text.
|
|
34
|
-
* Used by the spell checker to apply spell checking options
|
|
35
|
-
* based upon the value of the scope.
|
|
36
|
-
*/
|
|
37
|
-
readonly scope?: Scope | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* The source map is used to support text transformations.
|
|
40
|
-
*
|
|
41
|
-
* See: {@link SourceMap}
|
|
42
|
-
*/
|
|
43
|
-
readonly map?: SourceMap | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Used to delegate parsing the contents of `text` to another parser.
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
readonly delegate?: DelegateInfo | undefined;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* A SourceMap is used to map transform a piece of text back to its original text.
|
|
52
|
-
* This is necessary in order to report the correct location of a spelling issue.
|
|
53
|
-
* An empty source map indicates that it was a 1:1 transformation.
|
|
54
|
-
*
|
|
55
|
-
* The values in a source map are number pairs (even, odd) relative to the beginning of each
|
|
56
|
-
* string segment.
|
|
57
|
-
* - even - offset in the source text
|
|
58
|
-
* - odd - offset in the transformed text
|
|
59
|
-
*
|
|
60
|
-
* Offsets start a 0
|
|
61
|
-
*
|
|
62
|
-
* Example:
|
|
63
|
-
*
|
|
64
|
-
* - Original text: `Grand Caf\u00e9 Bj\u00f8rvika`
|
|
65
|
-
* - Transformed text: `Grand Café Bjørvika`
|
|
66
|
-
* - Map: [9, 9, 15, 10, 18, 13, 24, 14]
|
|
67
|
-
*
|
|
68
|
-
* | offset | original | offset | transformed |
|
|
69
|
-
* | ------ | ----------- | ------ | ----------- |
|
|
70
|
-
* | 0-9 | `Grand Caf` | 0-9 | `Grand Caf` |
|
|
71
|
-
* | 9-15 | `\u00e9` | 9-10 | `é` |
|
|
72
|
-
* | 15-18 | ` Bj` | 10-13 | ` Bj` |
|
|
73
|
-
* | 18-24 | `\u00f8` | 13-14 | `ø` |
|
|
74
|
-
* | 24-29 | `rvika` | 14-19 | `rvika` |
|
|
75
|
-
*
|
|
76
|
-
* <!--- cspell:ignore Bjørvika rvika --->
|
|
77
|
-
*/
|
|
78
|
-
type SourceMap = number[];
|
|
79
|
-
type Range = readonly [start: number, end: number];
|
|
80
|
-
/**
|
|
81
|
-
* DelegateInfo is used by a parser to delegate parsing a subsection of a document to
|
|
82
|
-
* another parser. The following information is used by the spell checker to match
|
|
83
|
-
* the parser.
|
|
84
|
-
*/
|
|
85
|
-
interface DelegateInfo {
|
|
86
|
-
/**
|
|
87
|
-
* Proposed virtual file name including the extension.
|
|
88
|
-
* Format: `./${source_filename}/${block_number}.${ext}
|
|
89
|
-
* Example: `./README.md/1.js`
|
|
90
|
-
*/
|
|
91
|
-
readonly filename: string;
|
|
92
|
-
/**
|
|
93
|
-
* The filename of the origin of the virtual file block.
|
|
94
|
-
* Example: `./README.md`
|
|
95
|
-
*/
|
|
96
|
-
readonly originFilename: string;
|
|
97
|
-
/**
|
|
98
|
-
* Proposed file extension
|
|
99
|
-
* Example: `.js`
|
|
100
|
-
*/
|
|
101
|
-
readonly extension: string;
|
|
102
|
-
/**
|
|
103
|
-
* Filetype to use
|
|
104
|
-
* Example: `javascript`
|
|
105
|
-
*/
|
|
106
|
-
readonly fileType?: string;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Scope - chain of scope going from local to global
|
|
110
|
-
*
|
|
111
|
-
* Example:
|
|
112
|
-
* ```
|
|
113
|
-
* `comment.block.documentation.ts` -> `meta.interface.ts` -> `source.ts`
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
interface ScopeChain {
|
|
117
|
-
readonly value: string;
|
|
118
|
-
readonly parent?: ScopeChain | undefined;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* A string representing a scope chain separated by spaces
|
|
122
|
-
*
|
|
123
|
-
* Example: `comment.block.documentation.ts meta.interface.ts source.ts`
|
|
124
|
-
*/
|
|
125
|
-
type ScopeString = string;
|
|
126
|
-
type Scope = ScopeChain | ScopeString;
|
|
127
|
-
//#endregion
|
|
128
|
-
export { ParserName as a, Scope as c, SourceMap as d, Parser as i, ScopeChain as l, ParseResult as n, ParserOptions as o, ParsedText as r, Range as s, DelegateInfo as t, ScopeString as u };
|
|
129
|
-
//# sourceMappingURL=index-BtvDF-9G.d.ts.map
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
//#region src/Parser/index.d.ts
|
|
2
|
-
type ParserOptions = Record<string, unknown>;
|
|
3
|
-
type ParserName = string;
|
|
4
|
-
interface Parser {
|
|
5
|
-
/** Name of parser */
|
|
6
|
-
readonly name: ParserName;
|
|
7
|
-
/**
|
|
8
|
-
* Parse Method
|
|
9
|
-
* @param content - full content of the file
|
|
10
|
-
* @param filename - filename
|
|
11
|
-
*/
|
|
12
|
-
parse(content: string, filename: string): ParseResult;
|
|
13
|
-
}
|
|
14
|
-
interface ParseResult {
|
|
15
|
-
readonly content: string;
|
|
16
|
-
readonly filename: string;
|
|
17
|
-
readonly parsedTexts: Iterable<ParsedText>;
|
|
18
|
-
}
|
|
19
|
-
interface ParsedText {
|
|
20
|
-
/**
|
|
21
|
-
* The text extracted and possibly transformed
|
|
22
|
-
*/
|
|
23
|
-
readonly text: string;
|
|
24
|
-
/**
|
|
25
|
-
* The raw text before it has been transformed
|
|
26
|
-
*/
|
|
27
|
-
readonly rawText?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* start and end offsets of the text
|
|
30
|
-
*/
|
|
31
|
-
readonly range: Range;
|
|
32
|
-
/**
|
|
33
|
-
* The Scope annotation for a segment of text.
|
|
34
|
-
* Used by the spell checker to apply spell checking options
|
|
35
|
-
* based upon the value of the scope.
|
|
36
|
-
*/
|
|
37
|
-
readonly scope?: Scope | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* The source map is used to support text transformations.
|
|
40
|
-
*
|
|
41
|
-
* See: {@link SourceMap}
|
|
42
|
-
*/
|
|
43
|
-
readonly map?: SourceMap | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Used to delegate parsing the contents of `text` to another parser.
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
readonly delegate?: DelegateInfo | undefined;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* A SourceMap is used to map transform a piece of text back to its original text.
|
|
52
|
-
* This is necessary in order to report the correct location of a spelling issue.
|
|
53
|
-
* An empty source map indicates that it was a 1:1 transformation.
|
|
54
|
-
*
|
|
55
|
-
* The values in a source map are number pairs (even, odd) relative to the beginning of each
|
|
56
|
-
* string segment.
|
|
57
|
-
* - even - offset in the source text
|
|
58
|
-
* - odd - offset in the transformed text
|
|
59
|
-
*
|
|
60
|
-
* Offsets start a 0
|
|
61
|
-
*
|
|
62
|
-
* Example:
|
|
63
|
-
*
|
|
64
|
-
* - Original text: `Grand Caf\u00e9 Bj\u00f8rvika`
|
|
65
|
-
* - Transformed text: `Grand Café Bjørvika`
|
|
66
|
-
* - Map: [9, 9, 15, 10, 18, 13, 24, 14]
|
|
67
|
-
*
|
|
68
|
-
* | offset | original | offset | transformed |
|
|
69
|
-
* | ------ | ----------- | ------ | ----------- |
|
|
70
|
-
* | 0-9 | `Grand Caf` | 0-9 | `Grand Caf` |
|
|
71
|
-
* | 9-15 | `\u00e9` | 9-10 | `é` |
|
|
72
|
-
* | 15-18 | ` Bj` | 10-13 | ` Bj` |
|
|
73
|
-
* | 18-24 | `\u00f8` | 13-14 | `ø` |
|
|
74
|
-
* | 24-29 | `rvika` | 14-19 | `rvika` |
|
|
75
|
-
*
|
|
76
|
-
* <!--- cspell:ignore Bjørvika rvika --->
|
|
77
|
-
*/
|
|
78
|
-
type SourceMap = number[];
|
|
79
|
-
type Range = readonly [start: number, end: number];
|
|
80
|
-
/**
|
|
81
|
-
* DelegateInfo is used by a parser to delegate parsing a subsection of a document to
|
|
82
|
-
* another parser. The following information is used by the spell checker to match
|
|
83
|
-
* the parser.
|
|
84
|
-
*/
|
|
85
|
-
interface DelegateInfo {
|
|
86
|
-
/**
|
|
87
|
-
* Proposed virtual file name including the extension.
|
|
88
|
-
* Format: `./${source_filename}/${block_number}.${ext}
|
|
89
|
-
* Example: `./README.md/1.js`
|
|
90
|
-
*/
|
|
91
|
-
readonly filename: string;
|
|
92
|
-
/**
|
|
93
|
-
* The filename of the origin of the virtual file block.
|
|
94
|
-
* Example: `./README.md`
|
|
95
|
-
*/
|
|
96
|
-
readonly originFilename: string;
|
|
97
|
-
/**
|
|
98
|
-
* Proposed file extension
|
|
99
|
-
* Example: `.js`
|
|
100
|
-
*/
|
|
101
|
-
readonly extension: string;
|
|
102
|
-
/**
|
|
103
|
-
* Filetype to use
|
|
104
|
-
* Example: `javascript`
|
|
105
|
-
*/
|
|
106
|
-
readonly fileType?: string;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Scope - chain of scope going from local to global
|
|
110
|
-
*
|
|
111
|
-
* Example:
|
|
112
|
-
* ```
|
|
113
|
-
* `comment.block.documentation.ts` -> `meta.interface.ts` -> `source.ts`
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
interface ScopeChain {
|
|
117
|
-
readonly value: string;
|
|
118
|
-
readonly parent?: ScopeChain | undefined;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* A string representing a scope chain separated by spaces
|
|
122
|
-
*
|
|
123
|
-
* Example: `comment.block.documentation.ts meta.interface.ts source.ts`
|
|
124
|
-
*/
|
|
125
|
-
type ScopeString = string;
|
|
126
|
-
type Scope = ScopeChain | ScopeString;
|
|
127
|
-
//#endregion
|
|
128
|
-
export { ParserName as a, Scope as c, SourceMap as d, Parser as i, ScopeChain as l, ParseResult as n, ParserOptions as o, ParsedText as r, Range as s, DelegateInfo as t, ScopeString as u };
|
|
129
|
-
//# sourceMappingURL=index-TAd2zi6U.d.mts.map
|