@cspell/cspell-types 5.16.0 → 5.17.0-alpha.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.
@@ -154,6 +154,9 @@
154
154
  {
155
155
  "$ref": "#/definitions/DictionaryDefinitionCustom"
156
156
  },
157
+ {
158
+ "$ref": "#/definitions/DictionaryDefinitionAugmented"
159
+ },
157
160
  {
158
161
  "$ref": "#/definitions/DictionaryDefinitionAlternate"
159
162
  }
@@ -187,10 +190,6 @@
187
190
  "$ref": "#/definitions/ReplaceMap",
188
191
  "description": "Replacement pairs."
189
192
  },
190
- "suggestionEditCosts": {
191
- "$ref": "#/definitions/SuggestionCostsDefs",
192
- "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`."
193
- },
194
193
  "type": {
195
194
  "$ref": "#/definitions/DictionaryFileTypes",
196
195
  "default": "S",
@@ -207,6 +206,49 @@
207
206
  ],
208
207
  "type": "object"
209
208
  },
209
+ "DictionaryDefinitionAugmented": {
210
+ "additionalProperties": false,
211
+ "description": "Used to provide extra data related to the dictionary",
212
+ "properties": {
213
+ "description": {
214
+ "description": "Optional description.",
215
+ "type": "string"
216
+ },
217
+ "dictionaryInformation": {
218
+ "$ref": "#/definitions/DictionaryInformation"
219
+ },
220
+ "name": {
221
+ "$ref": "#/definitions/DictionaryId",
222
+ "description": "This is the name of a dictionary.\n\nName Format:\n- Must contain at least 1 number or letter.\n- Spaces are allowed.\n- Leading and trailing space will be removed.\n- Names ARE case-sensitive.\n- Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`."
223
+ },
224
+ "noSuggest": {
225
+ "description": "Indicate that suggestions should not come from this dictionary. Words in this dictionary are considered correct, but will not be used when making spell correction suggestions.\n\nNote: if a word is suggested by another dictionary, but found in this dictionary, it will be removed from the set of possible suggestions.",
226
+ "type": "boolean"
227
+ },
228
+ "path": {
229
+ "$ref": "#/definitions/DictionaryPath",
230
+ "description": "Path to the file."
231
+ },
232
+ "repMap": {
233
+ "$ref": "#/definitions/ReplaceMap",
234
+ "description": "Replacement pairs."
235
+ },
236
+ "type": {
237
+ "$ref": "#/definitions/DictionaryFileTypes",
238
+ "default": "S",
239
+ "description": "Type of file: S - single word per line, W - each line can contain one or more words separated by space, C - each line is treated like code (Camel Case is allowed). Default is S. C is the slowest to load due to the need to split each line based upon code splitting rules."
240
+ },
241
+ "useCompounds": {
242
+ "description": "Use Compounds.",
243
+ "type": "boolean"
244
+ }
245
+ },
246
+ "required": [
247
+ "name",
248
+ "path"
249
+ ],
250
+ "type": "object"
251
+ },
210
252
  "DictionaryDefinitionCustom": {
211
253
  "additionalProperties": false,
212
254
  "description": "For Defining Custom dictionaries. They are generally scoped to a `user`, `workspace`, or `folder`. When `addWords` is true, indicates that the spell checker can add words to the file. Note: only plain text files with one word per line are supported at this moment.",
@@ -249,10 +291,6 @@
249
291
  ],
250
292
  "description": "Defines the scope for when words will be added to the dictionary. Scope values: `user`, `workspace`, `folder`."
251
293
  },
252
- "suggestionEditCosts": {
253
- "$ref": "#/definitions/SuggestionCostsDefs",
254
- "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`."
255
- },
256
294
  "type": {
257
295
  "$ref": "#/definitions/DictionaryFileTypes",
258
296
  "default": "S",
@@ -293,10 +331,6 @@
293
331
  "$ref": "#/definitions/ReplaceMap",
294
332
  "description": "Replacement pairs."
295
333
  },
