@cspell/cspell-types 9.0.2 → 9.1.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/dist/index.d.ts CHANGED
@@ -1,1414 +1,1554 @@
1
- import { ParserName, Parser } from './Parser/index.js';
2
- export { ParseResult, ParsedText, ParserOptions } from './Parser/index.js';
1
+ import { ParseResult, ParsedText, Parser, ParserName, ParserOptions } from "./index-CY-3Hv0u.js";
3
2
 
3
+ //#region src/SuggestionsConfiguration.d.ts
4
+ interface SuggestionsConfiguration {
5
+ /**
6
+ * Number of suggestions to make.
7
+ *
8
+ * @default 10
9
+ */
10
+ numSuggestions?: number;
11
+ /**
12
+ * The maximum amount of time in milliseconds to generate suggestions for a word.
13
+ *
14
+ * @default 500
15
+ */
16
+ suggestionsTimeout?: number;
17
+ /**
18
+ * The maximum number of changes allowed on a word to be considered a suggestions.
19
+ *
20
+ * For example, appending an `s` onto `example` -> `examples` is considered 1 change.
21
+ *
22
+ * Range: between 1 and 5.
23
+ *
24
+ * @default 3
25
+ */
26
+ suggestionNumChanges?: number;
27
+ }
28
+ //#endregion
29
+ //#region src/TextOffset.d.ts
4
30
  interface TextOffset {
5
- /**
6
- * The text found at the offset. If the text has been transformed, then the length might not match `length`.
7
- * Example: Original: `cafe\u0301`, text: `café`
8
- */
9
- text: string;
10
- /**
11
- * The offset into the document.
12
- */
13
- offset: number;
14
- /**
15
- * Assumed to match `text.length` if the text has not been transformed.
16
- */
17
- length?: number;
31
+ /**
32
+ * The text found at the offset. If the text has been transformed, then the length might not match `length`.
33
+ * Example: Original: `cafe\u0301`, text: `café`
34
+ */
35
+ text: string;
36
+ /**
37
+ * The offset into the document.
38
+ */
39
+ offset: number;
40
+ /**
41
+ * Assumed to match `text.length` if the text has not been transformed.
42
+ */
43
+ length?: number;
18
44
  }
19
45
  interface TextDocumentOffset extends TextOffset {
20
- uri?: string;
21
- doc: string;
22
- row: number;
23
- col: number;
24
- line: TextOffset;
25
- }
26
-
46
+ uri?: string;
47
+ doc: string;
48
+ row: number;
49
+ col: number;
50
+ line: TextOffset;
51
+ }
52
+ //#endregion
53
+ //#region src/CSpellReporter.d.ts
27
54
  interface Suggestion {
28
- /**
29
- * Word to suggest.
30
- */
31
- word: string;
32
- /**
33
- * The suggested word adjusted to match the original case.
34
- */
35
- wordAdjustedToMatchCase?: string;
36
- /**
37
- * `true` - if this suggestion can be an automatic fix.
38
- */
39
- isPreferred?: boolean;
40
- }
41
- interface Issue extends Omit<TextDocumentOffset, 'doc'> {
42
- /** text surrounding the issue text */
43
- context: TextOffset;
44
- /**
45
- * true if the issue has been flagged as a forbidden word.
46
- */
47
- isFlagged?: boolean;
48
- /**
49
- * An optional array of replacement strings.
50
- */
51
- suggestions?: string[];
52
- /**
53
- * An optional array of suggestions.
54
- */
55
- suggestionsEx?: Suggestion[];
56
- /**
57
- * Issues are spelling issues unless otherwise specified.
58
- */
59
- issueType?: IssueType;
60
- /**
61
- * Optional message to show.
62
- */
63
- message?: string;
55
+ /**
56
+ * Word to suggest.
57
+ */
58
+ word: string;
59
+ /**
60
+ * The suggested word adjusted to match the original case.
61
+ */
62
+ wordAdjustedToMatchCase?: string;
63
+ /**
64
+ * `true` - if this suggestion can be an automatic fix.
65
+ */
66
+ isPreferred?: boolean;
67
+ }
68
+ interface Issue extends Omit<TextDocumentOffset, "doc"> {
69
+ /**
70
+ * The text surrounding the issue text. It is only included if the reporter cannot generated it automatically.
71
+ */
72
+ context?: TextOffset | undefined;
73
+ /**
74
+ * true if the issue has been flagged as a forbidden word.
75
+ */
76
+ isFlagged?: boolean | undefined;
77
+ /**
78
+ * An optional array of replacement strings.
79
+ */
80
+ suggestions?: string[] | undefined;
81
+ /**
82
+ * An optional array of suggestions.
83
+ */
84
+ suggestionsEx?: Suggestion[] | undefined;
85
+ /**
86
+ * Issues are spelling issues unless otherwise specified.
87
+ */
88
+ issueType?: IssueType | undefined;
89
+ /**
90
+ * Optional message to show.
91
+ */
92
+ message?: string | undefined;
93
+ /**
94
+ * `true` - if it has been determined if simple suggestions are available.
95
+ * `false` - if simple suggestions are NOT available.
96
+ * `undefined` - if it has not been determined.
97
+ * @since 9.1.0
98
+ */
99
+ hasSimpleSuggestions?: boolean | undefined;
100
+ /**
101
+ * This setting is used for common typo detection.
102
+ * - `true` - if it has been determined if preferred suggestions are available.
103
+ * - `false` - if preferred suggestions are NOT available.
104
+ * - `undefined` - if it has not been determined.
105
+ * @since 9.1.0
106
+ */
107
+ hasPreferredSuggestions?: boolean | undefined;
64
108
  }
65
109
  declare enum IssueType {
66
- spelling = 0,
67
- directive = 1
110
+ spelling = 0,
111
+ directive = 1,
68
112
  }
69
- type MessageType = 'Debug' | 'Info' | 'Warning';
70
- type MessageTypeLookup = {
71
- [key in MessageType]: key;
72
- };
113
+ type MessageType = "Debug" | "Info" | "Warning";
114
+ type MessageTypeLookup = { [key in MessageType]: key };
73
115
  declare const MessageTypes: MessageTypeLookup;
74
116
  type MessageEmitter = (message: string, msgType: MessageType) => void;
75
117
  type DebugEmitter = (message: string) => void;
76
118
  type ErrorLike = Error | {
77
- message: string;
78
- name: string;
79
- toString: () => string;
119
+ message: string;
120
+ name: string;
121
+ toString: () => string;
80
122
  };
81
123
  type ErrorEmitter = (message: string, error: ErrorLike) => void;
82
- type SpellingErrorEmitter = (issue: Issue) => void;
83
- type ProgressTypes = 'ProgressFileBegin' | 'ProgressFileComplete';
124
+ type SpellingErrorEmitter = (issue: Issue, options?: ReportIssueOptions) => void;
125
+ type ProgressTypes = "ProgressFileBegin" | "ProgressFileComplete";
84
126
  type ProgressItem = ProgressFileBegin | ProgressFileComplete;
85
127
  interface ProgressBase {
86
- type: ProgressTypes;
128
+ type: ProgressTypes;
87
129
  }
88
130
  interface ProgressFileBase extends ProgressBase {
89
- type: ProgressTypes;
90
- fileNum: number;
91
- fileCount: number;
92
- filename: string;
131
+ type: ProgressTypes;
132
+ /**
133
+ * The sequence number of the file being processed.
134
+ */
135
+ fileNum: number;
136
+ /**
137
+ * The total number of files being processed.
138
+ */
139
+ fileCount: number;
140
+ /**
141
+ * The file name or href of file being processed.
142
+ */
143
+ filename: string;
93
144
  }
94
145
  interface ProgressFileComplete extends ProgressFileBase {
95
- type: 'ProgressFileComplete';
96
- elapsedTimeMs: number | undefined;
97
- processed: boolean | undefined;
98
- numErrors: number | undefined;
99
- cached?: boolean;
146
+ type: "ProgressFileComplete";
147
+ /**
148
+ * The time it took to process the file in milliseconds.
149
+ * If `undefined`, then the elapsed time is not available.
150
+ */
151
+ elapsedTimeMs: number | undefined;
152
+ /**
153
+ * `true` if the file was processed.
154
+ * `false` if the file was skipped.
155
+ */
156
+ processed: boolean | undefined;
157
+ /**
158
+ * Number of errors and issues found in the file.
159
+ */
160
+ numErrors: number | undefined;
161
+ /**
162
+ * `true` if the file was processed from the cache.
163
+ */
164
+ cached?: boolean;
165
+ /**
166
+ * Issues found in the file.
167
+ * If `undefined`, then the issues are not available.
168
+ */
169
+ issues?: Iterable<Issue> | undefined;
170
+ /**
171
+ * reportIssuesOptions to be used when reporting issues.
172
+ */
173
+ reportIssueOptions?: ReportIssueOptions | undefined;
100
174
  }
101
175
  /**
102
- * Notification sent just before processing a file.
103
- */
176
+ * Notification sent just before processing a file.
177
+ */
104
178
  interface ProgressFileBegin extends ProgressFileBase {
105
- type: 'ProgressFileBegin';
179
+ type: "ProgressFileBegin";
106
180
  }
107
181
  type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
108
182
  interface RunResult {
109
- /** Number of files processed. */
110
- files: number;
111
- /** Set of files where issues were found. */
112
- filesWithIssues: Set<string>;
113
- /** Number of issues found. */
114
- issues: number;
115
- /** Number of processing errors. */
116
- errors: number;
117
- /** Number files that used results from the cache. */
118
- cachedFiles?: number;
183
+ /** Number of files processed. */
184
+ files: number;
185
+ /** Set of files where issues were found. */
186
+ filesWithIssues: Set<string>;
187
+ /** Number of issues found. */
188
+ issues: number;
189
+ /** Number of processing errors. */
190
+ errors: number;
191
+ /** Number files that used results from the cache. */
192
+ cachedFiles?: number;
119
193
  }
120
194
  type ResultEmitter = (result: RunResult) => void | Promise<void>;
121
- interface CSpellReporter {
122
- issue?: SpellingErrorEmitter;
123
- info?: MessageEmitter;
124
- debug?: DebugEmitter;
125
- error?: ErrorEmitter;
126
- progress?: ProgressEmitter;
127
- result?: ResultEmitter;
195
+ interface CSpellReporterEmitters {
196
+ issue?: SpellingErrorEmitter;
197
+ info?: MessageEmitter;
198
+ debug?: DebugEmitter;
199
+ error?: ErrorEmitter;
200
+ progress?: ProgressEmitter;
201
+ result?: ResultEmitter;
202
+ }
203
+ interface CSpellReporter extends CSpellReporterEmitters {
204
+ /**
205
+ * Allows the reporter to specify supported features.
206
+ * @since 9.1.0
207
+ */
208
+ features?: FeaturesSupportedByReporter | undefined;
128
209
  }
129
210
  interface ReporterConfigurationBase {
130
- /**
131
- * The maximum number of problems to report in a file.
132
- *
133
- * @default 10000
134
- */
135
- maxNumberOfProblems?: number;
136
- /**
137
- * The maximum number of times the same word can be flagged as an error in a file.
138
- *
139
- * @default 5
140
- */
141
- maxDuplicateProblems?: number;
142
- /**
143
- * The minimum length of a word before checking it against a dictionary.
144
- *
145
- * @default 4
146
- */
147
- minWordLength?: number;
148
- /**
149
- * Ignore sequences of characters that look like random strings.
150
- *
151
- * @default true
152
- */
153
- ignoreRandomStrings?: boolean;
154
- /**
155
- * The minimum length of a random string to be ignored.
156
- *
157
- * @default 40
158
- */
159
- minRandomLength?: number;
211
+ /**
212
+ * The maximum number of problems to report in a file.
213
+ *
214
+ * @default 10000
215
+ */
216
+ maxNumberOfProblems?: number;
217
+ /**
218
+ * The maximum number of times the same word can be flagged as an error in a file.
219
+ *
220
+ * @default 5
221
+ */
222
+ maxDuplicateProblems?: number;
223
+ /**
224
+ * The minimum length of a word before checking it against a dictionary.
225
+ *
226
+ * @default 4
227
+ */
228
+ minWordLength?: number;
229
+ /**
230
+ * Ignore sequences of characters that look like random strings.
231
+ *
232
+ * @default true
233
+ */
234
+ ignoreRandomStrings?: boolean | undefined;
235
+ /**
236
+ * The minimum length of a random string to be ignored.
237
+ *
238
+ * @default 40
239
+ */
240
+ minRandomLength?: number | undefined;
160
241
  }
161
242
  interface ReporterCommandLineOptions {
162
- /**
163
- * Display verbose information
164
- */
165
- verbose?: boolean;
166
- /**
167
- * Show extensive output.
168
- */
169
- debug?: boolean;
170
- /**
171
- * Only report the words, no line numbers or file names.
172
- */
173
- wordsOnly?: boolean;
174
- /**
175
- * unique errors per file only.
176
- */
177
- unique?: boolean;
178
- /**
179
- * root directory, defaults to `cwd`
180
- */
181
- root?: string;
182
- }
183
- interface ReporterConfiguration extends ReporterCommandLineOptions, ReporterConfigurationBase {
184
- }
243
+ /**
244
+ * Display verbose information
245
+ */
246
+ verbose?: boolean;
247
+ /**
248
+ * Show extensive output.
249
+ */
250
+ debug?: boolean;
251
+ /**
252
+ * Only report the words, no line numbers or file names.
253
+ */
254
+ wordsOnly?: boolean;
255
+ /**
256
+ * unique errors per file only.
257
+ */
258
+ unique?: boolean;
259
+ /**
260
+ * root directory, defaults to `cwd`
261
+ */
262
+ root?: string;
263
+ }
264
+ interface ReporterConfiguration extends ReporterCommandLineOptions, ReporterConfigurationBase {}
185
265
  interface CSpellReporterModule {
186
- getReporter: (settings: unknown, config: ReporterConfiguration) => CSpellReporter;
266
+ getReporter: (settings: unknown, config: ReporterConfiguration) => CSpellReporter;
187
267
  }
