@cspell/cspell-types 6.19.2 → 6.20.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.
Files changed (62) hide show
  1. package/{ajv.config.js → ajv.config.cjs} +0 -0
  2. package/dist/{CSpellReporter.d.ts → cjs/CSpellReporter.d.ts} +1 -1
  3. package/dist/{CSpellSettingsDef.d.ts → cjs/CSpellSettingsDef.d.ts} +4 -4
  4. package/dist/{DictionaryDefinition.d.ts → cjs/DictionaryDefinition.d.ts} +1 -1
  5. package/dist/{DictionaryInformation.d.ts → cjs/DictionaryInformation.d.ts} +1 -1
  6. package/dist/cjs/Parser/CSpellReporter.d.ts +103 -0
  7. package/dist/cjs/Parser/CSpellSettingsDef.d.ts +689 -0
  8. package/dist/cjs/Parser/DictionaryDefinition.d.ts +184 -0
  9. package/dist/cjs/Parser/DictionaryInformation.d.ts +210 -0
  10. package/dist/{Parser.d.ts → cjs/Parser/Parser/index.d.ts} +1 -1
  11. package/dist/{TextMap.d.ts → cjs/Parser/TextMap.d.ts} +0 -0
  12. package/dist/{TextOffset.d.ts → cjs/Parser/TextOffset.d.ts} +0 -0
  13. package/dist/{configFields.d.ts → cjs/Parser/configFields.d.ts} +1 -1
  14. package/dist/{features.d.ts → cjs/Parser/features.d.ts} +0 -0
  15. package/dist/cjs/Parser/index.cjs +3 -0
  16. package/dist/{index.d.ts → cjs/Parser/index.d.ts} +12 -12
  17. package/dist/{suggestionCostsDef.d.ts → cjs/Parser/suggestionCostsDef.d.ts} +0 -0
  18. package/dist/{types.d.ts → cjs/Parser/types.d.ts} +0 -0
  19. package/dist/cjs/TextMap.d.ts +36 -0
  20. package/dist/cjs/TextOffset.d.ts +23 -0
  21. package/dist/cjs/configFields.d.ts +7 -0
  22. package/dist/cjs/features.d.ts +38 -0
  23. package/dist/cjs/index.cjs +68 -0
  24. package/dist/cjs/index.d.ts +13 -0
  25. package/dist/cjs/suggestionCostsDef.d.ts +88 -0
  26. package/dist/cjs/types.d.ts +9 -0
  27. package/dist/esm/CSpellReporter.d.ts +103 -0
  28. package/dist/esm/CSpellReporter.js +11 -0
  29. package/dist/esm/CSpellSettingsDef.d.ts +689 -0
  30. package/dist/esm/CSpellSettingsDef.js +2 -0
  31. package/dist/esm/DictionaryDefinition.d.ts +184 -0
  32. package/dist/esm/DictionaryDefinition.js +2 -0
  33. package/dist/esm/DictionaryInformation.d.ts +210 -0
  34. package/dist/esm/DictionaryInformation.js +2 -0
  35. package/dist/esm/Parser/index.d.ts +126 -0
  36. package/dist/esm/Parser/index.js +2 -0
  37. package/dist/esm/TextMap.d.ts +36 -0
  38. package/dist/esm/TextMap.js +2 -0
  39. package/dist/esm/TextOffset.d.ts +23 -0
  40. package/dist/esm/TextOffset.js +2 -0
  41. package/dist/esm/configFields.d.ts +7 -0
  42. package/dist/{configFields.js → esm/configFields.js} +1 -4
  43. package/dist/esm/features.d.ts +38 -0
  44. package/dist/esm/features.js +3 -0
  45. package/dist/esm/index.d.ts +13 -0
  46. package/dist/esm/index.js +3 -0
  47. package/dist/esm/suggestionCostsDef.d.ts +88 -0
  48. package/dist/esm/suggestionCostsDef.js +2 -0
  49. package/dist/esm/types.d.ts +9 -0
  50. package/dist/esm/types.js +4 -0
  51. package/package.json +53 -27
  52. package/dist/CSpellReporter.js +0 -14
  53. package/dist/CSpellSettingsDef.js +0 -3
  54. package/dist/DictionaryDefinition.js +0 -3
  55. package/dist/DictionaryInformation.js +0 -3
  56. package/dist/Parser.js +0 -3
  57. package/dist/TextMap.js +0 -3
  58. package/dist/TextOffset.js +0 -3
  59. package/dist/features.js +0 -4
  60. package/dist/index.js +0 -9
  61. package/dist/suggestionCostsDef.js +0 -3
  62. package/dist/types.js +0 -5