296
- "suggestionEditCosts": {
297
- "$ref": "#/definitions/SuggestionCostsDefs",
298
- "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`."
299
- },
300
334
  "type": {
301
335
  "$ref": "#/definitions/DictionaryFileTypes",
302
336
  "default": "S",
@@ -327,6 +361,21 @@
327
361
  "pattern": "^(?=[^!*,;{}[\\]~\\n]+$)(?=(.*\\w)).+$",
328
362
  "type": "string"
329
363
  },
364
+ "DictionaryInformation": {
365
+ "additionalProperties": false,
366
+ "description": "Use by dictionary authors to help improve the quality of suggestions given from the dictionary.\n\nAdded with `v5.16.0`.",
367
+ "properties": {
368
+ "hunspellInformation": {
369
+ "$ref": "#/definitions/HunspellInformation",
370
+ "description": "Used by dictionary authors"
371
+ },
372
+ "suggestionEditCosts": {
373
+ "$ref": "#/definitions/SuggestionCostsDefs",
374
+ "description": "Used in making suggestions. The lower the value, the more likely the suggestion will be near the top of the suggestion list."
375
+ }
376
+ },
377
+ "type": "object"
378
+ },
330
379
  "DictionaryNegRef": {
331
380
  "description": "This a negative reference to a named dictionary.\n\nIt is used to exclude or include a dictionary by name.\n\nThe reference starts with 1 or more `!`.\n- `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.\n- `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`. Overrides `!<dictionary_name>`.\n- `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`. Overrides `!!<dictionary_name>`.",
332
381
  "pattern": "^(?=!+[^!*,;{}[\\]~\\n]+$)(?=(.*\\w)).+$",
@@ -378,6 +427,56 @@
378
427
  "$ref": "#/definitions/SimpleGlob",
379
428
  "description": "These are glob expressions."
380
429
  },
430
+ "HunspellInformation": {
431
+ "additionalProperties": false,
432
+ "properties": {
433
+ "aff": {
434
+ "description": "Selected Hunspell AFF content. The content must be UTF-8\n\nSections:\n- TRY\n- MAP\n- REP\n- KEY\n- ICONV\n- OCONV\n\nExample: ```hunspell # Comment TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ` MAP aàâäAÀÂÄ MAP eéèêëEÉÈÊË MAP iîïyIÎÏY MAP oôöOÔÖ MAP (IJ)(IJ) ```",
435
+ "type": "string"
436
+ },
437
+ "costs": {
438
+ "additionalProperties": false,
439
+ "description": "The costs to apply when using the hunspell settings",
440
+ "properties": {
441
+ "firstLetterPenalty": {
442
+ "default": 4,
443
+ "description": "The extra cost incurred for changing the first letter of a word. This value should be less than `100 - tryCharCost`.",
444
+ "type": "number"
445
+ },
446
+ "ioConvertCost": {
447
+ "default": 30,
448
+ "description": "The cost to convert between convert pairs.\n\nThe value should be slightly higher than the mapCost.",
449
+ "type": "number"
450
+ },
451
+ "keyboardCost": {
452
+ "default": 94,
453
+ "description": "The cost of replacing or swapping any adjacent keyboard characters.\n\nThis should be slightly cheaper than `tryCharCost`.",
454
+ "type": "number"
455
+ },
456
+ "mapCost": {
457
+ "default": 25,
458
+ "description": "mapSet replacement cost is the cost to substitute one character with another from the same set.\n\nMap characters are considered very similar to each other and are often the cause of simple mistakes.",
459
+ "type": "number"
460
+ },
461
+ "replaceCosts": {
462
+ "default": 75,
463
+ "description": "The cost to substitute pairs found in the replace settings.",
464
+ "type": "number"
465
+ },
466
+ "tryCharCost": {
467
+ "default": 95,
468
+ "description": "The cost of inserting / deleting / or swapping any `tryChars`",
469
+ "type": "number"
470
+ }
471
+ },
472
+ "type": "object"
473
+ }
474
+ },
475
+ "required": [
476
+ "aff"
477
+ ],
478
+ "type": "object"
479
+ },
381
480
  "LanguageId": {
382
481
  "anyOf": [
383
482
  {
@@ -976,6 +1075,11 @@
976
1075
  },
977
1076
  "type": "array"
978
1077
  },
1078
+ "failFast": {
1079
+ "default": false,
1080
+ "description": "Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)",
1081
+ "type": "boolean"
1082
+ },
979
1083
  "features": {
980
1084
  "$ref": "#/definitions/Features",
981
1085
  "description": "Configure CSpell features.\n\n- Added with `v5.16.0`."
@@ -1,5 +1,5 @@
1
- import { Features } from './features';
2
- import type { SuggestionCostsDefs } from './suggestionCostsDef';
1
+ import type { DictionaryInformation } from './DictionaryInformation';
2
+ import type { Features } from './features';
3
3
  export declare type ReplaceEntry = [string, string];
4
4
  export declare type ReplaceMap = ReplaceEntry[];
5
5
  /**
@@ -227,6 +227,11 @@ export interface CommandLineSettings {
227
227
  * Define cache settings.
228
228
  */
229
229
  cache?: CacheSettings;
230
+ /**
231
+ * Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
232
+ * @default false
233
+ */
234
+ failFast?: boolean;
230
235
  }
231
236
  /**
232
237
  * To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
@@ -346,7 +351,7 @@ export interface BaseSetting {
346
351
  patterns?: RegExpPatternDefinition[];
347
352
  }
348
353
  export declare type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
349
- export declare type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
354
+ export declare type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
350
355
  export interface DictionaryDefinitionBase {
351
356
  /**
352
357
  * This is the name of a dictionary.
@@ -385,13 +390,6 @@ export interface DictionaryDefinitionBase {
385
390
  * @default "S"
386
391
  */
387
392
  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;
395
393
  }