188
-
189
268
  /**
190
- * A WeightedMapDef enables setting weights for edits between related characters and substrings.
191
- *
192
- * Multiple groups can be defined using a `|`.
193
- * A multi-character substring is defined using `()`.
194
- *
195
- * For example, in some languages, some letters sound alike.
196
- *
197
- * ```yaml
198
- * map: 'sc(sh)(sch)(ss)|t(tt)' # two groups.
199
- * replace: 50 # Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.
200
- * ```
201
- *
202
- * The following could be used to make inserting, removing, or replacing vowels cheaper.
203
- * ```yaml
204
- * map: 'aeiouy'
205
- * insDel: 50 # Make it is cheaper to insert or delete a vowel.
206
- * replace: 45 # It is even cheaper to replace one with another.
207
- * ```
208
- *
209
- * Note: the default edit distance is 100.
210
- */
269
+ * Allows the reporter to advertise which features it supports.
270
+ */
271
+ interface FeaturesSupportedByReporter {
272
+ /**
273
+ * The reporter supports the {@link ReportingConfiguration.unknownWords} option and understands
274
+ * how to filter issues based upon {@link Issue.isFlagged}, {@link Issue.hasSimpleSuggestions} and {@link Issue.hasPreferredSuggestions}.
275
+ * - `true` - The `reporter.issue` method will be called for all spelling issues and it is expected to handle .
276
+ * - `false | undefined` - the unknown words will be filtered out based upon the `unknownWords` setting before being passed to the reporter.
277
+ */
278
+ unknownWords?: boolean | undefined;
279
+ /**
280
+ * The reporter supports the {@link Issue.issueType} option.
281
+ * - `true` - the reporter will be called with all issues types.
282
+ * - `false | undefined` - only {@link IssueType.spelling} issues will be passed to the reporter.
283
+ */
284
+ issueType?: boolean | undefined;
285
+ /**
286
+ * The reporter can generate context for issues.
287
+ * - `true` - the reporter will be called with issues that do NOT have a `context` property.
288
+ * - `false | undefined` - the reporter will be called with issues that have a `context` property.
289
+ */
290
+ contextGeneration?: boolean | undefined;
291
+ }
292
+ interface ReportingConfiguration extends ReporterConfigurationBase, SuggestionsConfiguration, UnknownWordsConfiguration {}
293
+ interface ReportIssueOptions extends UnknownWordsConfiguration {
294
+ /**
295
+ * Verify that the in-document directives are correct.
296
+ */
297
+ validateDirectives?: boolean | undefined;
298
+ /**
299
+ * Tells the spell checker to show context around the issue.
300
+ * It is the number of characters to show on either side of the issue.
301
+ */
302
+ showContext?: number | undefined;
303
+ }
304
+ /**
305
+ * Possible choices for how to handle unknown words.
306
+ */
307
+ type UnknownWordsChoices = "report-all" | "report-simple" | "report-common-typos" | "report-flagged";
308
+ declare const unknownWordsChoices: {
309
+ readonly ReportAll: "report-all";
310
+ readonly ReportSimple: "report-simple";
311
+ readonly ReportCommonTypos: "report-common-typos";
312
+ readonly ReportFlagged: "report-flagged";
313
+ };
314
+ interface UnknownWordsConfiguration {
315
+ /**
316
+ * Controls how unknown words are handled.
317
+ *
318
+ * - `report-all` - Report all unknown words (default behavior)
319
+ * - `report-simple` - Report unknown words that have simple spelling errors, typos, and flagged words.
320
+ * - `report-common-typos` - Report unknown words that are common typos and flagged words.
321
+ * - `report-flagged` - Report unknown words that are flagged.
322
+ *
323
+ * @default "report-all"
324
+ * @since 9.1.0
325
+ */
326
+ unknownWords?: UnknownWordsChoices | undefined;
327
+ }
328
+ //#endregion
329
+ //#region src/suggestionCostsDef.d.ts
330
+ // cspell:ignore aeiouy
331
+ /**
332
+ * A WeightedMapDef enables setting weights for edits between related characters and substrings.
333
+ *
334
+ * Multiple groups can be defined using a `|`.
335
+ * A multi-character substring is defined using `()`.
336
+ *
337
+ * For example, in some languages, some letters sound alike.
338
+ *
339
+ * ```yaml
340
+ * map: 'sc(sh)(sch)(ss)|t(tt)' # two groups.
341
+ * replace: 50 # Make it 1/2 the cost of a normal edit to replace a `t` with `tt`.
342
+ * ```
343
+ *
344
+ * The following could be used to make inserting, removing, or replacing vowels cheaper.
345
+ * ```yaml
346
+ * map: 'aeiouy'
347
+ * insDel: 50 # Make it is cheaper to insert or delete a vowel.
348
+ * replace: 45 # It is even cheaper to replace one with another.
349
+ * ```
350
+ *
351
+ * Note: the default edit distance is 100.
352
+ */
211
353
  type SuggestionCostMapDef = CostMapDefReplace | CostMapDefInsDel | CostMapDefSwap;
212
354
  type SuggestionCostsDefs = SuggestionCostMapDef[];
213
355
  interface CostMapDefBase {
214
- /**
215
- * The set of substrings to map, these are generally single character strings.
216
- *
217
- * Multiple sets can be defined by using a `|` to separate them.
218
- *
219
- * Example: `"eéê|aåá"` contains two different sets.
220
- *
221
- * To add a multi-character substring use `()`.
222
- *
223
- * Example: `"f(ph)(gh)"` results in the following set: `f`, `ph`, `gh`.
224
- *
225
- * - To match the beginning of a word, use `^`: `"(^I)""`.
226
- * - To match the end of a word, use `$`: `"(e$)(ing$)"`.
227
- *
228
- */
229
- map: string;
230
- /** The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. */
231
- insDel?: number;
232
- /**
233
- * The cost to replace of of the substrings in the map with another substring in the map.
234
- * Example: Map['a', 'i']
235
- * This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.
236
- */
237
- replace?: number;
238
- /**
239
- * The cost to swap two adjacent substrings found in the map.
240
- * Example: Map['e', 'i']
241
- * This represents the cost to change `ei` to `ie` or the reverse.
242
- */
243
- swap?: number;
244
- /**
245
- * A description to describe the purpose of the map.
246
- */
247
- description?: string;
248
- /**
249
- * Add a penalty to the final cost.
250
- * This is used to discourage certain suggestions.
251
- *
252
- * Example:
253
- * ```yaml
254
- * # Match adding/removing `-` to the end of a word.
255
- * map: "$(-$)"
256
- * replace: 50
257
- * penalty: 100
258
- * ```
259
- *
260
- * This makes adding a `-` to the end of a word more expensive.
261
- *
262
- * Think of it as taking the toll way for speed but getting the bill later.
263
- */
264
- penalty?: number;
356
+ /**
357
+ * The set of substrings to map, these are generally single character strings.
358
+ *
359
+ * Multiple sets can be defined by using a `|` to separate them.
360
+ *
361
+ * Example: `"eéê|aåá"` contains two different sets.
362
+ *
363
+ * To add a multi-character substring use `()`.
364
+ *
365
+ * Example: `"f(ph)(gh)"` results in the following set: `f`, `ph`, `gh`.
366
+ *
367
+ * - To match the beginning of a word, use `^`: `"(^I)""`.
368
+ * - To match the end of a word, use `$`: `"(e$)(ing$)"`.
369
+ *
370
+ */
371
+ map: string;
372
+ /** The cost to insert/delete one of the substrings in the map. Note: insert/delete costs are symmetrical. */
373
+ insDel?: number;
374
+ /**
375
+ * The cost to replace of of the substrings in the map with another substring in the map.
376
+ * Example: Map['a', 'i']
377
+ * This would be the cost to substitute `a` with `i`: Like `bat` to `bit` or the reverse.
378
+ */
379
+ replace?: number;
380
+ /**
381
+ * The cost to swap two adjacent substrings found in the map.
382
+ * Example: Map['e', 'i']
383
+ * This represents the cost to change `ei` to `ie` or the reverse.
384
+ */
385
+ swap?: number;
386
+ /**
387
+ * A description to describe the purpose of the map.
388
+ */
389
+ description?: string;
390
+ /**
391
+ * Add a penalty to the final cost.
392
+ * This is used to discourage certain suggestions.
393
+ *
394
+ * Example:
395
+ * ```yaml
396
+ * # Match adding/removing `-` to the end of a word.
397
+ * map: "$(-$)"
398
+ * replace: 50
399
+ * penalty: 100
400
+ * ```
401
+ *
402
+ * This makes adding a `-` to the end of a word more expensive.
403
+ *
404
+ * Think of it as taking the toll way for speed but getting the bill later.
405
+ */
406
+ penalty?: number;
265
407
  }
266
408
  interface CostMapDefReplace extends CostMapDefBase {
267
- replace: number;
409
+ replace: number;
268
410
  }
269
411
  interface CostMapDefInsDel extends CostMapDefBase {
270
- insDel: number;
412
+ insDel: number;
271
413
  }
272
414
  interface CostMapDefSwap extends CostMapDefBase {
273
- swap: number;
415
+ swap: number;
274
416
  }
275
-
417
+ //#endregion
418
+ //#region src/DictionaryInformation.d.ts
276
419
  /**
277
- * Use by dictionary authors to help improve the quality of suggestions
278
- * given from the dictionary.
279
- *
280
- * Added with `v5.16.0`.
281
- */
420
+ * Use by dictionary authors to help improve the quality of suggestions
421
+ * given from the dictionary.
422
+ *
423
+ * Added with `v5.16.0`.
424
+ */
282
425
  interface DictionaryInformation {
283
- /**
284
- * The locale of the dictionary.
285
- * Example: `nl,nl-be`
286
- */
287
- locale?: string;
288
- /**
289
- * The alphabet to use.
290
- * @default "a-zA-Z"
291
- */
292
- alphabet?: CharacterSet | CharacterSetCosts[];
293
- /**
294
- * The accent characters.
295
- *
296
- * Default: `"\u0300-\u0341"`
297
- */
298
- accents?: CharacterSet | CharacterSetCosts[];
299
- /**
300
- * Define edit costs.
301
- */
302
- costs?: EditCosts;
303
- /**
304
- * Used in making suggestions. The lower the value, the more likely the suggestion
305
- * will be near the top of the suggestion list.
306
- */
307
- suggestionEditCosts?: SuggestionCostsDefs | undefined;
308
- /**
309
- * Used by dictionary authors
310
- */
311
- hunspellInformation?: HunspellInformation;
312
- /**
313
- * A collection of patterns to test against the suggested words.
314
- * If the word matches the pattern, then the penalty is applied.
315
- */
316
- adjustments?: PatternAdjustment[];
317
- /**
318
- * An optional set of characters that can possibly be removed from a word before
319
- * checking it.
320
- *
321
- * This is useful in languages like Arabic where Harakat accents are optional.
322
- *
323
- * Note: All matching characters are removed or none. Partial removal is not supported.
324
- */
325
- ignore?: CharacterSet;
326
- }
426
+ /**
427
+ * The locale of the dictionary.
428
+ * Example: `nl,nl-be`
429
+ */
430
+ locale?: string;
431
+ /**
432
+ * The alphabet to use.
433
+ * @default "a-zA-Z"
434
+ */
435
+ alphabet?: CharacterSet | CharacterSetCosts[];
436
+ /**
437
+ * The accent characters.
438
+ *
439
+ * Default: `"\u0300-\u0341"`
440
+ */
441
+ accents?: CharacterSet | CharacterSetCosts[];
442
+ /**
443
+ * Define edit costs.
444
+ */
445
+ costs?: EditCosts;
446
+ /**
447
+ * Used in making suggestions. The lower the value, the more likely the suggestion
448
+ * will be near the top of the suggestion list.
449
+ */
450
+ suggestionEditCosts?: SuggestionCostsDefs | undefined;
451
+ /**
452
+ * Used by dictionary authors
453
+ */
454
+ hunspellInformation?: HunspellInformation;
455
+ /**
456
+ * A collection of patterns to test against the suggested words.
457
+ * If the word matches the pattern, then the penalty is applied.
458
+ */
459
+ adjustments?: PatternAdjustment[];
460
+ /**
461
+ * An optional set of characters that can possibly be removed from a word before
462
+ * checking it.
463
+ *
464
+ * This is useful in languages like Arabic where Harakat accents are optional.
465
+ *
466
+ * Note: All matching characters are removed or none. Partial removal is not supported.
467
+ */
468
+ ignore?: CharacterSet;
469
+ }
470
+ // cspell:ignore aeistlunkodmrvpgjhäõbüoöfcwzxðqþ aàâä eéèêë iîïy
327
471
  interface HunspellInformation {
328
- /**
329
- * Selected Hunspell AFF content.
330
- * The content must be UTF-8
331
- *
332
- * Sections:
333
- * - TRY
334
- * - MAP
335
- * - REP
336
- * - KEY
337
- * - ICONV
338
- * - OCONV
339
- *
340
- * Example:
341
- * ```hunspell
342
- * # Comment
343
- * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
344
- * MAP aàâäAÀÂÄ
345
- * MAP eéèêëEÉÈÊË
346
- * MAP iîïyIÎÏY
347
- * MAP oôöOÔÖ
348
- * MAP (IJ)(IJ)
349
- * ```
350
- */
351
- aff: HunspellAffContent;
352
- /** The costs to apply when using the hunspell settings */
353
- costs?: HunspellCosts;
354
- }
472
+ /**
473
+ * Selected Hunspell AFF content.
474
+ * The content must be UTF-8
475
+ *
476
+ * Sections:
477
+ * - TRY
478
+ * - MAP
479
+ * - REP
480
+ * - KEY
481
+ * - ICONV
482
+ * - OCONV
483
+ *
484
+ * Example:
485
+ * ```hunspell
486
+ * # Comment
487
+ * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
488
+ * MAP aàâäAÀÂÄ
489
+ * MAP eéèêëEÉÈÊË
490
+ * MAP iîïyIÎÏY
491
+ * MAP oôöOÔÖ
492
+ * MAP (IJ)(IJ)
493
+ * ```
494
+ */
495
+ aff: HunspellAffContent;
496
+ /** The costs to apply when using the hunspell settings */
497
+ costs?: HunspellCosts;
498
+ }
499
+ // cspell:ignore OCONV
355
500
  /**
356
- * Selected Hunspell AFF content.
357
- * The content must be UTF-8
358
- *
359
- * Sections:
360
- * - TRY
361
- * - NO-TRY
362
- * - MAP
363
- * - REP
364
- * - KEY
365
- * - ICONV
366
- * - OCONV
367
- *
368
- * Example:
369
- * ```hunspell
370
- * # Comment
371
- * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
372
- * NO-TRY -0123456789 # Discourage adding numbers and dashes.
373
- * MAP aàâäAÀÂÄ
374
- * MAP eéèêëEÉÈÊË
375
- * MAP iîïyIÎÏY
376
- * MAP oôöOÔÖ
377
- * MAP (IJ)(IJ)
378
- * ```
379
- */
501
+ * Selected Hunspell AFF content.
502
+ * The content must be UTF-8
503
+ *
504
+ * Sections:
505
+ * - TRY
506
+ * - NO-TRY
507
+ * - MAP
508
+ * - REP
509
+ * - KEY
510
+ * - ICONV
511
+ * - OCONV
512
+ *
513
+ * Example:
514
+ * ```hunspell
515
+ * # Comment
516
+ * TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
517
+ * NO-TRY -0123456789 # Discourage adding numbers and dashes.
518
+ * MAP aàâäAÀÂÄ
519
+ * MAP eéèêëEÉÈÊË
520
+ * MAP iîïyIÎÏY
521
+ * MAP oôöOÔÖ
522
+ * MAP (IJ)(IJ)
523
+ * ```
524
+ */
380
525
  type HunspellAffContent = string;