@@ -0,0 +1,689 @@
1
+ import type { DictionaryDefinition, DictionaryReference } from './DictionaryDefinition.js';
2
+ import type { Features } from './features.js';
3
+ import type { Parser, ParserName } from './Parser/index.js';
4
+ import type { Serializable } from './types.js';
5
+ /**
6
+ * These settings come from user and workspace settings.
7
+ */
8
+ export type CSpellPackageSettings = CSpellUserSettings;
9
+ export type CSpellUserSettings = CSpellSettings;
10
+ export interface CSpellSettings extends FileSettings, LegacySettings {
11
+ }
12
+ export interface ImportFileRef {
13
+ filename: string;
14
+ error?: Error | undefined;
15
+ referencedBy?: Source[];
16
+ }
17
+ export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
18
+ source?: Source | undefined;
19
+ __importRef?: ImportFileRef;
20
+ __imports?: Map<string, ImportFileRef>;
21
+ }
22
+ export interface AdvancedCSpellSettingsWithSourceTrace extends CSpellSettingsWithSourceTrace, ExperimentalFileSettings {
23
+ }
24
+ export interface FileSettings extends ExtendableSettings, CommandLineSettings {
25
+ /**
26
+ * Url to JSON Schema
27
+ * @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
28
+ */
29
+ $schema?: string;
30
+ /**
31
+ * Configuration format version of the settings file.
32
+ *
33
+ * This controls how the settings in the configuration file behave.
34
+ *
35
+ * @default "0.2"
36
+ */
37
+ version?: Version;
38
+ /** Words to add to global dictionary -- should only be in the user config file. */
39
+ userWords?: string[];
40
+ /**
41
+ * Allows this configuration to inherit configuration for one or more other files.
42
+ *
43
+ * See [Importing / Extending Configuration](https://cspell.org/configuration/imports/) for more details.
44
+ */
45
+ import?: FsPath | FsPath[];
46
+ /**
47
+ * The root to use for glob patterns found in this configuration.
48
+ * Default: location of the configuration file.
49
+ * For compatibility reasons, config files with version 0.1, the glob root will
50
+ * default to be `${cwd}`.
51
+ *
52
+ * Use `globRoot` to define a different location.
53
+ * `globRoot` can be relative to the location of this configuration file.
54
+ * Defining globRoot, does not impact imported configurations.
55
+ *
56
+ * Special Values:
57
+ * - `${cwd}` - will be replaced with the current working directory.
58
+ * - `.` - will be the location of the containing configuration file.
59
+ *
60
+ */
61
+ globRoot?: FSPathResolvable;
62
+ /**
63
+ * Glob patterns of files to be checked.
64
+ *
65
+ * Glob patterns are relative to the `globRoot` of the configuration file that defines them.
66
+ */
67
+ files?: Glob[];
68
+ /**
69
+ * Enable scanning files and directories beginning with `.` (period).
70
+ *
71
+ * By default, CSpell does not scan `hidden` files.
72
+ *
73
+ * @default false
74
+ */
75
+ enableGlobDot?: boolean;
76
+ /**
77
+ * Glob patterns of files to be ignored.
78
+ *
79
+ * Glob patterns are relative to the `globRoot` of the configuration file that defines them.
80
+ */
81
+ ignorePaths?: Glob[];
82
+ /**
83
+ * Prevents searching for local configuration when checking individual documents.
84
+ *
85
+ * @default false
86
+ */
87
+ noConfigSearch?: boolean;
88
+ /**
89
+ * Indicate that the configuration file should not be modified.
90
+ * This is used to prevent tools like the VS Code Spell Checker from
91
+ * modifying the file to add words and other configuration.
92
+ *
93
+ * @default false
94
+ */
95
+ readonly?: boolean;
96
+ /**
97
+ * Custom reporters configuration.
98
+ */
99
+ reporters?: ReporterSettings[];
100
+ /**
101
+ * Tells the spell checker to load `.gitignore` files and skip files that match the globs in the `.gitignore` files found.
102
+ * @default false
103
+ */
104
+ useGitignore?: boolean;
105
+ /**
106
+ * Tells the spell checker to searching for `.gitignore` files when it reaches a matching root.
107
+ */
108
+ gitignoreRoot?: FsPath | FsPath[];
109
+ /**
110
+ * Verify that the in-document directives are correct.
111
+ */
112
+ validateDirectives?: boolean;
113
+ /**
114
+ * Configure CSpell features.
115
+ *
116
+ * - Added with `v5.16.0`.
117
+ */
118
+ features?: Features;
119
+ }
120
+ /**
121
+ * In the below JSDoc comment, we helpfully specify an example configuration for the end-user to
122
+ * reference. And this example will get captured by the automatic documentation generator.
123
+ *
124
+ * However, specifying the glob pattern inside of a JSDoc is tricky, because the glob contains the
125
+ * same symbol as the end-of-JSDoc symbol. To work around this, we insert a zero-width space in
126
+ * between the "*" and the "/" symbols.
127
+ */
128
+ export interface ExtendableSettings extends Settings {
129
+ /**
130
+ * Overrides are used to apply settings for specific files in your project.
131
+ *
132
+ * For example:
133
+ *
134
+ * ```javascript
135
+ * "overrides": [
136
+ * // Force `*.hrr` and `*.crr` files to be treated as `cpp` files:
137
+ * {
138
+ * "filename": "**​/{*.hrr,*.crr}",
139
+ * "languageId": "cpp"
140
+ * },
141
+ * // Force `*.txt` to use the Dutch dictionary (Dutch dictionary needs to be installed separately):
142
+ * {
143
+ * "language": "nl",
144
+ * "filename": "**​/dutch/**​/*.txt"
145
+ * }
146
+ * ]
147
+ * ```
148
+ */
149
+ overrides?: OverrideSettings[];
150
+ }
151
+ export interface Settings extends ReportingConfiguration, BaseSetting, PnPSettings {
152
+ /**
153
+ * Current active spelling language. This specifies the language locale to use in choosing the
154
+ * general dictionary.
155
+ *
156
+ * For example:
157
+ *
158
+ * - "en-GB" for British English.
159
+ * - "en,nl" to enable both English and Dutch.
160
+ *
161
+ * @default "en"
162
+ */
163
+ language?: LocaleId;
164
+ /** languageIds for the files to spell check. */
165
+ enabledLanguageIds?: LanguageIdSingle[];
166
+ /**
167
+ * @title File Types to Check
168
+ * @scope resource
169
+ * @uniqueItems true
170
+ * @markdownDescription
171
+ * Enable / Disable checking file types (languageIds).
172
+ * These are in additional to the file types specified by `cSpell.enabledLanguageIds`.
173
+ * To disable a language, prefix with `!` as in `!json`,
174
+ *
175
+ * Example:
176
+ * ```
177
+ * jsonc // enable checking for jsonc
178
+ * !json // disable checking for json
179
+ * kotlin // enable checking for kotlin
180
+ * ```
181
+ */
182
+ enableFiletypes?: LanguageIdSingle[];
183
+ /**
184
+ * Additional settings for individual languages.
185
+ *
186
+ * See [Language Settings](https://cspell.org/configuration/language-settings/) for more details.
187
+ */
188
+ languageSettings?: LanguageSetting[];
189
+ /** Forces the spell checker to assume a give language id. Used mainly as an Override. */
190
+ languageId?: LanguageId;
191
+ /**
192
+ * By default, the bundled dictionary configurations are loaded. Explicitly setting this to `false`
193
+ * will prevent ALL default configuration from being loaded.
194
+ *
195
+ * @default true
196
+ */
197
+ loadDefaultConfiguration?: boolean;
198
+ }
199
+ export interface ReportingConfiguration extends SuggestionsConfiguration {
200
+ /**
201
+ * The maximum number of problems to report in a file.
202
+ *
203
+ * @default 100
204
+ */
205
+ maxNumberOfProblems?: number;
206
+ /**
207
+ * The maximum number of times the same word can be flagged as an error in a file.
208
+ *
209
+ * @default 5
210
+ */
211
+ maxDuplicateProblems?: number;
212
+ /**
213
+ * The minimum length of a word before checking it against a dictionary.
214
+ *
215
+ * @default 4
216
+ */
217
+ minWordLength?: number;
218
+ }
219
+ export interface SuggestionsConfiguration {
220
+ /**
221
+ * Number of suggestions to make.
222
+ *
223
+ * @default 10
224
+ */
225
+ numSuggestions?: number;
226
+ /**
227
+ * The maximum amount of time in milliseconds to generate suggestions for a word.
228
+ *
229
+ * @default 500
230
+ */
231
+ suggestionsTimeout?: number;
232
+ /**
233
+ * The maximum number of changes allowed on a word to be considered a suggestions.
234
+ *
235
+ * For example, appending an `s` onto `example` -> `examples` is considered 1 change.
236
+ *
237
+ * Range: between 1 and 5.
238
+ *
239
+ * @default 3
240
+ */
241
+ suggestionNumChanges?: number;
242
+ }
243
+ /**
244
+ * Plug N Play settings to support package systems like Yarn 2.
245
+ */
246
+ export interface PnPSettings {
247
+ /**
248
+ * Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading
249
+ * packages stored in the repository.
250
+ *
251
+ * When true, the spell checker will search up the directory structure for the existence
252
+ * of a PnP file and load it.
253
+ *
254
+ * @default false
255
+ */
256
+ usePnP?: boolean;
257
+ /**
258
+ * The PnP files to search for. Note: `.mjs` files are not currently supported.
259
+ *
260
+ * @default [".pnp.js", ".pnp.cjs"]
261
+ */
262
+ pnpFiles?: string[];
263
+ }
264
+ /**
265
+ * The Strategy to use to detect if a file has changed.
266
+ * - `metadata` - uses the file system timestamp and size to detect changes (fastest).
267
+ * - `content` - uses a hash of the file content to check file changes (slower - more accurate).
268
+ */
269
+ export type CacheStrategy = 'metadata' | 'content';
270
+ export type CacheFormat = 'legacy' | 'universal';
271
+ export interface CacheSettings {
272
+ /**
273
+ * Store the results of processed files in order to only operate on the changed ones.
274
+ * @default false
275
+ */
276
+ useCache?: boolean;
277
+ /**
278
+ * Path to the cache location. Can be a file or a directory.
279
+ * If none specified `.cspellcache` will be used.
280
+ * Relative paths are relative to the config file in which it
281
+ * is defined.
282
+ *
283
+ * A prefix of `${cwd}` is replaced with the current working directory.
284
+ */
285
+ cacheLocation?: FSPathResolvable;
286
+ /**
287
+ * Strategy to use for detecting changed files, default: metadata
288
+ * @default 'metadata'
289
+ */
290
+ cacheStrategy?: CacheStrategy;
291
+ /**
292
+ * Format of the cache file.
293
+ * - `legacy` - use absolute paths in the cache file
294
+ * - `universal` - use a sharable format.
295
+ * @default 'legacy'
296
+ */
297
+ cacheFormat?: CacheFormat | undefined;
298
+ }
299
+ /**
300
+ * These are settings only used by the command line application.
301
+ */
302
+ export interface CommandLineSettings {
303
+ /**
304
+ * Define cache settings.
305
+ */
306
+ cache?: CacheSettings;
307
+ /**
308
+ * Exit with non-zero code as soon as an issue/error is encountered (useful for CI or git hooks)
309
+ * @default false
310
+ */
311
+ failFast?: boolean;
312
+ }
313
+ /**
314
+ * To prevent the unwanted execution of untrusted code, WorkspaceTrustSettings
315
+ * are use to set the trust levels.
316
+ *
317
+ * Trust setting have an impact on both `cspell.config.js` files and on `.pnp.js` files.
318
+ * In an untrusted location, these files will NOT be used.
319
+ *
320
+ * This will also prevent any associated plugins from being loaded.
321
+ */
322
+ export interface WorkspaceTrustSettings {
323
+ /**
324
+ * Glob patterns of locations that contain ALWAYS trusted files.
325
+ */
326
+ trustedFiles?: Glob[];
327
+ /**
328
+ * Glob patterns of locations that contain NEVER trusted files.
329
+ */
330
+ untrustedFiles?: Glob[];
331
+ /**
332
+ * Sets the default trust level.
333
+ * @default "trusted"
334
+ */
335
+ trustLevel?: TrustLevel;
336
+ }
337
+ /**
338
+ * VS Code Spell Checker Settings.
339
+ * To be Removed.
340
+ * @deprecated true
341
+ */
342
+ export interface LegacySettings {
343
+ /**
344
+ * Show status.
345
+ * @deprecated true
346
+ */
347
+ showStatus?: boolean;
348
+ /**
349
+ * Delay in ms after a document has changed before checking it for spelling errors.
350
+ * @deprecated true
351
+ */
352
+ spellCheckDelayMs?: number;
353
+ }
354
+ export interface OverrideSettings extends Settings, OverrideFilterFields {
355
+ /** Sets the programming language id. */
356
+ languageId?: LanguageId;
357
+ /** Sets the locale. */
358
+ language?: LocaleId;
359
+ }
360
+ export interface OverrideFilterFields {
361
+ /** Glob pattern or patterns to match against. */
362
+ filename: Glob | Glob[];
363
+ }
364
+ export interface BaseSetting extends ExperimentalBaseSettings {
365
+ /** Optional identifier. */
366
+ id?: string;
367
+ /** Optional name of configuration. */
368
+ name?: string;
369
+ /** Optional description of configuration. */
370
+ description?: string;
371
+ /**
372
+ * Is the spell checker enabled.
373
+ * @default true
374
+ */
375
+ enabled?: boolean;
376
+ /** List of words to be always considered correct. */
377
+ words?: string[];
378
+ /** List of words to always be considered incorrect. */
379
+ flagWords?: string[];
380
+ /**
381
+ * List of words to be ignored. An ignored word will not show up as an error, even if it is
382
+ * also in the `flagWords`.
383
+ */
384
+ ignoreWords?: string[];
385
+ /**
386
+ * True to enable compound word checking. See [Case Sensitivity](https://cspell.org/docs/case-sensitive/) for more details.
387
+ *
388
+ * @default false
389
+ */
390
+ allowCompoundWords?: boolean;
391
+ /**
392
+ * Determines if words must match case and accent rules.
393
+ *
394
+ * - `false` - Case is ignored and accents can be missing on the entire word.
395
+ * Incorrect accents or partially missing accents will be marked as incorrect.
396
+ * - `true` - Case and accents are enforced.
397
+ *
398
+ * @default false
399
+ */
400
+ caseSensitive?: boolean;
401
+ /**
402
+ * Define additional available dictionaries.
403
+ *
404
+ * For example, you can use the following to add a custom dictionary:
405
+ *
406
+ * ```json
407
+ * "dictionaryDefinitions": [
408
+ * { "name": "custom-words", "path": "./custom-words.txt"}
409
+ * ],
410
+ * "dictionaries": ["custom-words"]
411
+ * ```
412
+ */
413
+ dictionaryDefinitions?: DictionaryDefinition[];
414
+ /**
415
+ * Optional list of dictionaries to use. Each entry should match the name of the dictionary.
416
+ *
417
+ * To remove a dictionary from the list, add `!` before the name.
418
+ *
419
+ * For example, `!typescript` will turn off the dictionary with the name `typescript`.
420
+ *
421
+ * See the [Dictionaries](https://cspell.org/docs/dictionaries/)
422
+ * and [Custom Dictionaries](https://cspell.org/docs/dictionaries-custom/) for more details.
423
+ */
424
+ dictionaries?: DictionaryReference[];
425
+ /**
426
+ * Optional list of dictionaries that will not be used for suggestions.
427
+ * Words in these dictionaries are considered correct, but will not be
428
+ * used when making spell correction suggestions.
429
+ *
430
+ * Note: if a word is suggested by another dictionary, but found in
431
+ * one of these dictionaries, it will be removed from the set of
432
+ * possible suggestions.
433
+ */
434
+ noSuggestDictionaries?: DictionaryReference[];
435
+ /**
436
+ * List of regular expression patterns or pattern names to exclude from spell checking.
437
+ *
438
+ * Example: ["href"] - to exclude html href.
439
+ *
440
+ * By default, several patterns are excluded. See
441
+ * [Configuration](https://cspell.org/configuration/#cspelljson-sections) for more details.
442
+ *
443
+ * While you can create your own patterns, you can also leverage several patterns that are
444
+ * [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).
445
+ */
446
+ ignoreRegExpList?: RegExpPatternList;
447
+ /**
448
+ * List of regular expression patterns or defined pattern names to match for spell checking.
449
+ *
450
+ * If this property is defined, only text matching the included patterns will be checked.
451
+ *
452
+ * While you can create your own patterns, you can also leverage several patterns that are
453
+ * [built-in to CSpell](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell-lib/src/Settings/DefaultSettings.ts#L22).
454
+ */
455
+ includeRegExpList?: RegExpPatternList;
456
+ /**
457
+ * Defines a list of patterns that can be used with the `ignoreRegExpList` and
458
+ * `includeRegExpList` options.
459
+ *
460
+ * For example:
461
+ *
462
+ * ```javascript
463
+ * "ignoreRegExpList": ["comments"],
464
+ * "patterns": [
465
+ * {
466
+ * "name": "comment-single-line",
467
+ * "pattern": "/#.*​/g"
468
+ * },
469
+ * {
470
+ * "name": "comment-multi-line",
471
+ * "pattern": "/(?:\\/\\*[\\s\\S]*?\\*\\/)/g"
472
+ * },
473
+ * // You can also combine multiple named patterns into one single named pattern
474
+ * {
475
+ * "name": "comments",
476
+ * "pattern": ["comment-single-line", "comment-multi-line"]
477
+ * }
478
+ * ]
479
+ * ```
480
+ */
481
+ patterns?: RegExpPatternDefinition[];
482
+ }
483
+ export interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {
484
+ }
485
+ export interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {
486
+ }
487
+ export interface LanguageSettingFilterFieldsPreferred {
488
+ /** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. */
489
+ languageId: LanguageId | LanguageIdSingle[];
490
+ /** The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales. */
491
+ locale?: LocaleId | LocaleId[];
492
+ }
493
+ export interface LanguageSettingFilterFieldsDeprecated {
494
+ /** The language id. Ex: "typescript", "html", or "php". "*" -- will match all languages. */
495
+ languageId: LanguageId | LanguageIdSingle[];
496
+ /**
497
+ * Deprecated - The locale filter, matches against the language. This can be a comma separated list. "*" will match all locales.
498
+ * @deprecated true
499
+ * @deprecationMessage Use `locale` instead.
500
+ */
501
+ local?: LocaleId | LocaleId[];
502
+ }
503
+ /** @hidden */
504
+ type InternalRegExp = RegExp;
505
+ export type Pattern = string | InternalRegExp;
506
+ export 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';
507
+ /** This matches the name in a pattern definition. */
508
+ export type PatternId = string;
509
+ /** A PatternRef is a Pattern or PatternId. */
510
+ export type PatternRef = Pattern | PatternId | PredefinedPatterns;
511
+ /** A list of pattern names or regular expressions. */
512
+ export type RegExpPatternList = PatternRef[];
513
+ /** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
514
+ export type LocaleId = string;
515
+ /**
516
+ * Configuration File Version.
517
+ */
518
+ export type VersionLatest = '0.2';
519
+ /**
520
+ * Legacy Configuration File Versions.
521
+ * @deprecated true
522
+ * @deprecationMessage Use `0.2` instead.
523
+ */
524
+ export type VersionLegacy = '0.1';
525
+ export type Version = VersionLatest | VersionLegacy;
526
+ /**
527
+ * @deprecated true
528
+ * @deprecationMessage Use `LocaleId` instead.
529
+ */
530
+ export type LocalId = LocaleId;
531
+ /** These are glob expressions. */
532
+ export type Glob = SimpleGlob | GlobDef;
533
+ /** Simple Glob string, the root will be globRoot. */
534
+ export type SimpleGlob = string;
535
+ /**
536
+ * Used to define fully qualified glob patterns.
537
+ * It is currently hidden to make the json-schema a bit easier to use
538
+ * when crafting cspell.json files by hand.
539
+ * @hidden
540
+ */
541
+ export interface GlobDef {
542
+ /** Glob pattern to match. */
543
+ glob: string;
544
+ /** Optional root to use when matching the glob. Defaults to current working dir. */
545
+ root?: string;
546
+ /**
547
+ * Optional source of the glob, used when merging settings to determine the origin.
548
+ * @hidden
549
+ */
550
+ source?: string;
551
+ }
552
+ /**
553
+ * This can be '*', 'typescript', 'cpp', 'json', etc.
554
+ * @pattern ^(!?[-\w_\s]+)|(\*)$
555
+ */
556
+ export type LanguageIdSingle = string;
557
+ /**
558
+ * This can be 'typescript,cpp,json,literal haskell', etc.
559
+ * @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
560
+ */
561
+ export type LanguageIdMultiple = string;
562
+ /**
563
+ * This can be 'typescript,cpp,json,literal haskell', etc.
564
+ * @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
565
+ */
566
+ export type LanguageIdMultipleNeg = string;
567
+ export type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
568
+ /**
569
+ * A File System Path. Relative paths are relative to the configuration file.
570
+ */
571
+ export type FsPath = string;
572
+ /**
573
+ * A File System Path.
574
+ *
575
+ * Special Properties:
576
+ * - `${cwd}` prefix - will be replaced with the current working directory.
577
+ * - Relative paths are relative to the configuration file.
578
+ */
579
+ export type FSPathResolvable = FsPath;
580
+ /** Trust Security Level. */
581
+ export type TrustLevel = 'trusted' | 'untrusted';
582
+ export interface RegExpPatternDefinition {
583
+ /**
584
+ * Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
585
+ * It is possible to redefine one of the predefined patterns to override its value.
586
+ */
587
+ name: PatternId;
588
+ /**
589
+ * RegExp pattern or array of RegExp patterns.
590
+ */
591
+ pattern: Pattern | Pattern[];
592
+ /**
593
+ * Description of the pattern.
594
+ */
595
+ description?: string | undefined;
596
+ }
597
+ export type CSpellUserSettingsWithComments = CSpellUserSettings;
598
+ export type Source = FileSource | MergeSource | InMemorySource | BaseSource;
599
+ export interface FileSource extends BaseSource {
600
+ /** Name of source. */
601
+ name: string;
602
+ /** Filename if this came from a file. */
603
+ filename: string;
604
+ /** The two settings that were merged to. */
605
+ sources?: undefined;
606
+ /** The configuration read. */
607
+ fileSource: CSpellSettings;
608
+ }
609
+ export interface MergeSource extends BaseSource {
610
+ /** Name of source. */
611
+ name: string;
612
+ /** Filename if this came from a file. */
613
+ filename?: undefined;
614
+ /** The two settings that were merged to. */
615
+ sources: [CSpellSettings] | [CSpellSettings, CSpellSettings];
616
+ /** The configuration read. */
617
+ fileSource?: undefined;
618
+ }
619
+ export interface InMemorySource extends BaseSource {
620
+ /** Name of source. */
621
+ name: string;
622
+ /** Filename if this came from a file. */
623
+ filename?: undefined;
624
+ /** The two settings that were merged to. */
625
+ sources?: undefined;
626
+ /** The configuration read. */
627
+ fileSource?: undefined;
628
+ }
629
+ interface BaseSource {
630
+ /** Name of source. */
631
+ name: string;
632
+ /** Filename if this came from a file. */
633
+ filename?: string | undefined;
634
+ /** The two settings that were merged to. */
635
+ sources?: [CSpellSettings] | [CSpellSettings, CSpellSettings] | undefined;
636
+ /** The configuration read. */
637
+ fileSource?: CSpellSettings | undefined;
638
+ }
639
+ /**
640
+ * Reporter name or reporter name + reporter config.
641
+ */
642
+ export type ReporterSettings = string | [string] | [string, Serializable];
643
+ /**
644
+ * Experimental Configuration / Options
645
+ *
646
+ * This Configuration is subject to change without warning.
647
+ * @experimental
648
+ * @hidden
649
+ */
650
+ export interface ExperimentalFileSettings {
651
+ /**
652
+ * Future Plugin support
653
+ * @experimental
654
+ * @version 6.2.0
655
+ */
656
+ plugins?: Plugin[];
657
+ }
658
+ /**
659
+ * Extends CSpellSettings with ExperimentalFileSettings
660
+ * @experimental
661
+ * @hidden
662
+ */
663
+ export interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {
664
+ }
665
+ /**
666
+ * Experimental Configuration / Options
667
+ *
668
+ * This Configuration is subject to change without warning.
669
+ * @experimental
670
+ * @hidden
671
+ */
672
+ export interface ExperimentalBaseSettings {
673
+ /**
674
+ * Parser to use for the file content
675
+ * @experimental
676
+ * @version 6.2.0
677
+ */
678
+ parser?: ParserName;
679
+ }
680
+ /**
681
+ * Plugin API
682
+ * @experimental
683
+ * @version 6.2.0
684
+ */
685
+ export interface Plugin {
686
+ parsers?: Parser[];
687
+ }
688
+ export {};
689
+ //# sourceMappingURL=CSpellSettingsDef.d.ts.map