396
394
  export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
397
395
  /** Path to the file. */
@@ -404,6 +402,12 @@ export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase
404
402
  */
405
403
  file?: undefined;
406
404
  }
405
+ /**
406
+ * Used to provide extra data related to the dictionary
407
+ */
408
+ export interface DictionaryDefinitionAugmented extends DictionaryDefinitionPreferred {
409
+ dictionaryInformation?: DictionaryInformation;
410
+ }
407
411
  /**
408
412
  * Only for legacy dictionary definitions.
409
413
  * @deprecated true
@@ -418,6 +422,8 @@ export interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase
418
422
  * @deprecationMessage Use `path` instead.
419
423
  */
420
424
  file: DictionaryPath;
425
+ /** @hidden */
426
+ suggestionEditCosts?: undefined;
421
427
  }
422
428
  /**
423
429
  * @deprecated true
@@ -442,6 +448,10 @@ export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
442
448
  * @default "S"
443
449
  */
444
450
  type?: DictionaryFileTypes;
451
+ /**
452
+ * @hidden
453
+ */
454
+ suggestionEditCosts?: undefined;
445
455
  }
446
456
  /**
447
457
  * Specifies the scope of a dictionary.
@@ -0,0 +1,217 @@
1
+ import { SuggestionCostsDefs } from '.';
2
+ /**
3
+ * Use by dictionary authors to help improve the quality of suggestions
4
+ * given from the dictionary.
5
+ *
6
+ * Added with `v5.16.0`.
7
+ */
8
+ export interface DictionaryInformation {
9
+ /**
10
+ * Used in making suggestions. The lower the value, the more likely the suggestion
11
+ * will be near the top of the suggestion list.
12
+ */
13
+ suggestionEditCosts?: SuggestionCostsDefs | undefined;
14
+ /**
15
+ * Used by dictionary authors
16
+ */
17
+ hunspellInformation?: HunspellInformation;
18
+ }
19
+ export interface HunspellInformationParsed {
20
+ /**
21
+ * This is generally the alphabet used in the dictionary.
22
+ * It stands for the characters to try using for substitutions
23
+ * when looking for a suggestions.
24
+ *
25
+ * Example:
26
+ * - Hunspell:
27
+ * ```hunspell
28
+ * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
29
+ * ```
30
+ * - Use: yaml
31
+ * ```yaml
32
+ * tryChars: "aeistlunkodmrvpgjhäõbüoöfcwzxðqþ"
33
+ * ```
34
+ * <!--- cspell:ignore aeistlunkodmrvpgjhäõbüoöfcwzxðqþ --
35
+ */
36
+ tryChars?: string;
37
+ /**
38
+ * This defines characters that are good substitutes for each other.
39
+ * - A `()` is need for multi character sequences like letters with multiple accents.
40
+ * - Separate unrelated characters with `|` or `\n`
41
+ *
42
+ * Example:
43
+ * - Hunspell:
44
+ * ```hunspell
45
+ * MAP aàâäAÀÂÄ
46
+ * MAP eéèêëEÉÈÊË
47
+ * MAP iîïyIÎÏY
48
+ * MAP oôöOÔÖ
49
+ * MAP (IJ)(IJ)
50
+ * ```
51
+ * - Use:
52
+ * `yaml`
53
+ * ```yaml
54
+ * mapSets: |
55
+ * aàâäAÀÂÄ|eéèêëEÉÈÊË`
56
+ * eéèêëEÉÈÊË|iîïyIÎÏY
57
+ * oôöOÔÖ|(IJ)(IJ)
58
+ * ```
59
+ * <!--- cspell:ignore aàâä eéèêë iîïy -->
60
+ */
61
+ mapSets?: string | string[];
62
+ /**
63
+ * This represents the layout of a common keyboard.
64
+ * Used for adjacency mistakes.
65
+ *
66
+ * Hunspell:
67
+ * ```hunspell
68
+ * KEY qwertyuiop|asdfghjkl|zxcvbnm
69
+ * ```
70
+ * Use:
71
+ * ```yaml
72
+ * keyboard: qwertyuiop|asdfghjkl|zxcvbnm
73
+ * ```
74
+ * <!--- cspell:ignore asdfghjkl qwertyuiop zxcvbnm -->
75
+ */
76
+ keyboard?: string;
77
+ /**
78
+ * Output Conversions
79
+ *
80
+ */
81
+ outConvert?: string | string[];
82
+ inConvert?: string | string[];
83
+ /**
84
+ * Common Substitutions.
85
+ * Special characters:
86
+ * - `^` - matches the beginning of a word.
87
+ * - `$` - matches the end of a word.
88
+ *
89
+ * Hunspell:
90
+ * ```hunspell
91
+ * REP c ss
92
+ * REP e ij
93
+ * REP é ee
94
+ * REP g ch
95
+ * REP ï ii
96
+ * REP t d # gebiest=>gebiesd
97
+ * REP u ij
98
+ * ```
99
+ *
100
+ * Use:
101
+ * ```yaml
102
+ * replace: |
103
+ * c ss
104
+ * e ij
105
+ * é ee
106
+ * g ch
107
+ * ï ii
108
+ * t d
109
+ * u ij
110
+ * ```
111
+ *
112
+ * <!--- cspell:ignore gebiesd gebiest -->
113
+ */
114
+ replace?: string | string[];
115
+ /** The costs to apply when using the hunspell settings */
116
+ costs?: HunspellCosts;
117
+ }
118
+ export interface HunspellInformation {
119
+ /**
120
+ * Selected Hunspell AFF content.
121
+ * The content must be UTF-8
122
+ *
123
+ * Sections:
124
+ * - TRY
125
+ * - MAP
126
+ * - REP
127
+ * - KEY
128
+ * - ICONV
129
+ * - OCONV
130
+ *
131
+ * Example:
132
+ * ```hunspell
133
+ * # Comment
134
+ * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
135
+ * MAP aàâäAÀÂÄ
136
+ * MAP eéèêëEÉÈÊË
137
+ * MAP iîïyIÎÏY
138
+ * MAP oôöOÔÖ
139
+ * MAP (IJ)(IJ)
140
+ * ```
141
+ */
142
+ aff: HunspellAffContent;
143
+ /** The costs to apply when using the hunspell settings */
144
+ costs?: HunspellCosts;
145
+ }
146
+ /**
147
+ * Selected Hunspell AFF content.
148
+ * The content must be UTF-8
149
+ *
150
+ * Sections:
151
+ * - TRY
152
+ * - NO-TRY
153
+ * - MAP
154
+ * - REP
155
+ * - KEY
156
+ * - ICONV
157
+ * - OCONV
158
+ *
159
+ * Example:
160
+ * ```hunspell
161
+ * # Comment
162
+ * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
163
+ * NO-TRY -0123456789 # Discourage adding numbers and dashes.
164
+ * MAP aàâäAÀÂÄ
165
+ * MAP eéèêëEÉÈÊË
166
+ * MAP iîïyIÎÏY
167
+ * MAP oôöOÔÖ
168
+ * MAP (IJ)(IJ)
169
+ * ```
170
+ */
171
+ declare type HunspellAffContent = string;
172
+ interface HunspellCosts {
173
+ /**
174
+ * The cost of inserting / deleting / or swapping any `tryChars`
175
+ * @default 95
176
+ */
177
+ tryCharCost?: number;
178
+ /**
179
+ * The extra cost incurred for changing the first letter of a word.
180
+ * This value should be less than `100 - tryCharCost`.
181
+ * @default 4
182
+ */
183
+ firstLetterPenalty?: number;
184
+ /**
185
+ * The cost of replacing or swapping any adjacent keyboard characters.
186
+ *
187
+ * This should be slightly cheaper than `tryCharCost`.
188
+ * @default 94
189
+ */
190
+ keyboardCost?: number;
191
+ /**
192
+ * mapSet replacement cost is the cost to substitute one character with another from
193
+ * the same set.
194
+ *
195
+ * Map characters are considered very similar to each other and are often
196
+ * the cause of simple mistakes.
197
+ *
198
+ * @default 25
199
+ */
200
+ mapCost?: number;
201
+ /**
202
+ * The cost to convert between convert pairs.
203
+ *
204
+ * The value should be slightly higher than the mapCost.
205
+ *
206
+ * @default 30
207
+ */
208
+ ioConvertCost?: number;
209
+ /**
210
+ * The cost to substitute pairs found in the replace settings.
211
+ *
212
+ * @default 75
213
+ */
214
+ replaceCosts?: number;
215
+ }
216
+ export {};
217
+ //# sourceMappingURL=DictionaryInformation.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DictionaryInformation.js.map
@@ -12,6 +12,7 @@ exports.ConfigFields = {
12
12
  enabledLanguageIds: 'enabledLanguageIds',
13
13
  enableFiletypes: 'enableFiletypes',
14
14
  enableGlobDot: 'enableGlobDot',
15
+ failFast: 'failFast',
15
16
  features: 'features',
16
17
  files: 'files',
17
18
  flagWords: 'flagWords',
@@ -1,5 +1,5 @@
1
1
  /**
2
- * These are experimental features and are subject to change or removal.
2
+ * These are experimental features and are subject to change or removal without notice.
3
3
  */
4
4
  export interface FeaturesExperimental {
5
5
  /**
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "5.16.0",
6
+ "version": "5.17.0-alpha.0",
7
7
  "description": "Types for cspell and cspell-lib",
8
8
  "main": "dist/index.js",
9
9
  "typings": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "build": "npm run compile && npm run build-schema",
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
- "build-docs": "typedoc --out ../../docs/types/cspell-types src/index.ts",
21
+ "build-docs": "rimraf ../../docs/types/cspell-types && typedoc --out ../../docs/types/cspell-types src/index.ts",
22
22
  "test-build-docs": "typedoc --out ./temp/docs src/index.ts",
23
23
  "clean-build": "npm run clean && npm run build",
24
24
  "compile": "tsc -p .",
@@ -55,7 +55,7 @@
55
55
  "ts-json-schema-generator": "^0.97.0",
56
56
  "typedoc": "0.22.11",
57
57
  "typedoc-plugin-markdown": "^3.11.12",
58
- "typescript": "^4.5.4"
58
+ "typescript": "^4.5.5"
59
59
  },
60
- "gitHead": "c5d994f58bdb48c4d16f1708607b28c8a7b52a65"
60
+ "gitHead": "d884218703cac72186fd69e8ba1e9eb78558c7ca"
61
61
  }