381
526
  interface HunspellCosts extends EditCosts {
382
- /**
383
- * The cost of inserting / deleting / or swapping any `tryChars`
384
- * Defaults to `baseCosts`
385
- */
386
- tryCharCost?: number;
387
- /**
388
- * The cost of replacing or swapping any adjacent keyboard characters.
389
- *
390
- * This should be slightly cheaper than `tryCharCost`.
391
- * @default 99
392
- */
393
- keyboardCost?: number;
394
- /**
395
- * mapSet replacement cost is the cost to substitute one character with another from
396
- * the same set.
397
- *
398
- * Map characters are considered very similar to each other and are often
399
- * the cause of simple mistakes.
400
- *
401
- * @default 25
402
- */
403
- mapCost?: number;
404
- /**
405
- * The cost to convert between convert pairs.
406
- *
407
- * The value should be slightly higher than the mapCost.
408
- *
409
- * @default 30
410
- */
411
- ioConvertCost?: number;
412
- /**
413
- * The cost to substitute pairs found in the replace settings.
414
- *
415
- * @default 75
416
- */
417
- replaceCosts?: number;
527
+ /**
528
+ * The cost of inserting / deleting / or swapping any `tryChars`
529
+ * Defaults to `baseCosts`
530
+ */
531
+ tryCharCost?: number;
532
+ /**
533
+ * The cost of replacing or swapping any adjacent keyboard characters.
534
+ *
535
+ * This should be slightly cheaper than `tryCharCost`.
536
+ * @default 99
537
+ */
538
+ keyboardCost?: number;
539
+ /**
540
+ * mapSet replacement cost is the cost to substitute one character with another from
541
+ * the same set.
542
+ *
543
+ * Map characters are considered very similar to each other and are often
544
+ * the cause of simple mistakes.
545
+ *
546
+ * @default 25
547
+ */
548
+ mapCost?: number;
549
+ /**
550
+ * The cost to convert between convert pairs.
551
+ *
552
+ * The value should be slightly higher than the mapCost.
553
+ *
554
+ * @default 30
555
+ */
556
+ ioConvertCost?: number;
557
+ /**
558
+ * The cost to substitute pairs found in the replace settings.
559
+ *
560
+ * @default 75
561
+ */
562
+ replaceCosts?: number;
418
563
  }
419
564
  /**
420
- *
421
- */
565
+ *
566
+ */
422
567
  interface EditCosts {
423
- /**
424
- * This is the base cost for making an edit.
425
- * @default 100
426
- */
427
- baseCost?: number;
428
- /**
429
- * This is the cost for characters not in the alphabet.
430
- * @default 110
431
- */
432
- nonAlphabetCosts?: number;
433
- /**
434
- * The extra cost incurred for changing the first letter of a word.
435
- * This value should be less than `100 - baseCost`.
436
- * @default 4
437
- */
438
- firstLetterPenalty?: number;
439
- /**
440
- * The cost to change capitalization.
441
- * This should be very cheap, it helps with fixing capitalization issues.
442
- * @default 1
443
- */
444
- capsCosts?: number;
445
- /**
446
- * The cost to add / remove an accent
447
- * This should be very cheap, it helps with fixing accent issues.
448
- * @default 1
449
- */
450
- accentCosts?: number;
568
+ /**
569
+ * This is the base cost for making an edit.
570
+ * @default 100
571
+ */
572
+ baseCost?: number;
573
+ /**
574
+ * This is the cost for characters not in the alphabet.
575
+ * @default 110
576
+ */
577
+ nonAlphabetCosts?: number;
578
+ /**
579
+ * The extra cost incurred for changing the first letter of a word.
580
+ * This value should be less than `100 - baseCost`.
581
+ * @default 4
582
+ */
583
+ firstLetterPenalty?: number;
584
+ /**
585
+ * The cost to change capitalization.
586
+ * This should be very cheap, it helps with fixing capitalization issues.
587
+ * @default 1
588
+ */
589
+ capsCosts?: number;
590
+ /**
591
+ * The cost to add / remove an accent
592
+ * This should be very cheap, it helps with fixing accent issues.
593
+ * @default 1
594
+ */
595
+ accentCosts?: number;
451
596
  }
452
597
  /**
453
- * This is a set of characters that can include `-` or `|`
454
- * - `-` - indicates a range of characters: `a-c` => `abc`
455
- * - `|` - is a group separator, indicating that the characters on either side
456
- * are not related.
457
- */
598
+ * This is a set of characters that can include `-` or `|`
599
+ * - `-` - indicates a range of characters: `a-c` => `abc`
600
+ * - `|` - is a group separator, indicating that the characters on either side
601
+ * are not related.
602
+ */
458
603
  type CharacterSet = string;
459
604
  interface CharacterSetCosts {
460
- /**
461
- * This is a set of characters that can include `-` or `|`
462
- * - `-` - indicates a range of characters: `a-c` => `abc`
463
- * - `|` - is a group separator, indicating that the characters on either side
464
- * are not related.
465
- */
466
- characters: CharacterSet;
467
- /** the cost to insert / delete / replace / swap the characters in a group */
468
- cost: number;
469
- /**
470
- * The penalty cost to apply if the accent is used.
471
- * This is used to discourage
472
- */
473
- penalty?: number;
605
+ /**
606
+ * This is a set of characters that can include `-` or `|`
607
+ * - `-` - indicates a range of characters: `a-c` => `abc`
608
+ * - `|` - is a group separator, indicating that the characters on either side
609
+ * are not related.
610
+ */
611
+ characters: CharacterSet;
612
+ /** the cost to insert / delete / replace / swap the characters in a group */
613
+ cost: number;
614
+ /**
615
+ * The penalty cost to apply if the accent is used.
616
+ * This is used to discourage
617
+ */
618
+ penalty?: number;
474
619
  }
475
620
  /**
476
- * @hidden
477
- */
621
+ * @hidden
622
+ */
478
623
  type IRegExp = RegExp;
479
624
  interface PatternAdjustment {
480
- /** Id of the Adjustment, i.e. `short-compound` */
481
- id: string;
482
- /** RegExp pattern to match */
483
- regexp: string | IRegExp;
484
- /** The amount of penalty to apply. */
485
- penalty: number;
486
- }
487
-
625
+ /** Id of the Adjustment, i.e. `short-compound` */
626
+ id: string;
627
+ /** RegExp pattern to match */
628
+ regexp: string | IRegExp;
629
+ /** The amount of penalty to apply. */
630
+ penalty: number;
631
+ }
632
+ //#endregion
633
+ //#region src/InlineDictionary.d.ts
488
634
  interface InlineDictionary {
489
- /**
490
- * List of words to be considered correct.
491
- */
492
- words?: string[];
493
- /**
494
- * List of words to always be considered incorrect. Words found in `flagWords` override `words`.
495
- *
496
- * Format of `flagWords`
497
- * - single word entry - `word`
498
- * - with suggestions - `word:suggestion` or `word->suggestion, suggestions`
499
- *
500
- * Example:
501
- * ```ts
502
- * "flagWords": [
503
- * "color: colour",
504
- * "incase: in case, encase",
505
- * "canot->cannot",
506
- * "cancelled->canceled"
507
- * ]
508
- * ```
509
- */
510
- flagWords?: string[];
511
- /**
512
- * List of words to be ignored. An ignored word will not show up as an error, even if it is
513
- * also in the `flagWords`.
514
- */
515
- ignoreWords?: string[];
516
- /**
517
- * A list of suggested replacements for words.
518
- * Suggested words provide a way to make preferred suggestions on word replacements.
519
- * To hint at a preferred change, but not to require it.
520
- *
521
- * Format of `suggestWords`
522
- * - Single suggestion (possible auto fix)
523
- * - `word: suggestion`
524
- * - `word->suggestion`
525
- * - Multiple suggestions (not auto fixable)
526
- * - `word: first, second, third`
527
- * - `word->first, second, third`
528
- */
529
- suggestWords?: string[];
530
- }
531
-
635
+ /**
636
+ * List of words to be considered correct.
637
+ */
638
+ words?: string[];
639
+ // cspell:ignore colour color canot incase
640
+ /**
641
+ * List of words to always be considered incorrect. Words found in `flagWords` override `words`.
642
+ *
643
+ * Format of `flagWords`
644
+ * - single word entry - `word`
645
+ * - with suggestions - `word:suggestion` or `word->suggestion, suggestions`
646
+ *
647
+ * Example:
648
+ * ```ts
649
+ * "flagWords": [
650
+ * "color: colour",
651
+ * "incase: in case, encase",
652
+ * "canot->cannot",
653
+ * "cancelled->canceled"
654
+ * ]
655
+ * ```
656
+ */
657
+ flagWords?: string[];
658
+ /**
659
+ * List of words to be ignored. An ignored word will not show up as an error, even if it is
660
+ * also in the `flagWords`.
661
+ */
662
+ ignoreWords?: string[];
663
+ /**
664
+ * A list of suggested replacements for words.
665
+ * Suggested words provide a way to make preferred suggestions on word replacements.
666
+ * To hint at a preferred change, but not to require it.
667
+ *
668
+ * Format of `suggestWords`
669
+ * - Single suggestion (possible auto fix)
670
+ * - `word: suggestion`
671
+ * - `word->suggestion`
672
+ * - Multiple suggestions (not auto fixable)
673
+ * - `word: first, second, third`
674
+ * - `word->first, second, third`
675
+ */
676
+ suggestWords?: string[];
677
+ }
678
+ //#endregion
679
+ //#region src/DictionaryDefinition.d.ts
532
680
  type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionInline | DictionaryDefinitionSimple | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
533
- type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
681
+ type DictionaryFileTypes = "S" | "W" | "C" | "T";
534
682
  interface DictionaryDefinitionBase {
535
- /**
536
- * This is the name of a dictionary.
537
- *
538
- * Name Format:
539
- * - Must contain at least 1 number or letter.
540
- * - Spaces are allowed.
541
- * - Leading and trailing space will be removed.
542
- * - Names ARE case-sensitive.
543
- * - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
544
- */
545
- name: DictionaryId;
546
- /**
547
- * Optional description of the contents / purpose of the dictionary.
548
- */
549
- description?: string;
550
- /** Replacement pairs. */
551
- repMap?: ReplaceMap;
552
- /** Use Compounds. */
553
- useCompounds?: boolean;
554
- /**
555
- * Indicate that suggestions should not come from this dictionary.
556
- * Words in this dictionary are considered correct, but will not be
557
- * used when making spell correction suggestions.
558
- *
559
- * Note: if a word is suggested by another dictionary, but found in
560
- * this dictionary, it will be removed from the set of
561
- * possible suggestions.
562
- */
563
- noSuggest?: boolean | undefined;
564
- /**
565
- * Some dictionaries may contain forbidden words to prevent compounding from generating
566
- * words that are not valid in the language. These are often
567
- * words that are used in other languages or might be generated through compounding.
568
- * This setting allows flagged words to be ignored when checking the dictionary.
569
- * The effect is similar to the word not being in the dictionary.
570
- */
571
- ignoreForbiddenWords?: boolean | undefined;
572
- /**
573
- * Type of file:
574
- * - S - single word per line,
575
- * - W - each line can contain one or more words separated by space,
576
- * - C - each line is treated like code (Camel Case is allowed).
577
- *
578
- * Default is S.
579
- *
580
- * C is the slowest to load due to the need to split each line based upon code splitting rules.
581
- *
582
- * Note: this settings does not apply to inline dictionaries or `.trie` files.
583
- *
584
- * @default "S"
585
- */
586
- type?: DictionaryFileTypes | undefined;
587
- /**
588
- * Strip case and accents to allow for case insensitive searches and
589
- * words without accents.
590
- *
591
- * Note: this setting only applies to word lists. It has no-impact on trie
592
- * dictionaries.
593
- *
594
- * @default true
595
- */
596
- supportNonStrictSearches?: boolean | undefined;
683
+ /**
684
+ * This is the name of a dictionary.
685
+ *
686
+ * Name Format:
687
+ * - Must contain at least 1 number or letter.
688
+ * - Spaces are allowed.
689
+ * - Leading and trailing space will be removed.
690
+ * - Names ARE case-sensitive.
691
+ * - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
692
+ */
693
+ name: DictionaryId;
694
+ /**
695
+ * Optional description of the contents / purpose of the dictionary.
696
+ */
697
+ description?: string | undefined;
698
+ /** Replacement pairs. */
699
+ repMap?: ReplaceMap | undefined;
700
+ /** Use Compounds. */
701
+ useCompounds?: boolean | undefined;
702
+ /**
703
+ * Indicate that suggestions should not come from this dictionary.
704
+ * Words in this dictionary are considered correct, but will not be
705
+ * used when making spell correction suggestions.
706
+ *
707
+ * Note: if a word is suggested by another dictionary, but found in
708
+ * this dictionary, it will be removed from the set of
709
+ * possible suggestions.
710
+ */
711
+ noSuggest?: boolean | undefined;
712
+ /**
713
+ * Some dictionaries may contain forbidden words to prevent compounding from generating
714
+ * words that are not valid in the language. These are often
715
+ * words that are used in other languages or might be generated through compounding.
716
+ * This setting allows flagged words to be ignored when checking the dictionary.
717
+ * The effect is similar to the word not being in the dictionary.
718
+ */
719
+ ignoreForbiddenWords?: boolean | undefined;
720
+ /**
721
+ * Type of file:
722
+ * - S - single word per line,
723
+ * - W - each line can contain one or more words separated by space,
724
+ * - C - each line is treated like code (Camel Case is allowed).
725
+ *
726
+ * Default is S.
727
+ *
728
+ * C is the slowest to load due to the need to split each line based upon code splitting rules.
729
+ *
730
+ * Note: this settings does not apply to inline dictionaries or `.trie` files.
731
+ *
732
+ * @default "S"
733
+ */
734
+ type?: DictionaryFileTypes | undefined;
735
+ /**
736
+ * Strip case and accents to allow for case insensitive searches and
737
+ * words without accents.
738
+ *
739
+ * Note: this setting only applies to word lists. It has no-impact on trie
740
+ * dictionaries.
741
+ *
742
+ * @default true
743
+ */
744
+ supportNonStrictSearches?: boolean | undefined;
597
745
  }
598
746
  interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
599
- /** Path to the file. */
600
- path: DictionaryPath;
601
- /**
602
- * Only for legacy dictionary definitions.
603
- * @deprecated true
604
- * @deprecationMessage Use {@link path} instead.
605
- * @hidden
606
- */
607
- file?: undefined;
747
+ /** Path to the file. */
748
+ path: DictionaryPath;
749
+ /**
750
+ * Only for legacy dictionary definitions.
751
+ * @deprecated true
752
+ * @deprecationMessage Use {@link path} instead.
753
+ * @hidden
754
+ */
755
+ file?: undefined;
608
756
  }
