@cspell/cspell-types 8.17.0 → 8.17.2

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