@cspell/cspell-types 5.14.0 → 5.15.3
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/cspell.schema.json +182 -2
- package/dist/CSpellReporter.d.ts +6 -0
- package/dist/CSpellSettingsDef.d.ts +65 -4
- package/dist/configFields.d.ts +7 -0
- package/dist/configFields.js +50 -0
- package/dist/features.d.ts +38 -0
- package/dist/features.js +4 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -2
- package/dist/suggestionCostsDef.d.ts +71 -0
- package/dist/suggestionCostsDef.js +3 -0
- package/package.json +6 -5
package/cspell.schema.json
CHANGED
|
@@ -2,6 +2,124 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"additionalProperties": false,
|
|
4
4
|
"definitions": {
|
|
5
|
+
"CacheSettings": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"cacheLocation": {
|
|
9
|
+
"$ref": "#/definitions/FSPathResolvable",
|
|
10
|
+
"description": "Path to the cache location. Can be a file or a directory. If none specified `.cspellcache` will be used. Relative paths are relative to the config file in which it is defined.\n\nA prefix of `${cwd}` is replaced with the current working directory."
|
|
11
|
+
},
|
|
12
|
+
"cacheStrategy": {
|
|
13
|
+
"$ref": "#/definitions/CacheStrategy",
|
|
14
|
+
"default": "metadata",
|
|
15
|
+
"description": "Strategy to use for detecting changed files, default: metadata"
|
|
16
|
+
},
|
|
17
|
+
"useCache": {
|
|
18
|
+
"default": false,
|
|
19
|
+
"description": "Store the results of processed files in order to only operate on the changed ones.",
|
|
20
|
+
"type": "boolean"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "object"
|
|
24
|
+
},
|
|
25
|
+
"CacheStrategy": {
|
|
26
|
+
"description": "The Strategy to use to detect if a file has changed.\n- `metadata` - uses the file system timestamp and size to detect changes (fastest).\n- `content` - uses a hash of the file content to check file changes (slower - more accurate).",
|
|
27
|
+
"enum": [
|
|
28
|
+
"metadata",
|
|
29
|
+
"content"
|
|
30
|
+
],
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"CostMapDefInsDel": {
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"properties": {
|
|
36
|
+
"description": {
|
|
37
|
+
"description": "A description to describe the purpose of the map.",
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"insDel": {
|
|
41
|
+
"description": "The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical.",
|
|
42
|
+
"type": "number"
|
|
43
|
+
},
|
|
44
|
+
"map": {
|
|
45
|
+
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.",
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"replace": {
|
|
49
|
+
"description": "The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.",
|
|
50
|
+
"type": "number"
|
|
51
|
+
},
|
|
52
|
+
"swap": {
|
|
53
|
+
"description": "The cost to swap two adjacent substrings found in the map. Example: Map['e', 'i'] This represents the cost to change `ei` to `ie` or the reverse.",
|
|
54
|
+
"type": "number"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"insDel",
|
|
59
|
+
"map"
|
|
60
|
+
],
|
|
61
|
+
"type": "object"
|
|
62
|
+
},
|
|
63
|
+
"CostMapDefReplace": {
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"properties": {
|
|
66
|
+
"description": {
|
|
67
|
+
"description": "A description to describe the purpose of the map.",
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"insDel": {
|
|
71
|
+
"description": "The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical.",
|
|
72
|
+
"type": "number"
|
|
73
|
+
},
|
|
74
|
+
"map": {
|
|
75
|
+
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.",
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"replace": {
|
|
79
|
+
"description": "The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.",
|
|
80
|
+
"type": "number"
|
|
81
|
+
},
|
|
82
|
+
"swap": {
|
|
83
|
+
"description": "The cost to swap two adjacent substrings found in the map. Example: Map['e', 'i'] This represents the cost to change `ei` to `ie` or the reverse.",
|
|
84
|
+
"type": "number"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": [
|
|
88
|
+
"map",
|
|
89
|
+
"replace"
|
|
90
|
+
],
|
|
91
|
+
"type": "object"
|
|
92
|
+
},
|
|
93
|
+
"CostMapDefSwap": {
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"properties": {
|
|
96
|
+
"description": {
|
|
97
|
+
"description": "A description to describe the purpose of the map.",
|
|
98
|
+
"type": "string"
|
|
99
|
+
},
|
|
100
|
+
"insDel": {
|
|
101
|
+
"description": "The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical.",
|
|
102
|
+
"type": "number"
|
|
103
|
+
},
|
|
104
|
+
"map": {
|
|
105
|
+
"description": "The set of substrings to map, these are generally single character strings.\n\nMultiple sets can be defined by using a `|` to separate them.\n\nExample: `\"eéê|aåá\"` contains two different sets.\n\nTo add a multi-character substring use `()`.\n\nExample: `\"f(ph)(gh)\"` results in the following set: `f`, `ph`, `gh`.",
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"replace": {
|
|
109
|
+
"description": "The cost to replace of of the substrings in the map with another substring in the map. Example: Map['a', 'i'] This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.",
|
|
110
|
+
"type": "number"
|
|
111
|
+
},
|
|
112
|
+
"swap": {
|
|
113
|
+
"description": "The cost to swap two adjacent substrings found in the map. Example: Map['e', 'i'] This represents the cost to change `ei` to `ie` or the reverse.",
|
|
114
|
+
"type": "number"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"required": [
|
|
118
|
+
"map",
|
|
119
|
+
"swap"
|
|
120
|
+
],
|
|
121
|
+
"type": "object"
|
|
122
|
+
},
|
|
5
123
|
"CustomDictionaryPath": {
|
|
6
124
|
"description": "A File System Path to a dictionary file.",
|
|
7
125
|
"pattern": "^.*\\.txt$",
|
|
@@ -57,6 +175,10 @@
|
|
|
57
175
|
"$ref": "#/definitions/ReplaceMap",
|
|
58
176
|
"description": "Replacement pairs."
|
|
59
177
|
},
|
|
178
|
+
"suggestionEditCosts": {
|
|
179
|
+
"$ref": "#/definitions/SuggestionCostsDefs",
|
|
180
|
+
"description": "Used in making suggestions. The lower the value, the more likely the suggestion will be near the top of the suggestion list.\n\nAdded with `v5.16.0`."
|
|
181
|
+
},
|
|
60
182
|
"type": {
|
|
61
183
|
"$ref": "#/definitions/DictionaryFileTypes",
|
|
62
184
|
"default": "S",
|
|
@@ -115,6 +237,10 @@
|
|
|
115
237
|
],
|
|
116
238
|
"description": "Defines the scope for when words will be added to the dictionary. Scope values: `user`, `workspace`, `folder`."
|
|
117
239
|
},
|
|
240
|
+
"suggestionEditCosts": {
|
|
241
|
+
"$ref": "#/definitions/SuggestionCostsDefs",
|
|
242
|
+
"description": "Used in making suggestions. The lower the value, the more likely the suggestion will be near the top of the suggestion list.\n\nAdded with `v5.16.0`."
|
|
243
|
+
},
|
|
118
244
|
"type": {
|
|
119
245
|
"$ref": "#/definitions/DictionaryFileTypes",
|
|
120
246
|
"default": "S",
|
|
@@ -155,6 +281,10 @@
|
|
|
155
281
|
"$ref": "#/definitions/ReplaceMap",
|
|
156
282
|
"description": "Replacement pairs."
|
|
157
283
|
},
|
|
284
|
+
"suggestionEditCosts": {
|
|
285
|
+
"$ref": "#/definitions/SuggestionCostsDefs",
|
|
286
|
+
"description": "Used in making suggestions. The lower the value, the more likely the suggestion will be near the top of the suggestion list.\n\nAdded with `v5.16.0`."
|
|
287
|
+
},
|
|
158
288
|
"type": {
|
|
159
289
|
"$ref": "#/definitions/DictionaryFileTypes",
|
|
160
290
|
"default": "S",
|
|
@@ -210,8 +340,26 @@
|
|
|
210
340
|
],
|
|
211
341
|
"description": "Reference to a dictionary by name. One of:\n- {@link DictionaryRef } \n- {@link DictionaryNegRef }"
|
|
212
342
|
},
|
|
343
|
+
"FSPathResolvable": {
|
|
344
|
+
"$ref": "#/definitions/FsPath",
|
|
345
|
+
"description": "A File System Path.\n\nSpecial Properties:\n- `${cwd}` prefix - will be replaced with the current working directory.\n- Relative paths are relative to the configuration file."
|
|
346
|
+
},
|
|
347
|
+
"FeatureEnableOnly": {
|
|
348
|
+
"type": "boolean"
|
|
349
|
+
},
|
|
350
|
+
"Features": {
|
|
351
|
+
"additionalProperties": false,
|
|
352
|
+
"description": "Features are behaviors or settings that can be explicitly configured.",
|
|
353
|
+
"properties": {
|
|
354
|
+
"weighted-suggestions": {
|
|
355
|
+
"$ref": "#/definitions/FeatureEnableOnly",
|
|
356
|
+
"description": "Enable/disable using weighted suggestions."
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"type": "object"
|
|
360
|
+
},
|
|
213
361
|
"FsPath": {
|
|
214
|
-
"description": "A File System Path.",
|
|
362
|
+
"description": "A File System Path. Relative paths are relative to the configuration file.",
|
|
215
363
|
"type": "string"
|
|
216
364
|
},
|
|
217
365
|
"Glob": {
|
|
@@ -596,6 +744,8 @@
|
|
|
596
744
|
"PredefinedPatterns": {
|
|
597
745
|
"enum": [
|
|
598
746
|
"Base64",
|
|
747
|
+
"Base64MultiLine",
|
|
748
|
+
"Base64SingleLine",
|
|
599
749
|
"CStyleComment",
|
|
600
750
|
"CStyleHexValue",
|
|
601
751
|
"CSSHexValue",
|
|
@@ -608,7 +758,9 @@
|
|
|
608
758
|
"PhpHereDoc",
|
|
609
759
|
"PublicKey",
|
|
610
760
|
"RsaCert",
|
|
761
|
+
"SshRsa",
|
|
611
762
|
"SHA",
|
|
763
|
+
"HashStrings",
|
|
612
764
|
"SpellCheckerDisable",
|
|
613
765
|
"SpellCheckerDisableBlock",
|
|
614
766
|
"SpellCheckerDisableLine",
|
|
@@ -706,6 +858,26 @@
|
|
|
706
858
|
"description": "Simple Glob string, the root will be globRoot.",
|
|
707
859
|
"type": "string"
|
|
708
860
|
},
|
|
861
|
+
"SuggestionCostMapDef": {
|
|
862
|
+
"anyOf": [
|
|
863
|
+
{
|
|
864
|
+
"$ref": "#/definitions/CostMapDefReplace"
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
"$ref": "#/definitions/CostMapDefInsDel"
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"$ref": "#/definitions/CostMapDefSwap"
|
|
871
|
+
}
|
|
872
|
+
],
|
|
873
|
+
"description": "A WeightedMapDef enables setting weights for edits between related characters and substrings.\n\nMultiple groups can be defined using a `|`. A multi-character substring is defined using `()`.\n\nFor example, in some languages, some letters sound alike.\n\n```ts { map: 'sc(sh)(sch)(ss)|t(tt)', // two groups. replace: 50, // Make it 1/2 the cost of a normal edit to replace a `t` with `tt`. } ```\n\nThe following could be used to make inserting, removing, or replacing vowels cheaper. ```ts { map: 'aeiouy', //. insDel: 50, // Make it is cheaper to insert or delete a vowel. replace: 45, // It is even cheaper to replace one with another. } ```\n\nNote: the default edit distance is 100."
|
|
874
|
+
},
|
|
875
|
+
"SuggestionCostsDefs": {
|
|
876
|
+
"items": {
|
|
877
|
+
"$ref": "#/definitions/SuggestionCostMapDef"
|
|
878
|
+
},
|
|
879
|
+
"type": "array"
|
|
880
|
+
},
|
|
709
881
|
"Version": {
|
|
710
882
|
"anyOf": [
|
|
711
883
|
{
|
|
@@ -738,6 +910,10 @@
|
|
|
738
910
|
"description": "True to enable compound word checking.",
|
|
739
911
|
"type": "boolean"
|
|
740
912
|
},
|
|
913
|
+
"cache": {
|
|
914
|
+
"$ref": "#/definitions/CacheSettings",
|
|
915
|
+
"description": "Define cache settings."
|
|
916
|
+
},
|
|
741
917
|
"caseSensitive": {
|
|
742
918
|
"default": false,
|
|
743
919
|
"description": "Determines if words must match case and accent rules.\n\n- `false` - Case is ignored and accents can be missing on the entire word. Incorrect accents or partially missing accents will be marked as incorrect.\n- `true` - Case and accents are enforced.",
|
|
@@ -788,6 +964,10 @@
|
|
|
788
964
|
},
|
|
789
965
|
"type": "array"
|
|
790
966
|
},
|
|
967
|
+
"features": {
|
|
968
|
+
"$ref": "#/definitions/Features",
|
|
969
|
+
"description": "Configure CSpell features.\n\n- Added with `v5.16.0`."
|
|
970
|
+
},
|
|
791
971
|
"files": {
|
|
792
972
|
"description": "Glob patterns of files to be checked. Glob patterns are relative to the `globRoot` of the configuration file that defines them.",
|
|
793
973
|
"items": {
|
|
@@ -817,7 +997,7 @@
|
|
|
817
997
|
"description": "Tells the spell checker to searching for `.gitignore` files when it reaches a matching root."
|
|
818
998
|
},
|
|
819
999
|
"globRoot": {
|
|
820
|
-
"$ref": "#/definitions/
|
|
1000
|
+
"$ref": "#/definitions/FSPathResolvable",
|
|
821
1001
|
"description": "The root to use for glob patterns found in this configuration. Default: location of the configuration file. For compatibility reasons, config files with version 0.1, the glob root will default to be `${cwd}`.\n\nUse `globRoot` to define a different location. `globRoot` can be relative to the location of this configuration file. Defining globRoot, does not impact imported configurations.\n\nSpecial Values:\n- `${cwd}` - will be replaced with the current working directory.\n- `.` - will be the location of the containing configuration file."
|
|
822
1002
|
},
|
|
823
1003
|
"id": {
|
package/dist/CSpellReporter.d.ts
CHANGED
|
@@ -36,10 +36,16 @@ export interface ProgressFileComplete extends ProgressBase {
|
|
|
36
36
|
}
|
|
37
37
|
export declare type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
|
|
38
38
|
export interface RunResult {
|
|
39
|
+
/** Number of files processed. */
|
|
39
40
|
files: number;
|
|
41
|
+
/** Set of files where issues were found. */
|
|
40
42
|
filesWithIssues: Set<string>;
|
|
43
|
+
/** Number of issues found. */
|
|
41
44
|
issues: number;
|
|
45
|
+
/** Number of processing errors. */
|
|
42
46
|
errors: number;
|
|
47
|
+
/** Number files that used results from the cache. */
|
|
48
|
+
cachedFiles?: number;
|
|
43
49
|
}
|
|
44
50
|
export declare type ResultEmitter = (result: RunResult) => void | Promise<void>;
|
|
45
51
|
export interface CSpellReporter {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Features } from './features';
|
|
2
|
+
import type { SuggestionCostsDefs } from './suggestionCostsDef';
|
|
1
3
|
export declare type ReplaceEntry = [string, string];
|
|
2
4
|
export declare type ReplaceMap = ReplaceEntry[];
|
|
3
5
|
/**
|
|
@@ -18,7 +20,7 @@ export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
|
|
|
18
20
|
__importRef?: ImportFileRef;
|
|
19
21
|
__imports?: Map<string, ImportFileRef>;
|
|
20
22
|
}
|
|
21
|
-
export interface FileSettings extends ExtendableSettings {
|
|
23
|
+
export interface FileSettings extends ExtendableSettings, CommandLineSettings {
|
|
22
24
|
/**
|
|
23
25
|
* Configuration format version of the settings file.
|
|
24
26
|
* @default "0.2"
|
|
@@ -43,7 +45,7 @@ export interface FileSettings extends ExtendableSettings {
|
|
|
43
45
|
* - `.` - will be the location of the containing configuration file.
|
|
44
46
|
*
|
|
45
47
|
*/
|
|
46
|
-
globRoot?:
|
|
48
|
+
globRoot?: FSPathResolvable;
|
|
47
49
|
/**
|
|
48
50
|
* Glob patterns of files to be checked.
|
|
49
51
|
* Glob patterns are relative to the `globRoot` of the configuration file that defines them.
|
|
@@ -86,6 +88,12 @@ export interface FileSettings extends ExtendableSettings {
|
|
|
86
88
|
* Tells the spell checker to searching for `.gitignore` files when it reaches a matching root.
|
|
87
89
|
*/
|
|
88
90
|
gitignoreRoot?: FsPath | FsPath[];
|
|
91
|
+
/**
|
|
92
|
+
* Configure CSpell features.
|
|
93
|
+
*
|
|
94
|
+
* - Added with `v5.16.0`.
|
|
95
|
+
*/
|
|
96
|
+
features?: Features;
|
|
89
97
|
}
|
|
90
98
|
export interface ExtendableSettings extends Settings {
|
|
91
99
|
/** Overrides to apply based upon the file path. */
|
|
@@ -184,6 +192,42 @@ export interface PnPSettings {
|
|
|
184
192
|
*/
|
|
185
193
|
pnpFiles?: string[];
|
|
186
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* The Strategy to use to detect if a file has changed.
|
|
197
|
+
* - `metadata` - uses the file system timestamp and size to detect changes (fastest).
|
|
198
|
+
* - `content` - uses a hash of the file content to check file changes (slower - more accurate).
|
|
199
|
+
*/
|
|
200
|
+
export declare type CacheStrategy = 'metadata' | 'content';
|
|
201
|
+
export interface CacheSettings {
|
|
202
|
+
/**
|
|
203
|
+
* Store the results of processed files in order to only operate on the changed ones.
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
useCache?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Path to the cache location. Can be a file or a directory.
|
|
209
|
+
* If none specified `.cspellcache` will be used.
|
|
210
|
+
* Relative paths are relative to the config file in which it
|
|
211
|
+
* is defined.
|
|
212
|
+
*
|
|
213
|
+
* A prefix of `${cwd}` is replaced with the current working directory.
|
|
214
|
+
*/
|
|
215
|
+
cacheLocation?: FSPathResolvable;
|
|
216
|
+
/**
|
|
217
|
+
* Strategy to use for detecting changed files, default: metadata
|
|
218
|
+
* @default 'metadata'
|
|
219
|
+
*/
|
|
220
|
+
cacheStrategy?: CacheStrategy;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* These are settings only used by the command line application.
|
|
224
|
+
*/
|
|
225
|
+
export interface CommandLineSettings {
|
|
226
|
+
/**
|
|
227
|
+
* Define cache settings.
|
|
228
|
+
*/
|
|
229
|
+
cache?: CacheSettings;
|
|
230
|
+
}
|
|
187
231
|
/**
|
|
188
232
|
* To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
|
|
189
233
|
* are use to set the trust levels.
|
|
@@ -341,6 +385,13 @@ export interface DictionaryDefinitionBase {
|
|
|
341
385
|
* @default "S"
|
|
342
386
|
*/
|
|
343
387
|
type?: DictionaryFileTypes;
|
|
388
|
+
/**
|
|
389
|
+
* Used in making suggestions. The lower the value, the more likely the suggestion
|
|
390
|
+
* will be near the top of the suggestion list.
|
|
391
|
+
*
|
|
392
|
+
* Added with `v5.16.0`.
|
|
393
|
+
*/
|
|
394
|
+
suggestionEditCosts?: SuggestionCostsDefs;
|
|
344
395
|
}
|
|
345
396
|
export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
346
397
|
/** Path to the file. */
|
|
@@ -439,7 +490,7 @@ export interface LanguageSettingFilterFieldsDeprecated {
|
|
|
439
490
|
/** @hidden */
|
|
440
491
|
declare type InternalRegExp = RegExp;
|
|
441
492
|
export declare type Pattern = string | InternalRegExp;
|
|
442
|
-
export declare type PredefinedPatterns = 'Base64' | 'CStyleComment' | 'CStyleHexValue' | 'CSSHexValue' | 'CommitHash' | 'CommitHashLink' | 'Email' | 'EscapeCharacters' | 'HexValues' | 'href' | 'PhpHereDoc' | 'PublicKey' | 'RsaCert' | 'SHA' | 'SpellCheckerDisable' | 'SpellCheckerDisableBlock' | 'SpellCheckerDisableLine' | 'SpellCheckerDisableNext' | 'SpellCheckerIgnoreInDocSetting' | 'string' | 'UnicodeRef' | 'Urls' | 'UUID' | 'Everything';
|
|
493
|
+
export declare type PredefinedPatterns = 'Base64' | 'Base64MultiLine' | 'Base64SingleLine' | 'CStyleComment' | 'CStyleHexValue' | 'CSSHexValue' | 'CommitHash' | 'CommitHashLink' | 'Email' | 'EscapeCharacters' | 'HexValues' | 'href' | 'PhpHereDoc' | 'PublicKey' | 'RsaCert' | 'SshRsa' | 'SHA' | 'HashStrings' | 'SpellCheckerDisable' | 'SpellCheckerDisableBlock' | 'SpellCheckerDisableLine' | 'SpellCheckerDisableNext' | 'SpellCheckerIgnoreInDocSetting' | 'string' | 'UnicodeRef' | 'Urls' | 'UUID' | 'Everything';
|
|
443
494
|
/** This matches the name in a pattern definition. */
|
|
444
495
|
export declare type PatternId = string;
|
|
445
496
|
/** A PatternRef is a Pattern or PatternId. */
|
|
@@ -541,8 +592,18 @@ export declare type LanguageIdMultiple = string;
|
|
|
541
592
|
*/
|
|
542
593
|
export declare type LanguageIdMultipleNeg = string;
|
|
543
594
|
export declare type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
|
|
544
|
-
/**
|
|
595
|
+
/**
|
|
596
|
+
* A File System Path. Relative paths are relative to the configuration file.
|
|
597
|
+
*/
|
|
545
598
|
export declare type FsPath = string;
|
|
599
|
+
/**
|
|
600
|
+
* A File System Path.
|
|
601
|
+
*
|
|
602
|
+
* Special Properties:
|
|
603
|
+
* - `${cwd}` prefix - will be replaced with the current working directory.
|
|
604
|
+
* - Relative paths are relative to the configuration file.
|
|
605
|
+
*/
|
|
606
|
+
export declare type FSPathResolvable = FsPath;
|
|
546
607
|
/** Trust Security Level. */
|
|
547
608
|
export declare type TrustLevel = 'trusted' | 'untrusted';
|
|
548
609
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSpellUserSettings } from './CSpellSettingsDef';
|
|
2
|
+
export declare type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
|
|
3
|
+
export declare type CSpellUserSettingsFields = {
|
|
4
|
+
[key in ConfigKeys]: key;
|
|
5
|
+
};
|
|
6
|
+
export declare const ConfigFields: CSpellUserSettingsFields;
|
|
7
|
+
//# sourceMappingURL=configFields.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigFields = void 0;
|
|
4
|
+
exports.ConfigFields = {
|
|
5
|
+
allowCompoundWords: 'allowCompoundWords',
|
|
6
|
+
cache: 'cache',
|
|
7
|
+
caseSensitive: 'caseSensitive',
|
|
8
|
+
description: 'description',
|
|
9
|
+
dictionaries: 'dictionaries',
|
|
10
|
+
dictionaryDefinitions: 'dictionaryDefinitions',
|
|
11
|
+
enabled: 'enabled',
|
|
12
|
+
enabledLanguageIds: 'enabledLanguageIds',
|
|
13
|
+
enableFiletypes: 'enableFiletypes',
|
|
14
|
+
enableGlobDot: 'enableGlobDot',
|
|
15
|
+
features: 'features',
|
|
16
|
+
files: 'files',
|
|
17
|
+
flagWords: 'flagWords',
|
|
18
|
+
gitignoreRoot: 'gitignoreRoot',
|
|
19
|
+
globRoot: 'globRoot',
|
|
20
|
+
ignorePaths: 'ignorePaths',
|
|
21
|
+
ignoreRegExpList: 'ignoreRegExpList',
|
|
22
|
+
ignoreWords: 'ignoreWords',
|
|
23
|
+
import: 'import',
|
|
24
|
+
includeRegExpList: 'includeRegExpList',
|
|
25
|
+
language: 'language',
|
|
26
|
+
languageId: 'languageId',
|
|
27
|
+
languageSettings: 'languageSettings',
|
|
28
|
+
maxDuplicateProblems: 'maxDuplicateProblems',
|
|
29
|
+
maxNumberOfProblems: 'maxNumberOfProblems',
|
|
30
|
+
minWordLength: 'minWordLength',
|
|
31
|
+
name: 'name',
|
|
32
|
+
noConfigSearch: 'noConfigSearch',
|
|
33
|
+
noSuggestDictionaries: 'noSuggestDictionaries',
|
|
34
|
+
numSuggestions: 'numSuggestions',
|
|
35
|
+
overrides: 'overrides',
|
|
36
|
+
patterns: 'patterns',
|
|
37
|
+
pnpFiles: 'pnpFiles',
|
|
38
|
+
readonly: 'readonly',
|
|
39
|
+
reporters: 'reporters',
|
|
40
|
+
showStatus: 'showStatus',
|
|
41
|
+
spellCheckDelayMs: 'spellCheckDelayMs',
|
|
42
|
+
suggestionNumChanges: 'suggestionNumChanges',
|
|
43
|
+
suggestionsTimeout: 'suggestionsTimeout',
|
|
44
|
+
useGitignore: 'useGitignore',
|
|
45
|
+
usePnP: 'usePnP',
|
|
46
|
+
userWords: 'userWords',
|
|
47
|
+
words: 'words',
|
|
48
|
+
};
|
|
49
|
+
// export const ConfigKeysNames = Object.values(ConfigKeysByField);
|
|
50
|
+
//# sourceMappingURL=configFields.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are experimental features and are subject to change or removal.
|
|
3
|
+
*/
|
|
4
|
+
export interface FeaturesExperimental {
|
|
5
|
+
/**
|
|
6
|
+
* Enable/disable using weighted suggestions.
|
|
7
|
+
*/
|
|
8
|
+
'weighted-suggestions': FeatureEnableOnly;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* These are the current set of active features
|
|
12
|
+
*/
|
|
13
|
+
export interface FeaturesActive {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* These are feature settings that have been deprecated or moved elsewhere they will have no
|
|
17
|
+
* effect on the code but are here to prevent schema errors. The will get cleaned out on major versions.
|
|
18
|
+
*/
|
|
19
|
+
export interface FeaturesDeprecated {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Features are behaviors or settings that can be explicitly configured.
|
|
23
|
+
*/
|
|
24
|
+
export interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {
|
|
25
|
+
}
|
|
26
|
+
export declare type Feature = FeatureEnableOnly | FeatureWithConfiguration;
|
|
27
|
+
export declare type FeatureEnableOnly = boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Feature Configuration.
|
|
30
|
+
*/
|
|
31
|
+
export interface FeatureWithConfiguration {
|
|
32
|
+
enable: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare type FeatureNamesKnown = keyof Features;
|
|
35
|
+
export declare type FeatureNamesExperimental = keyof FeaturesExperimental;
|
|
36
|
+
export declare type FeatureNamesActive = keyof FeaturesActive;
|
|
37
|
+
export declare type FeatureNamesDeprecated = keyof FeaturesDeprecated;
|
|
38
|
+
//# sourceMappingURL=features.d.ts.map
|
package/dist/features.js
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { ConfigFields } from './configFields';
|
|
2
|
+
export type { CSpellUserSettingsFields } from './configFields';
|
|
2
3
|
export * from './CSpellReporter';
|
|
3
|
-
export * from './
|
|
4
|
+
export * from './CSpellSettingsDef';
|
|
5
|
+
export type { SuggestionCostMapDef, SuggestionCostsDefs } from './suggestionCostsDef';
|
|
6
|
+
export type { TextDocumentOffset, TextOffset } from './TextOffset';
|
|
7
|
+
export type { Features, Feature } from './features';
|
|
4
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
13
|
+
exports.ConfigFields = void 0;
|
|
14
|
+
// Using old-style of `type` exports because the new style breaks some integrations.
|
|
15
|
+
var configFields_1 = require("./configFields");
|
|
16
|
+
Object.defineProperty(exports, "ConfigFields", { enumerable: true, get: function () { return configFields_1.ConfigFields; } });
|
|
14
17
|
__exportStar(require("./CSpellReporter"), exports);
|
|
15
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./CSpellSettingsDef"), exports);
|
|
16
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A WeightedMapDef enables setting weights for edits between related characters and substrings.
|
|
3
|
+
*
|
|
4
|
+
* Multiple groups can be defined using a `|`.
|
|
5
|
+
* A multi-character substring is defined using `()`.
|
|
6
|
+
*
|
|
7
|
+
* For example, in some languages, some letters sound alike.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* {
|
|
11
|
+
* map: 'sc(sh)(sch)(ss)|t(tt)', // two groups.
|
|
12
|
+
* replace: 50, // Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The following could be used to make inserting, removing, or replacing vowels cheaper.
|
|
17
|
+
* ```ts
|
|
18
|
+
* {
|
|
19
|
+
* map: 'aeiouy', //.
|
|
20
|
+
* insDel: 50, // Make it is cheaper to insert or delete a vowel.
|
|
21
|
+
* replace: 45, // It is even cheaper to replace one with another.
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Note: the default edit distance is 100.
|
|
26
|
+
*/
|
|
27
|
+
export declare type SuggestionCostMapDef = CostMapDefReplace | CostMapDefInsDel | CostMapDefSwap;
|
|
28
|
+
export declare type SuggestionCostsDefs = SuggestionCostMapDef[];
|
|
29
|
+
interface CostMapDefBase {
|
|
30
|
+
/**
|
|
31
|
+
* The set of substrings to map, these are generally single character strings.
|
|
32
|
+
*
|
|
33
|
+
* Multiple sets can be defined by using a `|` to separate them.
|
|
34
|
+
*
|
|
35
|
+
* Example: `"eéê|aåá"` contains two different sets.
|
|
36
|
+
*
|
|
37
|
+
* To add a multi-character substring use `()`.
|
|
38
|
+
*
|
|
39
|
+
* Example: `"f(ph)(gh)"` results in the following set: `f`, `ph`, `gh`.
|
|
40
|
+
*/
|
|
41
|
+
map: string;
|
|
42
|
+
/** The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. */
|
|
43
|
+
insDel?: number;
|
|
44
|
+
/**
|
|
45
|
+
* The cost to replace of of the substrings in the map with another substring in the map.
|
|
46
|
+
* Example: Map['a', 'i']
|
|
47
|
+
* This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.
|
|
48
|
+
*/
|
|
49
|
+
replace?: number;
|
|
50
|
+
/**
|
|
51
|
+
* The cost to swap two adjacent substrings found in the map.
|
|
52
|
+
* Example: Map['e', 'i']
|
|
53
|
+
* This represents the cost to change `ei` to `ie` or the reverse.
|
|
54
|
+
*/
|
|
55
|
+
swap?: number;
|
|
56
|
+
/**
|
|
57
|
+
* A description to describe the purpose of the map.
|
|
58
|
+
*/
|
|
59
|
+
description?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface CostMapDefReplace extends CostMapDefBase {
|
|
62
|
+
replace: number;
|
|
63
|
+
}
|
|
64
|
+
export interface CostMapDefInsDel extends CostMapDefBase {
|
|
65
|
+
insDel: number;
|
|
66
|
+
}
|
|
67
|
+
export interface CostMapDefSwap extends CostMapDefBase {
|
|
68
|
+
swap: number;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=suggestionCostsDef.d.ts.map
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.
|
|
6
|
+
"version": "5.15.3",
|
|
7
7
|
"description": "Types for cspell and cspell-lib",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"typings": "dist/index.d.ts",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"build-dev": "tsc -p tsconfig.dev.json",
|
|
20
20
|
"build-schema": "ts-json-schema-generator --no-top-ref --path src/CSpellSettingsDef.ts --type CSpellSettings --validation-keywords markdownDescription --validation-keywords scope --validation-keywords deprecated --validation-keywords deprecationMessage -o ./cspell.schema.json && cp ./cspell.schema.json ../..",
|
|
21
21
|
"build-docs": "typedoc --out ../../docs/types/cspell-types src/index.ts",
|
|
22
|
+
"test-build-docs": "typedoc --out ./temp/docs src/index.ts",
|
|
22
23
|
"clean-build": "npm run clean && npm run build",
|
|
23
24
|
"compile": "tsc -p .",
|
|
24
25
|
"test-schema": "ajv -s ./cspell.schema.json -d \"cspell.test.{json,yaml}\" -c ./ajv.config.js",
|
|
@@ -49,12 +50,12 @@
|
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"ajv-cli": "^5.0.0",
|
|
52
|
-
"jest": "^27.4.
|
|
53
|
+
"jest": "^27.4.7",
|
|
53
54
|
"rimraf": "^3.0.2",
|
|
54
55
|
"ts-json-schema-generator": "^0.97.0",
|
|
55
|
-
"typedoc": "
|
|
56
|
-
"typedoc-plugin-markdown": "^3.11.
|
|
56
|
+
"typedoc": "0.22.11",
|
|
57
|
+
"typedoc-plugin-markdown": "^3.11.12",
|
|
57
58
|
"typescript": "^4.5.4"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "8a7c55b7d0b340d3c4e964ba91390a405f2cda2d"
|
|
60
61
|
}
|