609
757
  /**
610
- * An Empty Dictionary Definition
611
- */
758
+ * An Empty Dictionary Definition
759
+ */
612
760
  interface DictionaryDefinitionSimple extends DictionaryDefinitionBase {
613
- /**
614
- * @hidden
615
- */
616
- repMap?: ReplaceMap;
617
- /**
618
- * @hidden
619
- */
620
- useCompounds?: boolean;
621
- /**
622
- * @hidden
623
- */
624
- noSuggest?: boolean | undefined;
625
- /**
626
- * @hidden
627
- */
628
- ignoreForbiddenWords?: boolean | undefined;
629
- /**
630
- * @hidden
631
- */
632
- type?: DictionaryFileTypes | undefined;
633
- /**
634
- * @hidden
635
- */
636
- path?: string | undefined;
637
- /**
638
- * @hidden
639
- */
640
- file?: undefined;
761
+ /**
762
+ * @hide
763
+ */
764
+ repMap?: ReplaceMap | undefined;
765
+ /**
766
+ * @hide
767
+ */
768
+ useCompounds?: boolean | undefined;
769
+ /**
770
+ * @hide
771
+ */
772
+ noSuggest?: boolean | undefined;
773
+ /**
774
+ * @hide
775
+ */
776
+ ignoreForbiddenWords?: boolean | undefined;
777
+ /**
778
+ * @hide
779
+ */
780
+ type?: DictionaryFileTypes | undefined;
781
+ /**
782
+ * @hide
783
+ */
784
+ path?: string | undefined;
785
+ /**
786
+ * @hide
787
+ */
788
+ file?: undefined;
641
789
  }
642
790
  /**
643
- * Used to provide extra data related to the dictionary
644
- */
791
+ * Used to provide extra data related to the dictionary
792
+ */
645
793
  interface DictionaryDefinitionAugmented extends DictionaryDefinitionPreferred {
646
- dictionaryInformation?: DictionaryInformation;
794
+ dictionaryInformation?: DictionaryInformation;
795
+ }
796
+ interface HiddenFields {
797
+ /**
798
+ * Not used
799
+ * @hide
800
+ */
801
+ path?: undefined;
802
+ /**
803
+ * Not used
804
+ * @hide
805
+ */
806
+ file?: undefined;
807
+ /**
808
+ * Not used
809
+ * @hide
810
+ */
811
+ type?: undefined;
812
+ /**
813
+ * Use `ignoreWords` instead.
814
+ * @hide
815
+ */
816
+ noSuggest?: undefined;
817
+ /**
818
+ * Not used
819
+ * @hide
820
+ */
821
+ ignoreForbiddenWords?: undefined;
822
+ /**
823
+ * Not used
824
+ * @hide
825
+ */
826
+ useCompounds?: undefined;
827
+ /**
828
+ * @hide
829
+ */
830
+ repMap?: undefined;
647
831
  }
648
832
  /**
649
- * Inline Dictionary Definition
650
- *
651
- * All words are defined inline.
652
- */
653
- interface DictionaryDefinitionInlineBase extends DictionaryDefinitionBase, InlineDictionary {
654
- /**
655
- * Not used
656
- * @hidden
657
- */
658
- path?: undefined;
659
- /**
660
- * Not used
661
- * @hidden
662
- */
663
- file?: undefined;
664
- /**
665
- * Not used
666
- * @hidden
667
- */
668
- type?: DictionaryDefinitionBase['type'];
669
- /**
670
- * Use `ignoreWords` instead.
671
- * @hidden
672
- */
673
- noSuggest?: DictionaryDefinitionBase['noSuggest'];
674
- /**
675
- * Not used
676
- * @hidden
677
- */
678
- ignoreForbiddenWords?: undefined;
679
- }
680
- interface DictionaryDefinitionInlineWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'words'>> {
681
- words: string[];
682
- }
683
- interface DictionaryDefinitionInlineFlagWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'flagWords'>> {
684
- flagWords: string[];
685
- }
686
- interface DictionaryDefinitionInlineIgnoreWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'ignoreWords'>> {
687
- ignoreWords: string[];
688
- }
689
- interface DictionaryDefinitionInlineSuggestWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, 'suggestWords'>> {
690
- suggestWords: string[];
833
+ * Inline Dictionary Definition
834
+ *
835
+ * All words are defined inline.
836
+ */
837
+ type DictionaryDefinitionInlineBase = Omit<DictionaryDefinitionBase, keyof HiddenFields> & HiddenFields & InlineDictionary;
838
+ interface DictionaryDefinitionInlineWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "words">> {
839
+ words: string[];
840
+ }
841
+ interface DictionaryDefinitionInlineFlagWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "flagWords">> {
842
+ flagWords: string[];
843
+ }
844
+ interface DictionaryDefinitionInlineIgnoreWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "ignoreWords">> {
845
+ ignoreWords: string[];
846
+ }
847
+ interface DictionaryDefinitionInlineSuggestWords extends DictionaryDefinitionInlineBase, Required<Pick<InlineDictionary, "suggestWords">> {
848
+ suggestWords: string[];
691
849
  }
692
850
  /**
693
- * Inline Dictionary Definitions
694
- * @since 6.23.0
695
- */
851
+ * Inline Dictionary Definitions
852
+ * @since 6.23.0
853
+ */
696
854
  type DictionaryDefinitionInline = DictionaryDefinitionInlineWords | DictionaryDefinitionInlineIgnoreWords | DictionaryDefinitionInlineFlagWords | DictionaryDefinitionInlineSuggestWords;
697
855
  /**
698
- * Only for legacy dictionary definitions.
699
- * @deprecated true
700
- * @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
701
- */
856
+ * Only for legacy dictionary definitions.
857
+ * @deprecated true
858
+ * @deprecationMessage Use {@link DictionaryDefinitionPreferred} instead.
859
+ */
702
860
  interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
703
- /** @hidden */
704
- path?: undefined;
705
- /**
706
- * Path to the file, only for legacy dictionary definitions.
707
- * @deprecated true
708
- * @deprecationMessage Use `path` instead.
709
- */
710
- file: DictionaryPath;
711
- /** @hidden */
712
- suggestionEditCosts?: undefined;
861
+ /**
862
+ * @hidden
863
+ */
864
+ path?: undefined;
865
+ /**
866
+ * Path to the file, only for legacy dictionary definitions.
867
+ * @deprecated true
868
+ * @deprecationMessage Use `path` instead.
869
+ */
870
+ file: DictionaryPath;
871
+ /**
872
+ * @hidden
873
+ */
874
+ suggestionEditCosts?: undefined;
713
875
  }
714
876
  /**
715
- * @deprecated true
716
- * @hidden
717
- */
877
+ * @deprecated true
878
+ * @hidden
879
+ */
718
880
  interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
719
- /** Path to the file, if undefined the path to the extension dictionaries is assumed. */
720
- path?: FsDictionaryPath;
721
- /**
722
- * File name.
723
- * @deprecated true
724
- * @deprecationMessage Use {@link path} instead.
725
- */
726
- file: FsDictionaryPath;
727
- /**
728
- * Type of file:
729
- * - S - single word per line,
730
- * - W - each line can contain one or more words separated by space,
731
- * - C - each line is treated like code (Camel Case is allowed).
732
- *
733
- * Default is S.
734
- *
735
- * C is the slowest to load due to the need to split each line based upon code splitting rules.
736
- * @default "S"
737
- */
738
- type?: DictionaryFileTypes;
739
- /**
740
- * @hidden
741
- */
742
- suggestionEditCosts?: undefined;
881
+ /** Path to the file, if undefined the path to the extension dictionaries is assumed. */
882
+ path?: FsDictionaryPath;
883
+ /**
884
+ * File name.
885
+ * @deprecated true
886
+ * @deprecationMessage Use {@link path} instead.
887
+ */
888
+ file: FsDictionaryPath;
889
+ /**
890
+ * Type of file:
891
+ * - S - single word per line,
892
+ * - W - each line can contain one or more words separated by space,
893
+ * - C - each line is treated like code (Camel Case is allowed).
894
+ *
895
+ * Default is S.
896
+ *
897
+ * C is the slowest to load due to the need to split each line based upon code splitting rules.
898
+ * @default "S"
899
+ */
900
+ type?: DictionaryFileTypes;
901
+ /**
902
+ * @hidden
903
+ */
904
+ suggestionEditCosts?: undefined;
743
905
  }
744
906
  /**
745
- * Specifies the scope of a dictionary.
746
- */
747
- type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
907
+ * Specifies the scope of a dictionary.
908
+ */
909
+ type CustomDictionaryScope = "user" | "workspace" | "folder";
748
910
  /**
749
- * For Defining Custom dictionaries. They are generally scoped to a
750
- * `user`, `workspace`, or `folder`.
751
- * When `addWords` is true, indicates that the spell checker can add words
752
- * to the file.
753
- *
754
- * Note: only plain text files with one word per line are supported at this moment.
755
- */
911
+ * For Defining Custom dictionaries. They are generally scoped to a
912
+ * `user`, `workspace`, or `folder`.
913
+ * When `addWords` is true, indicates that the spell checker can add words
914
+ * to the file.
915
+ *
916
+ * Note: only plain text files with one word per line are supported at this moment.
917
+ */
756
918
  interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
757
- /** Path to custom dictionary text file. */
758
- path: CustomDictionaryPath;
759
- /**
760
- * Defines the scope for when words will be added to the dictionary.
761
- *
762
- * Scope values: `user`, `workspace`, `folder`.
763
- */
764
- scope?: CustomDictionaryScope | CustomDictionaryScope[];
765
- /**
766
- * When `true`, let's the spell checker know that words can be added to this dictionary.
767
- */
768
- addWords: boolean;
919
+ /** Path to custom dictionary text file. */
920
+ path: CustomDictionaryPath;
921
+ /**
922
+ * Defines the scope for when words will be added to the dictionary.
923
+ *
924
+ * Scope values: `user`, `workspace`, `folder`.
925
+ */
926
+ scope?: CustomDictionaryScope | CustomDictionaryScope[];
927
+ /**
928
+ * When `true`, let's the spell checker know that words can be added to this dictionary.
929
+ */
930
+ addWords: boolean;
769
931
  }
770
932
  /**
771
- * This is the name of a dictionary.
772
- *
773
- * Name Format:
774
- * - Must contain at least 1 number or letter.
775
- * - Spaces are allowed.
776
- * - Leading and trailing space will be removed.
777
- * - Names ARE case-sensitive.
778
- * - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
779
- *
780
- * @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
781
- */
933
+ * This is the name of a dictionary.
934
+ *
935
+ * Name Format:
936
+ * - Must contain at least 1 number or letter.
937
+ * - Spaces are allowed.
938
+ * - Leading and trailing space will be removed.
939
+ * - Names ARE case-sensitive.
940
+ * - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
941
+ *
942
+ * @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
943
+ */
782
944
  type DictionaryId = string;
783
945
  type ReplaceEntry = [string, string];
784
946
  type ReplaceMap = ReplaceEntry[];
785
947
  /**
786
- * A File System Path. Relative paths are relative to the configuration file.
787
- */
948
+ * A File System Path. Relative paths are relative to the configuration file.
949
+ */
788
950
  type FsDictionaryPath = string;
789
951
  /**
790
- * A File System Path to a dictionary file.
791
- * Pattern: `^.*\.(?:txt|trie|dic)(?:\.gz)?$`
792
- */
952
+ * A File System Path to a dictionary file.
953
+ * Pattern: `^.*\.(?:txt|trie|dic)(?:\.gz)?$`
954
+ */
793
955
  type DictionaryPath = string;
794
956
  /**
795
- * A File System Path to a dictionary file.
796
- */
957
+ * A File System Path to a dictionary file.
958
+ */
797
959
  type CustomDictionaryPath = FsDictionaryPath;
798
960
  /**
799
- * Reference to a dictionary by name.
800
- * One of:
801
- * - {@link DictionaryRef}
802
- * - {@link DictionaryNegRef}
803
- */
961
+ * Reference to a dictionary by name.
962
+ * One of:
963
+ * - {@link DictionaryRef}
964
+ * - {@link DictionaryNegRef}
965
+ */
804
966
  type DictionaryReference = DictionaryRef | DictionaryNegRef;
805
967
  /**
806
- * This a reference to a named dictionary.
807
- * It is expected to match the name of a dictionary.
808
- */
968
+ * This a reference to a named dictionary.
969
+ * It is expected to match the name of a dictionary.
970
+ */
809
971
  type DictionaryRef = DictionaryId;
810
972
  /**
811
- * This a negative reference to a named dictionary.
812
- *
813
- * It is used to exclude or include a dictionary by name.
814
- *
815
- * The reference starts with 1 or more `!`.
816
- * - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.
817
- * - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`.
818
- * Overrides `!<dictionary_name>`.
819
- * - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`.
820
- * Overrides `!!<dictionary_name>`.
821
- *
822
- * @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
823
- */
973
+ * This a negative reference to a named dictionary.
974
+ *
975
+ * It is used to exclude or include a dictionary by name.
976
+ *
977
+ * The reference starts with 1 or more `!`.
978
+ * - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.
979
+ * - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`.
980
+ * Overrides `!<dictionary_name>`.
981
+ * - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`.
982
+ * Overrides `!!<dictionary_name>`.
983
+ *
984
+ * @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
985
+ */
824
986
  type DictionaryNegRef = string;
825
-
987
+ //#endregion
988
+ //#region src/features.d.ts
826
989
  /**
827
- * These are experimental features and are subject to change or removal without notice.
828
- */
990
+ * These are experimental features and are subject to change or removal without notice.
991
+ */
829
992
  interface FeaturesExperimental {
830
- /**
831
- * Enable/disable using weighted suggestions.
832
- */
833
- 'weighted-suggestions': FeatureEnableOnly;
993
+ /**
994
+ * Enable/disable using weighted suggestions.
995
+ */
996
+ "weighted-suggestions": FeatureEnableOnly;
834
997
  }
835
998
  /**
836
- * These are the current set of active features
837
- */
999
+ * These are the current set of active features
1000
+ */
838
1001
  interface FeaturesActive {
839
- /**
840
- * @hidden
841
- */
842
- featureName?: boolean;
1002
+ /**
1003
+ * @hidden
1004
+ */
1005
+ featureName?: boolean;
843
1006
  }
844
1007
  /**
845
- * These are feature settings that have been deprecated or moved elsewhere they will have no
846
- * effect on the code but are here to prevent schema errors. The will get cleaned out on major versions.
847
- */
1008
+ * These are feature settings that have been deprecated or moved elsewhere they will have no
1009
+ * effect on the code but are here to prevent schema errors. The will get cleaned out on major versions.
1010
+ */
848
1011
  interface FeaturesDeprecated {
849
- /**
850
- * @hidden
851
- */
852
- featureName?: boolean;
1012
+ /**
1013
+ * @hidden
1014
+ */
1015
+ featureName?: boolean;
853
1016
  }
854
1017
  /**
855
- * Features are behaviors or settings that can be explicitly configured.
856
- */
857
- interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {
858
- }
1018
+ * Features are behaviors or settings that can be explicitly configured.
1019
+ */
1020
+ interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {}
859
1021
  type Feature = FeatureEnableOnly | FeatureWithConfiguration;
860
1022
  type FeatureEnableOnly = boolean;
861
1023
  /**
862
- * Feature Configuration.
863
- */
1024
+ * Feature Configuration.
1025
+ */
864
1026
  interface FeatureWithConfiguration {
865
- enable: boolean;
1027
+ enable: boolean;
866
1028
  }
867
-
1029
+ //#endregion
1030
+ //#region src/types.d.ts
868
1031
  type Serializable = number | string | boolean | null | object;
869
-
1032
+ //#endregion
1033
+ //#region src/CSpellSettingsDef.d.ts
870
1034
  /**
871
- * These settings come from user and workspace settings.
872
- */
1035
+ * These settings come from user and workspace settings.
1036
+ */
873
1037
  type CSpellPackageSettings = CSpellUserSettings;
874
1038
  type CSpellUserSettings = CSpellSettings;
875
- interface CSpellSettings extends FileSettings, LegacySettings {
876
- }
1039
+ interface CSpellSettings extends FileSettings, LegacySettings {}
877
1040
  interface ImportFileRef {
878
- /** filename or URL */
879
- filename: string;
880
- error?: Error | undefined;
881
- referencedBy?: Source[];
1041
+ /** filename or URL */
1042
+ filename: string;
1043
+ error?: Error | undefined;
1044
+ referencedBy?: Source[];
882
1045
  }
883
1046
  interface CSpellSettingsWithSourceTrace extends CSpellSettings {
884
- source?: Source | undefined;
885
- __importRef?: ImportFileRef;
886
- __imports?: Map<string, ImportFileRef>;
887
- }
888
- interface AdvancedCSpellSettingsWithSourceTrace extends CSpellSettingsWithSourceTrace, ExperimentalFileSettings {
1047
+ source?: Source | undefined;
1048
+ __importRef?: ImportFileRef;
1049
+ __imports?: Map<string, ImportFileRef>;
889
1050
  }
1051
+ interface AdvancedCSpellSettingsWithSourceTrace extends CSpellSettingsWithSourceTrace, ExperimentalFileSettings {}
890
1052
  interface FileSettings extends ExtendableSettings, CommandLineSettings {
891
- /**
892
- * Url to JSON Schema
893
- * @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
894
- */
895
- $schema?: string;
896
- /**
897
- * Configuration format version of the settings file.
898
- *
899
- * This controls how the settings in the configuration file behave.
900
- *
901
- * @default "0.2"
902
- */
903
- version?: Version;
904
- /** Words to add to global dictionary -- should only be in the user config file. */
905
- userWords?: string[];
906
- /**
907
- * Allows this configuration to inherit configuration for one or more other files.
908
- *
909
- * See [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details.
910
- */
911
- import?: FsPath | FsPath[];
912
- /**
913
- * The root to use for glob patterns found in this configuration.
914
- * Default: location of the configuration file.
915
- * For compatibility reasons, config files with version 0.1, the glob root will
916
- * default to be `${cwd}`.
917
- *
918
- * Use `globRoot` to define a different location.
919
- * `globRoot` can be relative to the location of this configuration file.
920
- * Defining globRoot, does not impact imported configurations.
921
- *
922
- * Special Values:
923
- * - `${cwd}` - will be replaced with the current working directory.
924
- * - `.` - will be the location of the containing configuration file.
925
- *
926
- */
927
- globRoot?: FSPathResolvable;
928
- /**
929
- * Glob patterns of files to be checked.
930
- *
931
- * Glob patterns are relative to the `globRoot` of the configuration file that defines them.
932
- */
933
- files?: Glob[];
934
- /**
935
- * Enable scanning files and directories beginning with `.` (period).
936
- *
937
- * By default, CSpell does not scan `hidden` files.
938
- *
939
- * @default false
940
- */
941
- enableGlobDot?: boolean;
942
- /**
943
- * Glob patterns of files to be ignored.
944
- *
945
- * Glob patterns are relative to the {@link globRoot} of the configuration file that defines them.
946
- */
947
- ignorePaths?: Glob[];
948
- /**
949
- * Prevents searching for local configuration when checking individual documents.
950
- *
951
- * @default false
952
- */
953
- noConfigSearch?: boolean;
954
- /**
955
- * Indicate that the configuration file should not be modified.
956
- * This is used to prevent tools like the VS Code Spell Checker from
957
- * modifying the file to add words and other configuration.
958
- *
959
- * @default false
960
- */
961
- readonly?: boolean;
962
- /**
963
- * Define which reports to use.
964
- * `default` - is a special name for the default cli reporter.
965
- *
966
- * Examples:
967
- * - `["default"]` - to use the default reporter
968
- * - `["@cspell/cspell-json-reporter"]` - use the cspell JSON reporter.
969
- * - `[["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]`
970
- * - `[ "default", ["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]` - Use both the default reporter and the cspell-json-reporter.
971
- *
972
- * @default ["default"]
973
- */
974
- reporters?: ReporterSettings[];
975
- /**
976
- * Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found.
977
- * @default false
978
- */
979
- useGitignore?: boolean;
980
- /**
981
- * Tells the spell checker to stop searching for `.gitignore` files when it reaches a matching root.
982
- */
983
- gitignoreRoot?: FsPath | FsPath[];
984
- /**
985
- * Verify that the in-document directives are correct.
986
- */
987
- validateDirectives?: boolean;
988
- /**
989
- * Configure CSpell features.
990
- *
991
- * @since 5.16.0
992
- */
993
- features?: Features;
994
- }
1053
+ /**
1054
+ * Url to JSON Schema
1055
+ * @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
1056
+ */
1057
+ $schema?: string;
1058
+ /**
1059
+ * Configuration format version of the settings file.
1060
+ *
1061
+ * This controls how the settings in the configuration file behave.
1062
+ *
1063
+ * @default "0.2"
1064
+ */
1065
+ version?: Version;
1066
+ /** Words to add to global dictionary -- should only be in the user config file. */
1067
+ userWords?: string[];
1068
+ /**
1069
+ * Allows this configuration to inherit configuration for one or more other files.
1070
+ *
1071
+ * See [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details.
1072
+ */
1073
+ import?: FsPath | FsPath[];
1074
+ /**
1075
+ * The root to use for glob patterns found in this configuration.
1076
+ * Default: location of the configuration file.
1077
+ * For compatibility reasons, config files with version 0.1, the glob root will
1078
+ * default to be `${cwd}`.
1079
+ *
1080
+ * Use `globRoot` to define a different location.
1081
+ * `globRoot` can be relative to the location of this configuration file.
1082
+ * Defining globRoot, does not impact imported configurations.
1083
+ *
1084
+ * Special Values:
1085
+ * - `${cwd}` - will be replaced with the current working directory.
1086
+ * - `.` - will be the location of the containing configuration file.
1087
+ *
1088
+ */
1089
+ globRoot?: FSPathResolvable;
1090
+ /**
1091
+ * Glob patterns of files to be checked.
1092
+ *
1093
+ * Glob patterns are relative to the `globRoot` of the configuration file that defines them.
1094
+ */
1095
+ files?: Glob[];
1096
+ /**
1097
+ * Enable scanning files and directories beginning with `.` (period).
1098
+ *
1099
+ * By default, CSpell does not scan `hidden` files.
1100
+ *
1101
+ * @default false
1102
+ */
1103
+ enableGlobDot?: boolean;
1104
+ /**
1105
+ * Glob patterns of files to be ignored.
1106
+ *
1107
+ * Glob patterns are relative to the {@link globRoot} of the configuration file that defines them.
1108
+ */
1109
+ ignorePaths?: Glob[];
1110
+ /**
1111
+ * Prevents searching for local configuration when checking individual documents.
1112
+ *
1113
+ * @default false
1114
+ */
1115
+ noConfigSearch?: boolean;
1116
+ /**
1117
+ * Indicate that the configuration file should not be modified.
1118
+ * This is used to prevent tools like the VS Code Spell Checker from
1119
+ * modifying the file to add words and other configuration.
1120
+ *
1121
+ * @default false
1122
+ */
1123
+ readonly?: boolean;
1124
+ /**
1125
+ * Define which reports to use.
1126
+ * `default` - is a special name for the default cli reporter.
1127
+ *
1128
+ * Examples:
1129
+ * - `["default"]` - to use the default reporter
1130
+ * - `["@cspell/cspell-json-reporter"]` - use the cspell JSON reporter.
1131
+ * - `[["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]`
1132
+ * - `[ "default", ["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]` - Use both the default reporter and the cspell-json-reporter.
1133
+ *
1134
+ * @default ["default"]
1135
+ */
1136
+ reporters?: ReporterSettings[];
1137
+ /**
1138
+ * Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found.
1139
+ * @default false
1140
+ */
1141
+ useGitignore?: boolean;
1142
+ /**
1143
+ * Tells the spell checker to stop searching for `.gitignore` files when it reaches a matching root.
1144
+ */
1145
+ gitignoreRoot?: FsPath | FsPath[];
1146
+ /**
1147
+ * Verify that the in-document directives are correct.
1148
+ */
1149
+ validateDirectives?: boolean;
1150
+ /**
1151
+ * Configure CSpell features.
1152
+ *
1153
+ * @since 5.16.0
1154
+ */
1155
+ features?: Features;
1156
+ }
1157
+ /* eslint-disable no-irregular-whitespace */
995
1158
  /**
996
- * In the below JSDoc comment, we helpfully specify an example configuration for the end-user to
997
- * reference. And this example will get captured by the automatic documentation generator.
998
- *
999
- * However, specifying the glob pattern inside of a JSDoc is tricky, because the glob contains the
1000
- * same symbol as the end-of-JSDoc symbol. To work around this, we insert a zero-width space in
1001
- * between the "*" and the "/" symbols.
1002
- */
1159
+ * In the below JSDoc comment, we helpfully specify an example configuration for the end-user to
1160
+ * reference. And this example will get captured by the automatic documentation generator.
1161
+ *
1162
+ * However, specifying the glob pattern inside of a JSDoc is tricky, because the glob contains the
1163
+ * same symbol as the end-of-JSDoc symbol. To work around this, we insert a zero-width space in
1164
+ * between the "*" and the "/" symbols.
1165
+ */
1003
1166
  interface ExtendableSettings extends Settings {
1004
- /**
1005
- * Overrides are used to apply settings for specific files in your project.
1006
- *
1007
- * For example:
1008
- *
1009
- * ```javascript
1010
- * "overrides": [
1011
- * // Force `*.hrr` and `*.crr` files to be treated as `cpp` files:
1012
- * {
1013
- * "filename": "**​/{*.hrr,*.crr}",
1014
- * "languageId": "cpp"
1015
- * },
1016
- * // Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
1017
- * {
1018
- * "language": "nl",
1019
- * "filename": "**​/dutch/**​/*.txt"
1020
- * }
1021
- * ]
1022
- * ```
1023
- */
1024
- overrides?: OverrideSettings[];
1167
+ /**
1168
+ * Overrides are used to apply settings for specific files in your project.
1169
+ *
1170
+ * For example:
1171
+ *
1172
+ * ```javascript
1173
+ * "overrides": [
1174
+ * // Force `*.hrr` and `*.crr` files to be treated as `cpp` files:
1175
+ * {
1176
+ * "filename": "**​/{*.hrr,*.crr}",
1177
+ * "languageId": "cpp"
1178
+ * },
1179
+ * // Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
1180
+ * {
1181
+ * "language": "nl",
1182
+ * "filename": "**​/dutch/**​/*.txt"
1183
+ * }
1184
+ * ]
1185
+ * ```
1186
+ */
1187
+ overrides?: OverrideSettings[];
1025
1188
  }
1026
1189
  interface SpellCheckerExtensionSettings {
1027
- /**
1028
- * Specify a list of file types to spell check. It is better to use {@link Settings.enabledFileTypes} to Enable / Disable checking files types.
1029
- * @title Enabled Language Ids
1030
- * @uniqueItems true
1031
- */
1032
- enabledLanguageIds?: LanguageIdSingle[];
1033
- /**
1034
- * Enable / Disable checking file types (languageIds).
1035
- *
1036
- * These are in additional to the file types specified by {@link Settings.enabledLanguageIds}.
1037
- * To disable a language, prefix with `!` as in `!json`,
1038
- *
1039
- *
1040
- * **Example: individual file types**
1041
- *
1042
- * ```
1043
- * jsonc // enable checking for jsonc
1044
- * !json // disable checking for json
1045
- * kotlin // enable checking for kotlin
1046
- * ```
1047
- *
1048
- * **Example: enable all file types**
1049
- *
1050
- * ```
1051
- * * // enable checking for all file types
1052
- * !json // except for json
1053
- * ```
1054
- * @title Enable File Types
1055
- * @scope resource
1056
- * @uniqueItems true
1057
- */
1058
- enableFiletypes?: LanguageIdSingle[];
1059
- /**
1060
- * Enable / Disable checking file types (languageIds).
1061
- *
1062
- * This setting replaces: {@link Settings.enabledLanguageIds} and {@link Settings.enableFiletypes}.
1063
- *
1064
- * A Value of:
1065
- * - `true` - enable checking for the file type
1066
- * - `false` - disable checking for the file type
1067
- *
1068
- * A file type of `*` is a wildcard that enables all file types.
1069
- *
1070
- * **Example: enable all file types**
1071
- *
1072
- * | File Type | Enabled | Comment |
1073
- * | --------- | ------- | ------- |
1074
- * | `*` | `true` | Enable all file types. |
1075
- * | `json` | `false` | Disable checking for json files. |
1076
- *
1077
- * @title Enabled File Types to Check
1078
- * @since 8.8.1
1079
- */
1080
- enabledFileTypes?: Record<string, boolean>;
1190
+ // * @deprecated true
1191
+ // * @deprecationMessage - Use {@link Settings.enabledFileTypes} instead.
1192
+ /**
1193
+ * Specify a list of file types to spell check. It is better to use {@link Settings.enabledFileTypes} to Enable / Disable checking files types.
1194
+ * @title Enabled Language Ids
1195
+ * @uniqueItems true
1196
+ */
1197
+ enabledLanguageIds?: LanguageIdSingle[];
1198
+ // * @deprecated true
1199
+ // * @deprecationMessage - Use {@link Settings.enabledFileTypes} instead.
1200
+ /**
1201
+ * Enable / Disable checking file types (languageIds).
1202
+ *
1203
+ * These are in additional to the file types specified by {@link Settings.enabledLanguageIds}.
1204
+ * To disable a language, prefix with `!` as in `!json`,
1205
+ *
1206
+ *
1207
+ * **Example: individual file types**
1208
+ *
1209
+ * ```
1210
+ * jsonc // enable checking for jsonc
1211
+ * !json // disable checking for json
1212
+ * kotlin // enable checking for kotlin
1213
+ * ```
1214
+ *
1215
+ * **Example: enable all file types**
1216
+ *
1217
+ * ```
1218
+ * * // enable checking for all file types
1219
+ * !json // except for json
1220
+ * ```
1221
+ * @title Enable File Types
1222
+ * @scope resource
1223
+ * @uniqueItems true
1224
+ */
1225
+ enableFiletypes?: LanguageIdSingle[];
1226
+ /**
1227
+ * Enable / Disable checking file types (languageIds).
1228
+ *
1229
+ * This setting replaces: {@link Settings.enabledLanguageIds} and {@link Settings.enableFiletypes}.
1230
+ *
1231
+ * A Value of:
1232
+ * - `true` - enable checking for the file type
1233
+ * - `false` - disable checking for the file type
1234
+ *
1235
+ * A file type of `*` is a wildcard that enables all file types.
1236
+ *
1237
+ * **Example: enable all file types**
1238
+ *
1239
+ * | File Type | Enabled | Comment |
1240
+ * | --------- | ------- | ------- |
1241
+ * | `*` | `true` | Enable all file types. |
1242
+ * | `json` | `false` | Disable checking for json files. |
1243
+ *
1244
+ * @title Enabled File Types to Check
1245
+ * @since 8.8.1
1246
+ */
1247
+ enabledFileTypes?: Record<string, boolean>;
1081
1248
  }
1082
1249
  interface Settings extends ReportingConfiguration, BaseSetting, PnPSettings, SpellCheckerExtensionSettings {
1083
- /**
1084
- * Current active spelling language. This specifies the language locale to use in choosing the
1085
- * general dictionary.
1086
- *
1087
- * For example:
1088
- *
1089
- * - "en-GB" for British English.
1090
- * - "en,nl" to enable both English and Dutch.
1091
- *
1092
- * @default "en"
1093
- */
1094
- language?: LocaleId;
1095
- /**
1096
- * Additional settings for individual languages.
1097
- *
1098
- * See [Language Settings](https://cspell.org/configuration/language-settings/) for more details.
1099
- *
1100
- */
1101
- languageSettings?: LanguageSetting[];
1102
- /** Forces the spell checker to assume a give language id. Used mainly as an Override. */
1103
- languageId?: MatchingFileType;
1104
- /**
1105
- * By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false`
1106
- * will prevent ALL default configuration from being loaded.
1107
- *
1108
- * @default true
1109
- */
1110
- loadDefaultConfiguration?: boolean;
1111
- }
1112
- interface ReportingConfiguration extends ReporterConfigurationBase, SuggestionsConfiguration {
1113
- }
1114
- interface SuggestionsConfiguration {
1115
- /**
1116
- * Number of suggestions to make.
1117
- *
1118
- * @default 10
1119
- */
1120
- numSuggestions?: number;
1121
- /**
1122
- * The maximum amount of time in milliseconds to generate suggestions for a word.
1123
- *
1124
- * @default 500
1125
- */
1126
- suggestionsTimeout?: number;
1127
- /**
1128
- * The maximum number of changes allowed on a word to be considered a suggestions.
1129
- *
1130
- * For example, appending an `s` onto `example` -> `examples` is considered 1 change.
1131
- *
1132
- * Range: between 1 and 5.
1133
- *
1134
- * @default 3
1135
- */
1136
- suggestionNumChanges?: number;
1250
+ /**
1251
+ * Current active spelling language. This specifies the language locale to use in choosing the
1252
+ * general dictionary.
1253
+ *
1254
+ * For example:
1255
+ *
1256
+ * - "en-GB" for British English.
1257
+ * - "en,nl" to enable both English and Dutch.
1258
+ *
1259
+ * @default "en"
1260
+ */
1261
+ language?: LocaleId;
1262
+ /**
1263
+ * Additional settings for individual languages.
1264
+ *
1265
+ * See [Language Settings](https://cspell.org/configuration/language-settings/) for more details.
1266
+ *
1267
+ */
1268
+ languageSettings?: LanguageSetting[];
1269
+ /** Forces the spell checker to assume a give language id. Used mainly as an Override. */
1270
+ languageId?: MatchingFileType;
1271
+ /**
1272
+ * By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false`
1273
+ * will prevent ALL default configuration from being loaded.
1274
+ *
1275
+ * @default true
1276
+ */
1277
+ loadDefaultConfiguration?: boolean;
1137
1278
  }
1138
1279
  /**
1139
- * Plug N Play settings to support package systems like Yarn 2.
1140
- */
1280
+ * Plug N Play settings to support package systems like Yarn 2.
1281
+ */
1141
1282
  interface PnPSettings {
1142
- /**
1143
- * Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading
1144
- * packages stored in the repository.
1145
- *
1146
- * When true, the spell checker will search up the directory structure for the existence
1147
- * of a PnP file and load it.
1148
- *
1149
- * @default false
1150
- */
1151
- usePnP?: boolean;
1152
- /**
1153
- * The PnP files to search for. Note: `.mjs` files are not currently supported.
1154
- *
1155
- * @default [".pnp.js", ".pnp.cjs"]
1156
- */
1157
- pnpFiles?: string[];
1283
+ /**
1284
+ * Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading
1285
+ * packages stored in the repository.
1286
+ *
1287
+ * When true, the spell checker will search up the directory structure for the existence
1288
+ * of a PnP file and load it.
1289
+ *
1290
+ * @default false
1291
+ */
1292
+ usePnP?: boolean;
1293
+ /**
1294
+ * The PnP files to search for. Note: `.mjs` files are not currently supported.
1295
+ *
1296
+ * @default [".pnp.js", ".pnp.cjs"]
1297
+ */
1298
+ pnpFiles?: string[];
1158
1299
  }
1159
1300
  /**
1160
- * The Strategy to use to detect if a file has changed.
1161
- * - `content` - uses a hash of the file content to check file changes (slower - more accurate).
1162
- * - `metadata` - uses the file system timestamp and size to detect changes (fastest, may not work in CI).
1163
- * @default 'content'
1164
- */
1165
- type CacheStrategy = 'content' | 'metadata';
1166
- type CacheFormat = 'legacy' | 'universal';
1301
+ * The Strategy to use to detect if a file has changed.
1302
+ * - `content` - uses a hash of the file content to check file changes (slower - more accurate).
1303
+ * - `metadata` - uses the file system timestamp and size to detect changes (fastest, may not work in CI).
1304
+ * @default 'content'
1305
+ */
1306
+ type CacheStrategy = "content" | "metadata";
1307
+ type CacheFormat = "legacy" | "universal";
1167
1308
  interface CacheSettings {
1168
- /**
1169
- * Store the results of processed files in order to only operate on the changed ones.
1170
- * @default false
1171
- */
1172
- useCache?: boolean;
1173
- /**
1174
- * Path to the cache location. Can be a file or a directory.
1175
- * If none specified `.cspellcache` will be used.
1176
- * Relative paths are relative to the config file in which it
1177
- * is defined.
1178
- *
1179
- * A prefix of `${cwd}` is replaced with the current working directory.
1180
- */
1181
- cacheLocation?: FSPathResolvable;
1182
- /**
1183
- * Strategy to use for detecting changed files, default: metadata
1184
- * @default 'metadata'
1185
- */
1186
- cacheStrategy?: CacheStrategy;
1187
- /**
1188
- * Format of the cache file.
1189
- * - `legacy` - use absolute paths in the cache file
1190
- * - `universal` - use a sharable format.
1191
- * @default 'universal'
1192
- */
1193
- cacheFormat?: CacheFormat | undefined;
1309
+ /**
1310
+ * Store the results of processed files in order to only operate on the changed ones.
1311
+ * @default false
1312
+ */
1313
+ useCache?: boolean;
1314
+ // cspell:word cspellcache
1315
+ /**
1316
+ * Path to the cache location. Can be a file or a directory.
1317
+ * If none specified `.cspellcache` will be used.
1318
+ * Relative paths are relative to the config file in which it
1319
+ * is defined.
1320
+ *
1321
+ * A prefix of `${cwd}` is replaced with the current working directory.
1322
+ */
1323
+ cacheLocation?: FSPathResolvable;
1324
+ /**
1325
+ * Strategy to use for detecting changed files, default: metadata
1326
+ * @default 'metadata'
1327
+ */
1328
+ cacheStrategy?: CacheStrategy;
1329
+ /**
1330
+ * Format of the cache file.
1331
+ * - `legacy` - use absolute paths in the cache file
1332
+ * - `universal` - use a sharable format.
1333
+ * @default 'universal'
1334
+ */
1335
+ cacheFormat?: CacheFormat | undefined;
1194
1336
  }
1195
1337
  /**
1196
- * These are settings only used by the command line application.
1197
- */
1338
+ * These are settings only used by the command line application.
1339
+ */
1198
1340
  interface CommandLineSettings {
1199
- /**
1200
- * Define cache settings.
1201
- */
1202
- cache?: CacheSettings;
1203
- /**
1204
- * Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
1205
- * @default false
1206
- */
1207
- failFast?: boolean;
1341
+ /**
1342
+ * Define cache settings.
1343
+ */
1344
+ cache?: CacheSettings;
1345
+ /**
1346
+ * Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
1347
+ * @default false
1348
+ */
1349
+ failFast?: boolean;
1208
1350
  }
1209
1351
  /**
1210
- * To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
1211
- * are use to set the trust levels.
1212
- *
1213
- * Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
1214
- * In an untrusted location, these files will NOT be used.
1215
- *
1216
- * This will also prevent any associated plugins from being loaded.
1217
- */
1352
+ * To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
1353
+ * are use to set the trust levels.
1354
+ *
1355
+ * Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
1356
+ * In an untrusted location, these files will NOT be used.
1357
+ *
1358
+ * This will also prevent any associated plugins from being loaded.
1359
+ */
1218
1360
  interface WorkspaceTrustSettings {
1219
- /**
1220
- * Glob patterns of locations that contain ALWAYS trusted files.
1221
- */
1222
- trustedFiles?: Glob[];
1223
- /**
1224
- * Glob patterns of locations that contain NEVER trusted files.
1225
- */
1226
- untrustedFiles?: Glob[];
1227
- /**
1228
- * Sets the default trust level.
1229
- * @default "trusted"
1230
- */
1231
- trustLevel?: TrustLevel;
1361
+ /**
1362
+ * Glob patterns of locations that contain ALWAYS trusted files.
1363
+ */
1364
+ trustedFiles?: Glob[];
1365
+ /**
1366
+ * Glob patterns of locations that contain NEVER trusted files.
1367
+ */
1368
+ untrustedFiles?: Glob[];
1369
+ /**
1370
+ * Sets the default trust level.
1371
+ * @default "trusted"
1372
+ */
1373
+ trustLevel?: TrustLevel;
1232
1374
  }
1233
1375
  /**
1234
- * VS Code Spell Checker Settings.
1235
- * To be Removed.
1236
- * @deprecated true
1237
- */
1376
+ * VS Code Spell Checker Settings.
1377
+ * To be Removed.
1378
+ * @deprecated true
1379
+ */
1238
1380
  interface LegacySettings {
1239
- /**
1240
- * Show status.
1241
- * @deprecated true
1242
- */
1243
- showStatus?: boolean;
1244
- /**
1245
- * Delay in ms after a document has changed before checking it for spelling errors.
1246
- * @deprecated true
1247
- */
1248
- spellCheckDelayMs?: number;
1381
+ /**
1382
+ * Show status.
1383
+ * @deprecated true
1384
+ */
1385
+ showStatus?: boolean;
1386
+ /**
1387
+ * Delay in ms after a document has changed before checking it for spelling errors.
1388
+ * @deprecated true
1389
+ */
1390
+ spellCheckDelayMs?: number;
1249
1391
  }
1250
1392
  interface OverrideSettings extends Settings, OverrideFilterFields {
1251
- /** Sets the programming language id to match file type. */
1252
- languageId?: MatchingFileType;
1253
- /** Sets the locale. */
1254
- language?: LocaleId;
1393
+ /** Sets the programming language id to match file type. */
1394
+ languageId?: MatchingFileType;
1395
+ /** Sets the locale. */
1396
+ language?: LocaleId;
1255
1397
  }
1256
1398
  interface OverrideFilterFields {
1257
- /** Glob pattern or patterns to match against. */
1258
- filename: Glob | Glob[];
1259
- }
1260
- interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings {
1261
- /** Optional identifier. */
1262
- id?: string;
1263
- /** Optional name of configuration. */
1264
- name?: string;
1265
- /** Optional description of configuration. */
1266
- description?: string;
1267
- /**
1268
- * Is the spell checker enabled.
1269
- * @default true
1270
- */
1271
- enabled?: boolean;
1272
- /**
1273
- * True to enable compound word checking.
1274
- *
1275
- * @default false
1276
- */
1277
- allowCompoundWords?: boolean;
1278
- /**
1279
- * Determines if words must match case and accent rules.
1280
- *
1281
- * See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.
1282
- *
1283
- * - `false` - Case is ignored and accents can be missing on the entire word.
1284
- * Incorrect accents or partially missing accents will be marked as incorrect.
1285
- * - `true` - Case and accents are enforced.
1286
- *
1287
- * @default false
1288
- */
1289
- caseSensitive?: boolean;
1290
- /**
1291
- * Define additional available dictionaries.
1292
- *
1293
- * For example, you can use the following to add a custom dictionary:
1294
- *
1295
- * ```json
1296
- * "dictionaryDefinitions": [
1297
- * { "name": "custom-words", "path": "./custom-words.txt"}
1298
- * ],
1299
- * "dictionaries": ["custom-words"]
1300
- * ```
1301
- */
1302
- dictionaryDefinitions?: DictionaryDefinition[];
1303
- /**
1304
- * Optional list of dictionaries to use. Each entry should match the name of the dictionary.
1305
- *
1306
- * To remove a dictionary from the list, add `!` before the name.
1307
- *
1308
- * For example, `!typescript` will turn off the dictionary with the name `typescript`.
1309
- *
1310
- * See the [Dictionaries](https://cspell.org/docs/dictionaries/)
1311
- * and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.
1312
- */
1313
- dictionaries?: DictionaryReference[];
1314
- /**
1315
- * Optional list of dictionaries that will not be used for suggestions.
1316
- * Words in these dictionaries are considered correct, but will not be
1317
- * used when making spell correction suggestions.
1318
- *
1319
- * Note: if a word is suggested by another dictionary, but found in
1320
- * one of these dictionaries, it will be removed from the set of
1321
- * possible suggestions.
1322
- */
1323
- noSuggestDictionaries?: DictionaryReference[];
1324
- /**
1325
- * List of regular expression patterns or pattern names to exclude from spell checking.
1326
- *
1327
- * Example: `["href"]` - to exclude html href pattern.
1328
- *
1329
- * Regular expressions use JavaScript regular expression syntax.
1330
- *
1331
- * Example: to ignore ALL-CAPS words
1332
- *
1333
- * JSON
1334
- * ```json
1335
- * "ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
1336
- * ```
1337
- *
1338
- * YAML
1339
- * ```yaml
1340
- * ignoreRegExpList:
1341
- * - >-
1342
- * /\b[A-Z]+\b/g
1343
- * ```
1344
- *
1345
- * By default, several patterns are excluded. See
1346
- * [Configuration](https://cspell.org/configuration/patterns) for more details.
1347
- *
1348
- * While you can create your own patterns, you can also leverage several patterns that are
1349
- * [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
1350
- */
1351
- ignoreRegExpList?: RegExpPatternList;
1352
- /**
1353
- * List of regular expression patterns or defined pattern names to match for spell checking.
1354
- *
1355
- * If this property is defined, only text matching the included patterns will be checked.
1356
- *
1357
- * While you can create your own patterns, you can also leverage several patterns that are
1358
- * [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
1359
- */
1360
- includeRegExpList?: RegExpPatternList;
1361
- /**
1362
- * Defines a list of patterns that can be used with the {@link ignoreRegExpList} and
1363
- * {@link includeRegExpList} options.
1364
- *
1365
- * For example:
1366
- *
1367
- * ```javascript
1368
- * "ignoreRegExpList": ["comments"],
1369
- * "patterns": [
1370
- * {
1371
- * "name": "comment-single-line",
1372
- * "pattern": "/#.*​/g"
1373
- * },
1374
- * {
1375
- * "name": "comment-multi-line",
1376
- * "pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
1377
- * },
1378
- * // You can also combine multiple named patterns into one single named pattern
1379
- * {
1380
- * "name": "comments",
1381
- * "pattern": ["comment-single-line", "comment-multi-line"]
1382
- * }
1383
- * ]
1384
- * ```
1385
- */
1386
- patterns?: RegExpPatternDefinition[];
1387
- }
1388
- interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {
1389
- }
1390
- interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {
1391
- }
1399
+ /** Glob pattern or patterns to match against. */
1400
+ filename: Glob | Glob[];
1401
+ }
1402
+ interface BaseSetting extends InlineDictionary, ExperimentalBaseSettings, UnknownWordsConfiguration {
1403
+ /** Optional identifier. */
1404
+ id?: string;
1405
+ /** Optional name of configuration. */
1406
+ name?: string;
1407
+ /** Optional description of configuration. */
1408
+ description?: string;
1409
+ /**
1410
+ * Is the spell checker enabled.
1411
+ * @default true
1412
+ */
1413
+ enabled?: boolean;
1414
+ /**
1415
+ * True to enable compound word checking.
1416
+ *
1417
+ * @default false
1418
+ */
1419
+ allowCompoundWords?: boolean;
1420
+ /**
1421
+ * Determines if words must match case and accent rules.
1422
+ *
1423
+ * See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.
1424
+ *
1425
+ * - `false` - Case is ignored and accents can be missing on the entire word.
1426
+ * Incorrect accents or partially missing accents will be marked as incorrect.
1427
+ * - `true` - Case and accents are enforced.
1428
+ *
1429
+ * @default false
1430
+ */
1431
+ caseSensitive?: boolean;
1432
+ /**
1433
+ * Define additional available dictionaries.
1434
+ *
1435
+ * For example, you can use the following to add a custom dictionary:
1436
+ *
1437
+ * ```json
1438
+ * "dictionaryDefinitions": [
1439
+ * { "name": "custom-words", "path": "./custom-words.txt"}
1440
+ * ],
1441
+ * "dictionaries": ["custom-words"]
1442
+ * ```
1443
+ */
1444
+ dictionaryDefinitions?: DictionaryDefinition[];
1445
+ /**
1446
+ * Optional list of dictionaries to use. Each entry should match the name of the dictionary.
1447
+ *
1448
+ * To remove a dictionary from the list, add `!` before the name.
1449
+ *
1450
+ * For example, `!typescript` will turn off the dictionary with the name `typescript`.
1451
+ *
1452
+ * See the [Dictionaries](https://cspell.org/docs/dictionaries/)
1453
+ * and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.
1454
+ */
1455
+ dictionaries?: DictionaryReference[];
1456
+ /**
1457
+ * Optional list of dictionaries that will not be used for suggestions.
1458
+ * Words in these dictionaries are considered correct, but will not be
1459
+ * used when making spell correction suggestions.
1460
+ *
1461
+ * Note: if a word is suggested by another dictionary, but found in
1462
+ * one of these dictionaries, it will be removed from the set of
1463
+ * possible suggestions.
1464
+ */
1465
+ noSuggestDictionaries?: DictionaryReference[];
1466
+ /**
1467
+ * List of regular expression patterns or pattern names to exclude from spell checking.
1468
+ *
1469
+ * Example: `["href"]` - to exclude html href pattern.
1470
+ *
1471
+ * Regular expressions use JavaScript regular expression syntax.
1472
+ *
1473
+ * Example: to ignore ALL-CAPS words
1474
+ *
1475
+ * JSON
1476
+ * ```json
1477
+ * "ignoreRegExpList": ["/\\b[A-Z]+\\b/g"]
1478
+ * ```
1479
+ *
1480
+ * YAML
1481
+ * ```yaml
1482
+ * ignoreRegExpList:
1483
+ * - >-
1484
+ * /\b[A-Z]+\b/g
1485
+ * ```
1486
+ *
1487
+ * By default, several patterns are excluded. See
1488
+ * [Configuration](https://cspell.org/configuration/patterns) for more details.
1489
+ *
1490
+ * While you can create your own patterns, you can also leverage several patterns that are
1491
+ * [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
1492
+ */
1493
+ ignoreRegExpList?: RegExpPatternList;
1494
+ /**
1495
+ * List of regular expression patterns or defined pattern names to match for spell checking.
1496
+ *
1497
+ * If this property is defined, only text matching the included patterns will be checked.
1498
+ *
1499
+ * While you can create your own patterns, you can also leverage several patterns that are
1500
+ * [built-in to CSpell](https://cspell.org/types/cspell-types/types/PredefinedPatterns.html).
1501
+ */
1502
+ includeRegExpList?: RegExpPatternList;
1503
+ /**
1504
+ * Defines a list of patterns that can be used with the {@link ignoreRegExpList} and
1505
+ * {@link includeRegExpList} options.
1506
+ *
1507
+ * For example:
1508
+ *
1509
+ * ```javascript
1510
+ * "ignoreRegExpList": ["comments"],
1511
+ * "patterns": [
1512
+ * {
1513
+ * "name": "comment-single-line",
1514
+ * "pattern": "/#.*​/g"
1515
+ * },
1516
+ * {
1517
+ * "name": "comment-multi-line",
1518
+ * "pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
1519
+ * },
1520
+ * // You can also combine multiple named patterns into one single named pattern
1521
+ * {
1522
+ * "name": "comments",
1523
+ * "pattern": ["comment-single-line", "comment-multi-line"]
1524
+ * }
1525
+ * ]
1526
+ * ```
1527
+ */
1528
+ patterns?: RegExpPatternDefinition[];
1529
+ }
1530
+ interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {}
1531
+ interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {}
1392
1532
  interface LanguageSettingFilterFieldsPreferred {
1393
- /** The language id. Ex: `typescript`, `html`, or `php`. `*` -- will match all languages. */
1394
- languageId: MatchingFileType;
1395
- /** The locale filter, matches against the language. This can be a comma separated list. `*` will match all locales. */
1396
- locale?: LocaleId | LocaleId[];
1533
+ /** The language id. Ex: `typescript`, `html`, or `php`. `*` -- will match all languages. */
1534
+ languageId: MatchingFileType;
1535
+ /** The locale filter, matches against the language. This can be a comma separated list. `*` will match all locales. */
1536
+ locale?: LocaleId | LocaleId[];
1397
1537
  }
1398
1538
  interface LanguageSettingFilterFieldsDeprecated {
1399
- /** The language id. Ex: `typescript`, `html`, or `php`. `*` -- will match all languages. */
1400
- languageId: MatchingFileType;
1401
- /**
1402
- * Deprecated - The locale filter, matches against the language. This can be a comma separated list. `*` will match all locales.
1403
- * @deprecated true
1404
- * @deprecationMessage Use `locale` instead.
1405
- */
1406
- local?: LocaleId | LocaleId[];
1539
+ /** The language id. Ex: `typescript`, `html`, or `php`. `*` -- will match all languages. */
1540
+ languageId: MatchingFileType;
1541
+ /**
1542
+ * Deprecated - The locale filter, matches against the language. This can be a comma separated list. `*` will match all locales.
1543
+ * @deprecated true
1544
+ * @deprecationMessage Use `locale` instead.
1545
+ */
1546
+ local?: LocaleId | LocaleId[];
1407
1547
  }
1408
1548
  /** @hidden */
1409
1549
  type InternalRegExp = RegExp;
1410
1550
  type Pattern = string | InternalRegExp;
1411
- 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';
1551
+ 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";
1412
1552
  /** This matches the name in a pattern definition. */
1413
1553
  type PatternId = string;
1414
1554
  /** A PatternRef is a Pattern or PatternId. */
@@ -1418,249 +1558,250 @@ type RegExpPatternList = PatternRef[];
1418
1558
  /** This is a written language locale like: `en`, `en-GB`, `fr`, `es`, `de` or `en,fr` for both English and French */
1419
1559
  type LocaleId = string;
1420
1560
  /**
1421
- * Configuration File Version.
1422
- */
1423
- type VersionLatest = '0.2';
1561
+ * Configuration File Version.
1562
+ */
1563
+ type VersionLatest = "0.2";
1424
1564
  /**
1425
- * Legacy Configuration File Versions.
1426
- * @deprecated true
1427
- * @deprecationMessage Use `0.2` instead.
1428
- */
1429
- type VersionLegacy = '0.1';
1565
+ * Legacy Configuration File Versions.
1566
+ * @deprecated true
1567
+ * @deprecationMessage Use `0.2` instead.
1568
+ */
1569
+ type VersionLegacy = "0.1";
1430
1570
  type Version = VersionLatest | VersionLegacy;
1431
1571
  /**
1432
- * @deprecated true
1433
- * @deprecationMessage Use `LocaleId` instead.
1434
- */
1572
+ * @deprecated true
1573
+ * @deprecationMessage Use `LocaleId` instead.
1574
+ */
1435
1575
  type LocalId = LocaleId;
1436
1576
  /** These are glob expressions. */
1437
1577
  type Glob = SimpleGlob | GlobDef;
1438
1578
  /** Simple Glob string, the root will be globRoot. */
1439
1579
  type SimpleGlob = string;
1440
1580
  /**
1441
- * Used to define fully qualified glob patterns.
1442
- * It is currently hidden to make the json-schema a bit easier to use
1443
- * when crafting cspell.json files by hand.
1444
- * @hidden
1445
- */
1581
+ * Used to define fully qualified glob patterns.
1582
+ * It is currently hidden to make the json-schema a bit easier to use
1583
+ * when crafting cspell.json files by hand.
1584
+ * @hidden
1585
+ */
1446
1586
  interface GlobDef {
1447
- /** Glob pattern to match. */
1448
- glob: string;
1449
- /** Optional root to use when matching the glob. Defaults to current working dir. */
1450
- root?: string;
1451
- /**
1452
- * Optional source of the glob, used when merging settings to determine the origin.
1453
- * @hidden
1454
- */
1455
- source?: string;
1587
+ /** Glob pattern to match. */
1588
+ glob: string;
1589
+ /** Optional root to use when matching the glob. Defaults to current working dir. */
1590
+ root?: string;
1591
+ /**
1592
+ * Optional source of the glob, used when merging settings to determine the origin.
1593
+ * @hidden
1594
+ */
1595
+ source?: string;
1456
1596
  }
1457
1597
  /**
1458
- * A file type:
1459
- * - `*` - will match ALL file types.
1460
- * - `typescript`, `cpp`, `json`, etc.
1461
- * @pattern ^(!?[-\w_\s]+)|(\*)$
1462
- */
1598
+ * A file type:
1599
+ * - `*` - will match ALL file types.
1600
+ * - `typescript`, `cpp`, `json`, etc.
1601
+ * @pattern ^(!?[-\w_\s]+)|(\*)$
1602
+ */
1463
1603
  type LanguageIdSingle = string;
1464
1604
  /**
1465
- * A single string with a comma separated list of file types:
1466
- * - `typescript,cpp`
1467
- * - `json,jsonc,yaml`
1468
- * - etc.
1469
- * @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
1470
- */
1605
+ * A single string with a comma separated list of file types:
1606
+ * - `typescript,cpp`
1607
+ * - `json,jsonc,yaml`
1608
+ * - etc.
1609
+ * @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
1610
+ */
1471
1611
  type LanguageIdMultiple = string;
1472
1612
  /**
1473
- * A Negative File Type used to exclude files of that type.
1474
- * - `!typescript` - will exclude typescript files.
1475
- * - `!cpp,!json` - will exclude cpp and json files.
1476
- * - `!typescript,javascript` - will exclude typescript files and include javascript files.
1477
- * @pattern ^(![-\w_\s]+)(,!?[-\w_\s]+)*$
1478
- */
1613
+ * A Negative File Type used to exclude files of that type.
1614
+ * - `!typescript` - will exclude typescript files.
1615
+ * - `!cpp,!json` - will exclude cpp and json files.
1616
+ * - `!typescript,javascript` - will exclude typescript files and include javascript files.
1617
+ * @pattern ^(![-\w_\s]+)(,!?[-\w_\s]+)*$
1618
+ */
1479
1619
  type LanguageIdMultipleNeg = string;
1480
1620
  type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
1481
1621
  type MatchingFileType = LanguageId | LanguageId[];
1482
1622
  /**
1483
- * A File System Path. Relative paths are relative to the configuration file.
1484
- */
1623
+ * A File System Path. Relative paths are relative to the configuration file.
1624
+ */
1485
1625
  type FsPath = string;
1486
1626
  /**
1487
- * A File System Path.
1488
- *
1489
- * Special Properties:
1490
- * - `${cwd}` prefix - will be replaced with the current working directory.
1491
- * - Relative paths are relative to the configuration file.
1492
- */
1627
+ * A File System Path.
1628
+ *
1629
+ * Special Properties:
1630
+ * - `${cwd}` prefix - will be replaced with the current working directory.
1631
+ * - Relative paths are relative to the configuration file.
1632
+ */
1493
1633
  type FSPathResolvable = FsPath;
1494
1634
  /** Trust Security Level. */
1495
- type TrustLevel = 'trusted' | 'untrusted';
1635
+ type TrustLevel = "trusted" | "untrusted";
1496
1636
  interface RegExpPatternDefinition {
1497
- /**
1498
- * Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
1499
- * It is possible to redefine one of the predefined patterns to override its value.
1500
- */
1501
- name: PatternId;
1502
- /**
1503
- * RegExp pattern or array of RegExp patterns.
1504
- */
1505
- pattern: Pattern | Pattern[];
1506
- /**
1507
- * Description of the pattern.
1508
- */
1509
- description?: string | undefined;
1637
+ /**
1638
+ * Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
1639
+ * It is possible to redefine one of the predefined patterns to override its value.
1640
+ */
1641
+ name: PatternId;
1642
+ /**
1643
+ * RegExp pattern or array of RegExp patterns.
1644
+ */
1645
+ pattern: Pattern | Pattern[];
1646
+ /**
1647
+ * Description of the pattern.
1648
+ */
1649
+ description?: string | undefined;
1510
1650
  }
1511
1651
  type CSpellUserSettingsWithComments = CSpellUserSettings;
1652
+ // Remove BaseSource from the Source list when the code is ready.
1512
1653
  type Source = FileSource | MergeSource | InMemorySource | BaseSource;
1513
1654
  interface FileSource extends BaseSource {
1514
- /** Name of source. */
1515
- name: string;
1516
- /** Filename if this came from a file. */
1517
- filename: string;
1518
- /** The two settings that were merged to. */
1519
- sources?: undefined;
1520
- /** The configuration read. */
1521
- fileSource: CSpellSettings;
1655
+ /** Name of source. */
1656
+ name: string;
1657
+ /** Filename if this came from a file. */
1658
+ filename: string;
1659
+ /** The two settings that were merged to. */
1660
+ sources?: undefined;
1661
+ /** The configuration read. */
1662
+ fileSource: CSpellSettings;
1522
1663
  }
1523
1664
  interface MergeSource extends BaseSource {
1524
- /** Name of source. */
1525
- name: string;
1526
- /** Filename if this came from a file. */
1527
- filename?: undefined;
1528
- /** The two settings that were merged to. */
1529
- sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
1530
- /** The configuration read. */
1531
- fileSource?: undefined;
1665
+ /** Name of source. */
1666
+ name: string;
1667
+ /** Filename if this came from a file. */
1668
+ filename?: undefined;
1669
+ /** The two settings that were merged to. */
1670
+ sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
1671
+ /** The configuration read. */
1672
+ fileSource?: undefined;
1532
1673
  }
1533
1674
  interface InMemorySource extends BaseSource {
1534
- /** Name of source. */
1535
- name: string;
1536
- /** Filename if this came from a file. */
1537
- filename?: undefined;
1538
- /** The two settings that were merged to. */
1539
- sources?: undefined;
1540
- /** The configuration read. */
1541
- fileSource?: undefined;
1675
+ /** Name of source. */
1676
+ name: string;
1677
+ /** Filename if this came from a file. */
1678
+ filename?: undefined;
1679
+ /** The two settings that were merged to. */
1680
+ sources?: undefined;
1681
+ /** The configuration read. */
1682
+ fileSource?: undefined;
1542
1683
  }
1543
1684
  interface BaseSource {
1544
- /** Name of source. */
1545
- name: string;
1546
- /** Filename if this came from a file. */
1547
- filename?: string | undefined;
1548
- /** The two settings that were merged to. */
1549
- sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings] | undefined;
1550
- /** The configuration read. */
1551
- fileSource?: CSpellSettings | undefined;
1685
+ /** Name of source. */
1686
+ name: string;
1687
+ /** Filename if this came from a file. */
1688
+ filename?: string | undefined;
1689
+ /** The two settings that were merged to. */
1690
+ sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings] | undefined;
1691
+ /** The configuration read. */
1692
+ fileSource?: CSpellSettings | undefined;
1552
1693
  }
1553
1694
  /**
1554
- * The module or path to the the reporter to load.
1555
- */
1695
+ * The module or path to the the reporter to load.
1696
+ */
1556
1697
  type ReporterModuleName = string;
1557
1698
  /**
1558
- * Options to send to the reporter. These are defined by the reporter.
1559
- */
1699
+ * Options to send to the reporter. These are defined by the reporter.
1700
+ */
1560
1701
  type ReporterOptions = Serializable;
1561
1702
  /**
1562
- * Declare a reporter to use.
1563
- *
1564
- * `default` - is a special name for the default cli reporter.
1565
- *
1566
- * Examples:
1567
- * - `"default"` - to use the default reporter
1568
- * - `"@cspell/cspell-json-reporter"` - use the cspell JSON reporter.
1569
- * - `["@cspell/cspell-json-reporter", { "outFile": "out.json" }]`
1570
- */
1703
+ * Declare a reporter to use.
1704
+ *
1705
+ * `default` - is a special name for the default cli reporter.
1706
+ *
1707
+ * Examples:
1708
+ * - `"default"` - to use the default reporter
1709
+ * - `"@cspell/cspell-json-reporter"` - use the cspell JSON reporter.
1710
+ * - `["@cspell/cspell-json-reporter", { "outFile": "out.json" }]`
1711
+ */
1571
1712
  type ReporterSettings = ReporterModuleName | [name: ReporterModuleName] | [name: ReporterModuleName, options: ReporterOptions];
1572
1713
  /**
1573
- * Experimental Configuration / Options
1574
- *
1575
- * This Configuration is subject to change without warning.
1576
- * @experimental
1577
- * @hidden
1578
- */
1714
+ * Experimental Configuration / Options
1715
+ *
1716
+ * This Configuration is subject to change without warning.
1717
+ * @experimental
1718
+ * @hidden
1719
+ */
1579
1720
  interface ExperimentalFileSettings {
1580
- /**
1581
- * Future Plugin support
1582
- * @experimental
1583
- * @since 6.2.0
1584
- */
1585
- plugins?: Plugin[];
1721
+ /**
1722
+ * Future Plugin support
1723
+ * @experimental
1724
+ * @since 6.2.0
1725
+ */
1726
+ plugins?: Plugin[];
1586
1727
  }
1587
1728
  /**
1588
- * Extends CSpellSettings with {@link ExperimentalFileSettings}
1589
- * @experimental
1590
- * @hidden
1591
- */
1592
- interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {
1593
- }
1729
+ * Extends CSpellSettings with {@link ExperimentalFileSettings}
1730
+ * @experimental
1731
+ * @hidden
1732
+ */
1733
+ interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {}
1594
1734
  /**
1595
- * Experimental Configuration / Options
1596
- *
1597
- * This Configuration is subject to change without warning.
1598
- * @experimental
1599
- * @hidden
1600
- */
1735
+ * Experimental Configuration / Options
1736
+ *
1737
+ * This Configuration is subject to change without warning.
1738
+ * @experimental
1739
+ * @hidden
1740
+ */
1601
1741
  interface ExperimentalBaseSettings {
1602
- /**
1603
- * Parser to use for the file content
1604
- * @experimental
1605
- * @since 6.2.0
1606
- */
1607
- parser?: ParserName;
1742
+ /**
1743
+ * Parser to use for the file content
1744
+ * @experimental
1745
+ * @since 6.2.0
1746
+ */
1747
+ parser?: ParserName;
1608
1748
  }
1609
1749
  /**
1610
- * Plugin API
1611
- * @experimental
1612
- * @since 6.2.0
1613
- */
1750
+ * Plugin API
1751
+ * @experimental
1752
+ * @since 6.2.0
1753
+ */
1614
1754
  interface Plugin {
1615
- parsers?: Parser[];
1755
+ parsers?: Parser[];
1616
1756
  }
1617
-
1618
- type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
1619
- type CSpellUserSettingsFields = {
1620
- [key in ConfigKeys]: key;
1621
- };
1757
+ //#endregion
1758
+ //#region src/configFields.d.ts
1759
+ type ConfigKeys = Exclude<keyof CSpellUserSettings, "$schema" | "version" | "id">;
1760
+ type CSpellUserSettingsFields = { [key in ConfigKeys]: key };
1622
1761
  declare const ConfigFields: CSpellUserSettingsFields;
1623
-
1762
+ //#endregion
1763
+ //#region src/defaultConfigSettings.d.ts
1624
1764
  declare const defaultCSpellSettings: {
1625
- readonly ignoreRandomStrings: true;
1626
- readonly minRandomLength: 40;
1765
+ readonly ignoreRandomStrings: boolean;
1766
+ readonly minRandomLength: number;
1627
1767
  };
1628
-
1768
+ //#endregion
1769
+ //#region src/defineConfig.d.ts
1629
1770
  declare function defineConfig(config: CSpellSettings): CSpellSettings;
1630
-
1771
+ //#endregion
1772
+ //#region src/TextMap.d.ts
1631
1773
  type MappedText = Readonly<TransformedText>;
1632
1774
  type Range = readonly [start: number, end: number];
1633
1775
  interface Mapped {
1634
- /**
1635
- * `(i, j)` number pairs where
1636
- * - `i` is the offset in the source
1637
- * - `j` is the offset in the destination
1638
- *
1639
- * Example:
1640
- * - source text = `"caf\xe9"`
1641
- * - mapped text = `"café"`
1642
- * - map = `[3, 3, 7, 4]`, which is equivalent to `[0, 0, 3, 3, 7, 4]`
1643
- * where the `[0, 0]` is unnecessary.
1644
- *
1645
- */
1646
- map: number[];
1776
+ /**
1777
+ * `(i, j)` number pairs where
1778
+ * - `i` is the offset in the source
1779
+ * - `j` is the offset in the destination
1780
+ *
1781
+ * Example:
1782
+ * - source text = `"caf\xe9"`
1783
+ * - mapped text = `"café"`
1784
+ * - map = `[3, 3, 7, 4]`, which is equivalent to `[0, 0, 3, 3, 7, 4]`
1785
+ * where the `[0, 0]` is unnecessary.
1786
+ *
1787
+ */
1788
+ map: number[];
1647
1789
  }
1648
1790
  interface TransformedText extends PartialOrUndefined<Mapped> {
1649
- /**
1650
- * Transformed text with an optional map.
1651
- */
1652
- text: string;
1653
- /**
1654
- * The original text
1655
- */
1656
- rawText?: string | undefined;
1657
- /**
1658
- * The start and end offset of the text in the document.
1659
- */
1660
- range: Range;
1661
- }
1662
- type PartialOrUndefined<T> = {
1663
- [P in keyof T]?: T[P] | undefined;
1664
- };
1665
-
1666
- export { type AdvancedCSpellSettings, type AdvancedCSpellSettingsWithSourceTrace, type BaseSetting, type CSpellPackageSettings, type CSpellReporter, type CSpellReporterModule, type CSpellSettings, type CSpellSettingsWithSourceTrace, type CSpellUserSettings, type CSpellUserSettingsFields, type CSpellUserSettingsWithComments, type CacheFormat, type CacheSettings, type CacheStrategy, type CharacterSet, type CharacterSetCosts, type CommandLineSettings, ConfigFields, type CustomDictionaryPath, type CustomDictionaryScope, type DebugEmitter, type DictionaryDefinition, type DictionaryDefinitionAlternate, type DictionaryDefinitionAugmented, type DictionaryDefinitionBase, type DictionaryDefinitionCustom, type DictionaryDefinitionInline, type DictionaryDefinitionInlineFlagWords, type DictionaryDefinitionInlineIgnoreWords, type DictionaryDefinitionInlineWords, type DictionaryDefinitionLegacy, type DictionaryDefinitionPreferred, type DictionaryDefinitionSimple, type DictionaryFileTypes, type DictionaryId, type DictionaryInformation, type DictionaryNegRef, type DictionaryPath, type DictionaryRef, type DictionaryReference, type EditCosts, type ErrorEmitter, type ErrorLike, type ExperimentalBaseSettings, type ExperimentalFileSettings, type ExtendableSettings, type FSPathResolvable, type Feature, type Features, type FileSettings, type FileSource, type FsPath, type Glob, type GlobDef, type ImportFileRef, type InMemorySource, type Issue, IssueType, type LanguageId, type LanguageIdMultiple, type LanguageIdMultipleNeg, type LanguageIdSingle, type LanguageSetting, type LanguageSettingFilterFields, type LanguageSettingFilterFieldsDeprecated, type LanguageSettingFilterFieldsPreferred, type LegacySettings, type LocalId, type LocaleId, type MappedText, type MatchingFileType, type MergeSource, type MessageEmitter, type MessageType, type MessageTypeLookup, MessageTypes, type OverrideFilterFields, type OverrideSettings, Parser, ParserName, type Pattern, type PatternId, type PatternRef, type Plugin, type PnPSettings, type PredefinedPatterns, type ProgressBase, type ProgressEmitter, type ProgressFileBase, type ProgressFileBegin, type ProgressFileComplete, type ProgressItem, type ProgressTypes, type RegExpPatternDefinition, type RegExpPatternList, type ReplaceEntry, type ReplaceMap, type ReporterConfiguration, type ReporterSettings, type ReportingConfiguration, type ResultEmitter, type RunResult, type Settings, type SimpleGlob, type Source, type SpellingErrorEmitter, type SuggestionCostMapDef, type SuggestionCostsDefs, type SuggestionsConfiguration, type TextDocumentOffset, type TextOffset, type TrustLevel, type Version, type VersionLatest, type VersionLegacy, type WorkspaceTrustSettings, defaultCSpellSettings, defineConfig };
1791
+ /**
1792
+ * Transformed text with an optional map.
1793
+ */
1794
+ text: string;
1795
+ /**
1796
+ * The original text
1797
+ */
1798
+ rawText?: string | undefined;
1799
+ /**
1800
+ * The start and end offset of the text in the document.
1801
+ */
1802
+ range: Range;
1803
+ }
1804
+ type PartialOrUndefined<T> = { [P in keyof T]?: T[P] | undefined };
1805
+ //#endregion
1806
+ export { AdvancedCSpellSettings, AdvancedCSpellSettingsWithSourceTrace, BaseSetting, CSpellPackageSettings, CSpellReporter, CSpellReporterEmitters, CSpellReporterModule, CSpellSettings, CSpellSettingsWithSourceTrace, CSpellUserSettings, CSpellUserSettingsFields, CSpellUserSettingsWithComments, CacheFormat, CacheSettings, CacheStrategy, CharacterSet, CharacterSetCosts, CommandLineSettings, ConfigFields, CustomDictionaryPath, CustomDictionaryScope, DebugEmitter, DictionaryDefinition, DictionaryDefinitionAlternate, DictionaryDefinitionAugmented, DictionaryDefinitionBase, DictionaryDefinitionCustom, DictionaryDefinitionInline, DictionaryDefinitionInlineFlagWords, DictionaryDefinitionInlineIgnoreWords, DictionaryDefinitionInlineWords, DictionaryDefinitionLegacy, DictionaryDefinitionPreferred, DictionaryDefinitionSimple, DictionaryFileTypes, DictionaryId, DictionaryInformation, DictionaryNegRef, DictionaryPath, DictionaryRef, DictionaryReference, EditCosts, ErrorEmitter, ErrorLike, ExperimentalBaseSettings, ExperimentalFileSettings, ExtendableSettings, FSPathResolvable, Feature, Features, FeaturesSupportedByReporter, FileSettings, FileSource, FsPath, Glob, GlobDef, ImportFileRef, InMemorySource, Issue, IssueType, LanguageId, LanguageIdMultiple, LanguageIdMultipleNeg, LanguageIdSingle, LanguageSetting, LanguageSettingFilterFields, LanguageSettingFilterFieldsDeprecated, LanguageSettingFilterFieldsPreferred, LegacySettings, LocalId, LocaleId, MappedText, MatchingFileType, MergeSource, MessageEmitter, MessageType, MessageTypeLookup, MessageTypes, OverrideFilterFields, OverrideSettings, ParseResult, ParsedText, Parser, ParserName, ParserOptions, Pattern, PatternId, PatternRef, Plugin, PnPSettings, PredefinedPatterns, ProgressBase, ProgressEmitter, ProgressFileBase, ProgressFileBegin, ProgressFileComplete, ProgressItem, ProgressTypes, RegExpPatternDefinition, RegExpPatternList, ReplaceEntry, ReplaceMap, ReportIssueOptions, ReporterConfiguration, ReporterSettings, ReportingConfiguration, ResultEmitter, RunResult, Settings, SimpleGlob, Source, SpellingErrorEmitter, SuggestionCostMapDef, SuggestionCostsDefs, SuggestionsConfiguration, TextDocumentOffset, TextOffset, TrustLevel, UnknownWordsChoices, UnknownWordsConfiguration, Version, VersionLatest, VersionLegacy, WorkspaceTrustSettings, defaultCSpellSettings, defineConfig, unknownWordsChoices };
1807
+ //# sourceMappingURL=index.d.ts.map