@cspell/cspell-types 6.14.2 → 6.15.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/cspell.schema.json +5 -1
- package/dist/CSpellReporter.d.ts +11 -11
- package/dist/CSpellSettingsDef.d.ts +30 -208
- package/dist/DictionaryDefinition.d.ts +184 -0
- package/dist/DictionaryDefinition.js +3 -0
- package/dist/DictionaryInformation.d.ts +2 -2
- package/dist/Parser.d.ts +6 -6
- package/dist/TextMap.d.ts +3 -3
- package/dist/configFields.d.ts +2 -2
- package/dist/features.d.ts +6 -6
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -17
- package/dist/suggestionCostsDef.d.ts +2 -2
- package/dist/types.d.ts +5 -5
- package/package.json +3 -3
package/cspell.schema.json
CHANGED
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"type": "object"
|
|
172
172
|
},
|
|
173
173
|
"CustomDictionaryPath": {
|
|
174
|
-
"$ref": "#/definitions/
|
|
174
|
+
"$ref": "#/definitions/FsDictionaryPath",
|
|
175
175
|
"description": "A File System Path to a dictionary file."
|
|
176
176
|
},
|
|
177
177
|
"CustomDictionaryScope": {
|
|
@@ -535,6 +535,10 @@
|
|
|
535
535
|
},
|
|
536
536
|
"type": "object"
|
|
537
537
|
},
|
|
538
|
+
"FsDictionaryPath": {
|
|
539
|
+
"description": "A File System Path. Relative paths are relative to the configuration file.",
|
|
540
|
+
"type": "string"
|
|
541
|
+
},
|
|
538
542
|
"FsPath": {
|
|
539
543
|
"description": "A File System Path. Relative paths are relative to the configuration file.",
|
|
540
544
|
"type": "string"
|
package/dist/CSpellReporter.d.ts
CHANGED
|
@@ -23,22 +23,22 @@ export declare enum IssueType {
|
|
|
23
23
|
spelling = 0,
|
|
24
24
|
directive = 1
|
|
25
25
|
}
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type MessageType = 'Debug' | 'Info' | 'Warning';
|
|
27
|
+
export type MessageTypeLookup = {
|
|
28
28
|
[key in MessageType]: key;
|
|
29
29
|
};
|
|
30
30
|
export declare const MessageTypes: MessageTypeLookup;
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
31
|
+
export type MessageEmitter = (message: string, msgType: MessageType) => void;
|
|
32
|
+
export type DebugEmitter = (message: string) => void;
|
|
33
|
+
export type ErrorLike = Error | {
|
|
34
34
|
message: string;
|
|
35
35
|
name: string;
|
|
36
36
|
toString: () => string;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
38
|
+
export type ErrorEmitter = (message: string, error: ErrorLike) => void;
|
|
39
|
+
export type SpellingErrorEmitter = (issue: Issue) => void;
|
|
40
|
+
export type ProgressTypes = 'ProgressFileBegin' | 'ProgressFileComplete';
|
|
41
|
+
export type ProgressItem = ProgressFileBegin | ProgressFileComplete;
|
|
42
42
|
export interface ProgressBase {
|
|
43
43
|
type: ProgressTypes;
|
|
44
44
|
}
|
|
@@ -61,7 +61,7 @@ export interface ProgressFileComplete extends ProgressFileBase {
|
|
|
61
61
|
export interface ProgressFileBegin extends ProgressFileBase {
|
|
62
62
|
type: 'ProgressFileBegin';
|
|
63
63
|
}
|
|
64
|
-
export
|
|
64
|
+
export type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
|
|
65
65
|
export interface RunResult {
|
|
66
66
|
/** Number of files processed. */
|
|
67
67
|
files: number;
|
|
@@ -74,7 +74,7 @@ export interface RunResult {
|
|
|
74
74
|
/** Number files that used results from the cache. */
|
|
75
75
|
cachedFiles?: number;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
77
|
+
export type ResultEmitter = (result: RunResult) => void | Promise<void>;
|
|
78
78
|
export interface CSpellReporter {
|
|
79
79
|
issue: SpellingErrorEmitter;
|
|
80
80
|
info: MessageEmitter;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DictionaryDefinition, DictionaryReference } from './DictionaryDefinition';
|
|
2
2
|
import type { Features } from './features';
|
|
3
|
-
import { Parser, ParserName } from './Parser';
|
|
4
|
-
import { Serializable } from './types';
|
|
5
|
-
export declare type ReplaceEntry = [string, string];
|
|
6
|
-
export declare type ReplaceMap = ReplaceEntry[];
|
|
3
|
+
import type { Parser, ParserName } from './Parser';
|
|
4
|
+
import type { Serializable } from './types';
|
|
7
5
|
/**
|
|
8
6
|
* These settings come from user and workspace settings.
|
|
9
7
|
*/
|
|
10
|
-
export
|
|
11
|
-
export
|
|
8
|
+
export type CSpellPackageSettings = CSpellUserSettings;
|
|
9
|
+
export type CSpellUserSettings = CSpellSettings;
|
|
12
10
|
export interface CSpellSettings extends FileSettings, LegacySettings {
|
|
13
11
|
}
|
|
14
12
|
export interface ImportFileRef {
|
|
@@ -268,8 +266,8 @@ export interface PnPSettings {
|
|
|
268
266
|
* - `metadata` - uses the file system timestamp and size to detect changes (fastest).
|
|
269
267
|
* - `content` - uses a hash of the file content to check file changes (slower - more accurate).
|
|
270
268
|
*/
|
|
271
|
-
export
|
|
272
|
-
export
|
|
269
|
+
export type CacheStrategy = 'metadata' | 'content';
|
|
270
|
+
export type CacheFormat = 'legacy' | 'universal';
|
|
273
271
|
export interface CacheSettings {
|
|
274
272
|
/**
|
|
275
273
|
* Store the results of processed files in order to only operate on the changed ones.
|
|
@@ -482,133 +480,6 @@ export interface BaseSetting extends ExperimentalBaseSettings {
|
|
|
482
480
|
*/
|
|
483
481
|
patterns?: RegExpPatternDefinition[];
|
|
484
482
|
}
|
|
485
|
-
export declare type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
|
|
486
|
-
export declare type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
|
|
487
|
-
export interface DictionaryDefinitionBase {
|
|
488
|
-
/**
|
|
489
|
-
* This is the name of a dictionary.
|
|
490
|
-
*
|
|
491
|
-
* Name Format:
|
|
492
|
-
* - Must contain at least 1 number or letter.
|
|
493
|
-
* - Spaces are allowed.
|
|
494
|
-
* - Leading and trailing space will be removed.
|
|
495
|
-
* - Names ARE case-sensitive.
|
|
496
|
-
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
|
|
497
|
-
*/
|
|
498
|
-
name: DictionaryId;
|
|
499
|
-
/** Optional description. */
|
|
500
|
-
description?: string;
|
|
501
|
-
/** Replacement pairs. */
|
|
502
|
-
repMap?: ReplaceMap;
|
|
503
|
-
/** Use Compounds. */
|
|
504
|
-
useCompounds?: boolean;
|
|
505
|
-
/**
|
|
506
|
-
* Indicate that suggestions should not come from this dictionary.
|
|
507
|
-
* Words in this dictionary are considered correct, but will not be
|
|
508
|
-
* used when making spell correction suggestions.
|
|
509
|
-
*
|
|
510
|
-
* Note: if a word is suggested by another dictionary, but found in
|
|
511
|
-
* this dictionary, it will be removed from the set of
|
|
512
|
-
* possible suggestions.
|
|
513
|
-
*/
|
|
514
|
-
noSuggest?: boolean;
|
|
515
|
-
/**
|
|
516
|
-
* Type of file:
|
|
517
|
-
* S - single word per line,
|
|
518
|
-
* W - each line can contain one or more words separated by space,
|
|
519
|
-
* C - each line is treated like code (Camel Case is allowed).
|
|
520
|
-
* Default is S.
|
|
521
|
-
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
522
|
-
* @default "S"
|
|
523
|
-
*/
|
|
524
|
-
type?: DictionaryFileTypes;
|
|
525
|
-
}
|
|
526
|
-
export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
527
|
-
/** Path to the file. */
|
|
528
|
-
path: DictionaryPath;
|
|
529
|
-
/**
|
|
530
|
-
* Only for legacy dictionary definitions.
|
|
531
|
-
* @deprecated true
|
|
532
|
-
* @deprecationMessage Use `path` instead.
|
|
533
|
-
* @hidden
|
|
534
|
-
*/
|
|
535
|
-
file?: undefined;
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* Used to provide extra data related to the dictionary
|
|
539
|
-
*/
|
|
540
|
-
export interface DictionaryDefinitionAugmented extends DictionaryDefinitionPreferred {
|
|
541
|
-
dictionaryInformation?: DictionaryInformation;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Only for legacy dictionary definitions.
|
|
545
|
-
* @deprecated true
|
|
546
|
-
* @deprecationMessage Use `DictionaryDefinitionPreferred` instead.
|
|
547
|
-
*/
|
|
548
|
-
export interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
549
|
-
/** @hidden */
|
|
550
|
-
path?: undefined;
|
|
551
|
-
/**
|
|
552
|
-
* Path to the file, only for legacy dictionary definitions.
|
|
553
|
-
* @deprecated true
|
|
554
|
-
* @deprecationMessage Use `path` instead.
|
|
555
|
-
*/
|
|
556
|
-
file: DictionaryPath;
|
|
557
|
-
/** @hidden */
|
|
558
|
-
suggestionEditCosts?: undefined;
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* @deprecated true
|
|
562
|
-
* @hidden
|
|
563
|
-
*/
|
|
564
|
-
export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
565
|
-
/** Path to the file, if undefined the path to the extension dictionaries is assumed. */
|
|
566
|
-
path?: FsPath;
|
|
567
|
-
/**
|
|
568
|
-
* File name.
|
|
569
|
-
* @deprecated true
|
|
570
|
-
* @deprecationMessage Use `path` instead.
|
|
571
|
-
*/
|
|
572
|
-
file: FsPath;
|
|
573
|
-
/**
|
|
574
|
-
* Type of file:
|
|
575
|
-
* S - single word per line,
|
|
576
|
-
* W - each line can contain one or more words separated by space,
|
|
577
|
-
* C - each line is treated like code (Camel Case is allowed).
|
|
578
|
-
* Default is S.
|
|
579
|
-
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
580
|
-
* @default "S"
|
|
581
|
-
*/
|
|
582
|
-
type?: DictionaryFileTypes;
|
|
583
|
-
/**
|
|
584
|
-
* @hidden
|
|
585
|
-
*/
|
|
586
|
-
suggestionEditCosts?: undefined;
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* Specifies the scope of a dictionary.
|
|
590
|
-
*/
|
|
591
|
-
export declare type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
|
|
592
|
-
/**
|
|
593
|
-
* For Defining Custom dictionaries. They are generally scoped to a
|
|
594
|
-
* `user`, `workspace`, or `folder`.
|
|
595
|
-
* When `addWords` is true, indicates that the spell checker can add words
|
|
596
|
-
* to the file.
|
|
597
|
-
* Note: only plain text files with one word per line are supported at this moment.
|
|
598
|
-
*/
|
|
599
|
-
export interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
|
|
600
|
-
/** Path to custom dictionary text file. */
|
|
601
|
-
path: CustomDictionaryPath;
|
|
602
|
-
/**
|
|
603
|
-
* Defines the scope for when words will be added to the dictionary.
|
|
604
|
-
* Scope values: `user`, `workspace`, `folder`.
|
|
605
|
-
*/
|
|
606
|
-
scope?: CustomDictionaryScope | CustomDictionaryScope[];
|
|
607
|
-
/**
|
|
608
|
-
* When `true`, let's the spell checker know that words can be added to this dictionary.
|
|
609
|
-
*/
|
|
610
|
-
addWords: boolean;
|
|
611
|
-
}
|
|
612
483
|
export interface LanguageSetting extends LanguageSettingFilterFields, BaseSetting {
|
|
613
484
|
}
|
|
614
485
|
export interface LanguageSettingFilterFields extends LanguageSettingFilterFieldsPreferred, LanguageSettingFilterFieldsDeprecated {
|
|
@@ -630,77 +501,37 @@ export interface LanguageSettingFilterFieldsDeprecated {
|
|
|
630
501
|
local?: LocaleId | LocaleId[];
|
|
631
502
|
}
|
|
632
503
|
/** @hidden */
|
|
633
|
-
|
|
634
|
-
export
|
|
635
|
-
export
|
|
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';
|
|
636
507
|
/** This matches the name in a pattern definition. */
|
|
637
|
-
export
|
|
508
|
+
export type PatternId = string;
|
|
638
509
|
/** A PatternRef is a Pattern or PatternId. */
|
|
639
|
-
export
|
|
510
|
+
export type PatternRef = Pattern | PatternId | PredefinedPatterns;
|
|
640
511
|
/** A list of pattern names or regular expressions. */
|
|
641
|
-
export
|
|
642
|
-
/**
|
|
643
|
-
* This is the name of a dictionary.
|
|
644
|
-
*
|
|
645
|
-
* Name Format:
|
|
646
|
-
* - Must contain at least 1 number or letter.
|
|
647
|
-
* - Spaces are allowed.
|
|
648
|
-
* - Leading and trailing space will be removed.
|
|
649
|
-
* - Names ARE case-sensitive.
|
|
650
|
-
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
|
|
651
|
-
*
|
|
652
|
-
* @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
653
|
-
*/
|
|
654
|
-
export declare type DictionaryId = string;
|
|
655
|
-
/**
|
|
656
|
-
* This a reference to a named dictionary.
|
|
657
|
-
* It is expected to match the name of a dictionary.
|
|
658
|
-
*/
|
|
659
|
-
export declare type DictionaryRef = DictionaryId;
|
|
660
|
-
/**
|
|
661
|
-
* This a negative reference to a named dictionary.
|
|
662
|
-
*
|
|
663
|
-
* It is used to exclude or include a dictionary by name.
|
|
664
|
-
*
|
|
665
|
-
* The reference starts with 1 or more `!`.
|
|
666
|
-
* - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.
|
|
667
|
-
* - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`.
|
|
668
|
-
* Overrides `!<dictionary_name>`.
|
|
669
|
-
* - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`.
|
|
670
|
-
* Overrides `!!<dictionary_name>`.
|
|
671
|
-
*
|
|
672
|
-
* @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
673
|
-
*/
|
|
674
|
-
export declare type DictionaryNegRef = string;
|
|
675
|
-
/**
|
|
676
|
-
* Reference to a dictionary by name.
|
|
677
|
-
* One of:
|
|
678
|
-
* - {@link DictionaryRef}
|
|
679
|
-
* - {@link DictionaryNegRef}
|
|
680
|
-
*/
|
|
681
|
-
export declare type DictionaryReference = DictionaryRef | DictionaryNegRef;
|
|
512
|
+
export type RegExpPatternList = PatternRef[];
|
|
682
513
|
/** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
|
|
683
|
-
export
|
|
514
|
+
export type LocaleId = string;
|
|
684
515
|
/**
|
|
685
516
|
* Configuration File Version.
|
|
686
517
|
*/
|
|
687
|
-
export
|
|
518
|
+
export type VersionLatest = '0.2';
|
|
688
519
|
/**
|
|
689
520
|
* Legacy Configuration File Versions.
|
|
690
521
|
* @deprecated true
|
|
691
522
|
* @deprecationMessage Use `0.2` instead.
|
|
692
523
|
*/
|
|
693
|
-
export
|
|
694
|
-
export
|
|
524
|
+
export type VersionLegacy = '0.1';
|
|
525
|
+
export type Version = VersionLatest | VersionLegacy;
|
|
695
526
|
/**
|
|
696
527
|
* @deprecated true
|
|
697
528
|
* @deprecationMessage Use `LocaleId` instead.
|
|
698
529
|
*/
|
|
699
|
-
export
|
|
530
|
+
export type LocalId = LocaleId;
|
|
700
531
|
/** These are glob expressions. */
|
|
701
|
-
export
|
|
532
|
+
export type Glob = SimpleGlob | GlobDef;
|
|
702
533
|
/** Simple Glob string, the root will be globRoot. */
|
|
703
|
-
export
|
|
534
|
+
export type SimpleGlob = string;
|
|
704
535
|
/**
|
|
705
536
|
* Used to define fully qualified glob patterns.
|
|
706
537
|
* It is currently hidden to make the json-schema a bit easier to use
|
|
@@ -722,22 +553,22 @@ export interface GlobDef {
|
|
|
722
553
|
* This can be '*', 'typescript', 'cpp', 'json', etc.
|
|
723
554
|
* @pattern ^(!?[-\w_\s]+)|(\*)$
|
|
724
555
|
*/
|
|
725
|
-
export
|
|
556
|
+
export type LanguageIdSingle = string;
|
|
726
557
|
/**
|
|
727
558
|
* This can be 'typescript,cpp,json,literal haskell', etc.
|
|
728
559
|
* @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
|
|
729
560
|
*/
|
|
730
|
-
export
|
|
561
|
+
export type LanguageIdMultiple = string;
|
|
731
562
|
/**
|
|
732
563
|
* This can be 'typescript,cpp,json,literal haskell', etc.
|
|
733
564
|
* @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
|
|
734
565
|
*/
|
|
735
|
-
export
|
|
736
|
-
export
|
|
566
|
+
export type LanguageIdMultipleNeg = string;
|
|
567
|
+
export type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
|
|
737
568
|
/**
|
|
738
569
|
* A File System Path. Relative paths are relative to the configuration file.
|
|
739
570
|
*/
|
|
740
|
-
export
|
|
571
|
+
export type FsPath = string;
|
|
741
572
|
/**
|
|
742
573
|
* A File System Path.
|
|
743
574
|
*
|
|
@@ -745,18 +576,9 @@ export declare type FsPath = string;
|
|
|
745
576
|
* - `${cwd}` prefix - will be replaced with the current working directory.
|
|
746
577
|
* - Relative paths are relative to the configuration file.
|
|
747
578
|
*/
|
|
748
|
-
export
|
|
579
|
+
export type FSPathResolvable = FsPath;
|
|
749
580
|
/** Trust Security Level. */
|
|
750
|
-
export
|
|
751
|
-
/**
|
|
752
|
-
* A File System Path to a dictionary file.
|
|
753
|
-
* @pattern ^.*\.(?:txt|trie)(?:\.gz)?$
|
|
754
|
-
*/
|
|
755
|
-
export declare type DictionaryPath = string;
|
|
756
|
-
/**
|
|
757
|
-
* A File System Path to a dictionary file.
|
|
758
|
-
*/
|
|
759
|
-
export declare type CustomDictionaryPath = FsPath;
|
|
581
|
+
export type TrustLevel = 'trusted' | 'untrusted';
|
|
760
582
|
export interface RegExpPatternDefinition {
|
|
761
583
|
/**
|
|
762
584
|
* Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
|
|
@@ -772,8 +594,8 @@ export interface RegExpPatternDefinition {
|
|
|
772
594
|
*/
|
|
773
595
|
description?: string | undefined;
|
|
774
596
|
}
|
|
775
|
-
export
|
|
776
|
-
export
|
|
597
|
+
export type CSpellUserSettingsWithComments = CSpellUserSettings;
|
|
598
|
+
export type Source = FileSource | MergeSource | InMemorySource | BaseSource;
|
|
777
599
|
export interface FileSource extends BaseSource {
|
|
778
600
|
/** Name of source. */
|
|
779
601
|
name: string;
|
|
@@ -817,7 +639,7 @@ interface BaseSource {
|
|
|
817
639
|
/**
|
|
818
640
|
* Reporter name or reporter name + reporter config.
|
|
819
641
|
*/
|
|
820
|
-
export
|
|
642
|
+
export type ReporterSettings = string | [string] | [string, Serializable];
|
|
821
643
|
/**
|
|
822
644
|
* Experimental Configuration / Options
|
|
823
645
|
*
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { DictionaryInformation } from './DictionaryInformation';
|
|
2
|
+
export type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
|
|
3
|
+
export type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
|
|
4
|
+
export interface DictionaryDefinitionBase {
|
|
5
|
+
/**
|
|
6
|
+
* This is the name of a dictionary.
|
|
7
|
+
*
|
|
8
|
+
* Name Format:
|
|
9
|
+
* - Must contain at least 1 number or letter.
|
|
10
|
+
* - Spaces are allowed.
|
|
11
|
+
* - Leading and trailing space will be removed.
|
|
12
|
+
* - Names ARE case-sensitive.
|
|
13
|
+
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
|
|
14
|
+
*/
|
|
15
|
+
name: DictionaryId;
|
|
16
|
+
/** Optional description. */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Replacement pairs. */
|
|
19
|
+
repMap?: ReplaceMap;
|
|
20
|
+
/** Use Compounds. */
|
|
21
|
+
useCompounds?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Indicate that suggestions should not come from this dictionary.
|
|
24
|
+
* Words in this dictionary are considered correct, but will not be
|
|
25
|
+
* used when making spell correction suggestions.
|
|
26
|
+
*
|
|
27
|
+
* Note: if a word is suggested by another dictionary, but found in
|
|
28
|
+
* this dictionary, it will be removed from the set of
|
|
29
|
+
* possible suggestions.
|
|
30
|
+
*/
|
|
31
|
+
noSuggest?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Type of file:
|
|
34
|
+
* S - single word per line,
|
|
35
|
+
* W - each line can contain one or more words separated by space,
|
|
36
|
+
* C - each line is treated like code (Camel Case is allowed).
|
|
37
|
+
* Default is S.
|
|
38
|
+
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
39
|
+
* @default "S"
|
|
40
|
+
*/
|
|
41
|
+
type?: DictionaryFileTypes;
|
|
42
|
+
}
|
|
43
|
+
export interface DictionaryDefinitionPreferred extends DictionaryDefinitionBase {
|
|
44
|
+
/** Path to the file. */
|
|
45
|
+
path: DictionaryPath;
|
|
46
|
+
/**
|
|
47
|
+
* Only for legacy dictionary definitions.
|
|
48
|
+
* @deprecated true
|
|
49
|
+
* @deprecationMessage Use `path` instead.
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
file?: undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Used to provide extra data related to the dictionary
|
|
56
|
+
*/
|
|
57
|
+
export interface DictionaryDefinitionAugmented extends DictionaryDefinitionPreferred {
|
|
58
|
+
dictionaryInformation?: DictionaryInformation;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Only for legacy dictionary definitions.
|
|
62
|
+
* @deprecated true
|
|
63
|
+
* @deprecationMessage Use `DictionaryDefinitionPreferred` instead.
|
|
64
|
+
*/
|
|
65
|
+
export interface DictionaryDefinitionAlternate extends DictionaryDefinitionBase {
|
|
66
|
+
/** @hidden */
|
|
67
|
+
path?: undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Path to the file, only for legacy dictionary definitions.
|
|
70
|
+
* @deprecated true
|
|
71
|
+
* @deprecationMessage Use `path` instead.
|
|
72
|
+
*/
|
|
73
|
+
file: DictionaryPath;
|
|
74
|
+
/** @hidden */
|
|
75
|
+
suggestionEditCosts?: undefined;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated true
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
82
|
+
/** Path to the file, if undefined the path to the extension dictionaries is assumed. */
|
|
83
|
+
path?: FsDictionaryPath;
|
|
84
|
+
/**
|
|
85
|
+
* File name.
|
|
86
|
+
* @deprecated true
|
|
87
|
+
* @deprecationMessage Use `path` instead.
|
|
88
|
+
*/
|
|
89
|
+
file: FsDictionaryPath;
|
|
90
|
+
/**
|
|
91
|
+
* Type of file:
|
|
92
|
+
* S - single word per line,
|
|
93
|
+
* W - each line can contain one or more words separated by space,
|
|
94
|
+
* C - each line is treated like code (Camel Case is allowed).
|
|
95
|
+
* Default is S.
|
|
96
|
+
* C is the slowest to load due to the need to split each line based upon code splitting rules.
|
|
97
|
+
* @default "S"
|
|
98
|
+
*/
|
|
99
|
+
type?: DictionaryFileTypes;
|
|
100
|
+
/**
|
|
101
|
+
* @hidden
|
|
102
|
+
*/
|
|
103
|
+
suggestionEditCosts?: undefined;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Specifies the scope of a dictionary.
|
|
107
|
+
*/
|
|
108
|
+
export type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
|
|
109
|
+
/**
|
|
110
|
+
* For Defining Custom dictionaries. They are generally scoped to a
|
|
111
|
+
* `user`, `workspace`, or `folder`.
|
|
112
|
+
* When `addWords` is true, indicates that the spell checker can add words
|
|
113
|
+
* to the file.
|
|
114
|
+
* Note: only plain text files with one word per line are supported at this moment.
|
|
115
|
+
*/
|
|
116
|
+
export interface DictionaryDefinitionCustom extends DictionaryDefinitionPreferred {
|
|
117
|
+
/** Path to custom dictionary text file. */
|
|
118
|
+
path: CustomDictionaryPath;
|
|
119
|
+
/**
|
|
120
|
+
* Defines the scope for when words will be added to the dictionary.
|
|
121
|
+
* Scope values: `user`, `workspace`, `folder`.
|
|
122
|
+
*/
|
|
123
|
+
scope?: CustomDictionaryScope | CustomDictionaryScope[];
|
|
124
|
+
/**
|
|
125
|
+
* When `true`, let's the spell checker know that words can be added to this dictionary.
|
|
126
|
+
*/
|
|
127
|
+
addWords: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* This is the name of a dictionary.
|
|
131
|
+
*
|
|
132
|
+
* Name Format:
|
|
133
|
+
* - Must contain at least 1 number or letter.
|
|
134
|
+
* - Spaces are allowed.
|
|
135
|
+
* - Leading and trailing space will be removed.
|
|
136
|
+
* - Names ARE case-sensitive.
|
|
137
|
+
* - Must not contain `*`, `!`, `;`, `,`, `{`, `}`, `[`, `]`, `~`.
|
|
138
|
+
*
|
|
139
|
+
* @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
140
|
+
*/
|
|
141
|
+
export type DictionaryId = string;
|
|
142
|
+
export type ReplaceEntry = [string, string];
|
|
143
|
+
export type ReplaceMap = ReplaceEntry[];
|
|
144
|
+
/**
|
|
145
|
+
* A File System Path. Relative paths are relative to the configuration file.
|
|
146
|
+
*/
|
|
147
|
+
export type FsDictionaryPath = string;
|
|
148
|
+
/**
|
|
149
|
+
* A File System Path to a dictionary file.
|
|
150
|
+
* @pattern ^.*\.(?:txt|trie)(?:\.gz)?$
|
|
151
|
+
*/
|
|
152
|
+
export type DictionaryPath = string;
|
|
153
|
+
/**
|
|
154
|
+
* A File System Path to a dictionary file.
|
|
155
|
+
*/
|
|
156
|
+
export type CustomDictionaryPath = FsDictionaryPath;
|
|
157
|
+
/**
|
|
158
|
+
* Reference to a dictionary by name.
|
|
159
|
+
* One of:
|
|
160
|
+
* - {@link DictionaryRef}
|
|
161
|
+
* - {@link DictionaryNegRef}
|
|
162
|
+
*/
|
|
163
|
+
export type DictionaryReference = DictionaryRef | DictionaryNegRef;
|
|
164
|
+
/**
|
|
165
|
+
* This a reference to a named dictionary.
|
|
166
|
+
* It is expected to match the name of a dictionary.
|
|
167
|
+
*/
|
|
168
|
+
export type DictionaryRef = DictionaryId;
|
|
169
|
+
/**
|
|
170
|
+
* This a negative reference to a named dictionary.
|
|
171
|
+
*
|
|
172
|
+
* It is used to exclude or include a dictionary by name.
|
|
173
|
+
*
|
|
174
|
+
* The reference starts with 1 or more `!`.
|
|
175
|
+
* - `!<dictionary_name>` - Used to exclude the dictionary matching `<dictionary_name>`.
|
|
176
|
+
* - `!!<dictionary_name>` - Used to re-include a dictionary matching `<dictionary_name>`.
|
|
177
|
+
* Overrides `!<dictionary_name>`.
|
|
178
|
+
* - `!!!<dictionary_name>` - Used to exclude a dictionary matching `<dictionary_name>`.
|
|
179
|
+
* Overrides `!!<dictionary_name>`.
|
|
180
|
+
*
|
|
181
|
+
* @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
182
|
+
*/
|
|
183
|
+
export type DictionaryNegRef = string;
|
|
184
|
+
//# sourceMappingURL=DictionaryDefinition.d.ts.map
|
|
@@ -103,7 +103,7 @@ export interface HunspellInformation {
|
|
|
103
103
|
* MAP (IJ)(IJ)
|
|
104
104
|
* ```
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
type HunspellAffContent = string;
|
|
107
107
|
interface HunspellCosts extends EditCosts {
|
|
108
108
|
/**
|
|
109
109
|
* The cost of inserting / deleting / or swapping any `tryChars`
|
|
@@ -181,7 +181,7 @@ export interface EditCosts {
|
|
|
181
181
|
* - `|` - is a group separator, indicating that the characters on either side
|
|
182
182
|
* are not related.
|
|
183
183
|
*/
|
|
184
|
-
export
|
|
184
|
+
export type CharacterSet = string;
|
|
185
185
|
export interface CharacterSetCosts {
|
|
186
186
|
/**
|
|
187
187
|
* This is a set of characters that can include `-` or `|`
|
package/dist/Parser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type ParserOptions = Record<string, unknown>;
|
|
2
|
+
export type ParserName = string;
|
|
3
3
|
export interface Parser {
|
|
4
4
|
/** Name of parser */
|
|
5
5
|
readonly name: ParserName;
|
|
@@ -74,8 +74,8 @@ export interface ParsedText {
|
|
|
74
74
|
*
|
|
75
75
|
* <!--- cspell:ignore Bjørvika rvika --->
|
|
76
76
|
*/
|
|
77
|
-
export
|
|
78
|
-
export
|
|
77
|
+
export type SourceMap = number[];
|
|
78
|
+
export type Range = readonly [start: number, end: number];
|
|
79
79
|
/**
|
|
80
80
|
* DelegateInfo is used by a parser to delegate parsing a subsection of a document to
|
|
81
81
|
* another parser. The following information is used by the spell checker to match
|
|
@@ -121,6 +121,6 @@ export interface ScopeChain {
|
|
|
121
121
|
*
|
|
122
122
|
* Example: `comment.block.documentation.ts meta.interface.ts source.ts`
|
|
123
123
|
*/
|
|
124
|
-
export
|
|
125
|
-
export
|
|
124
|
+
export type ScopeString = string;
|
|
125
|
+
export type Scope = ScopeChain | ScopeString;
|
|
126
126
|
//# sourceMappingURL=Parser.d.ts.map
|
package/dist/TextMap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type MappedText = Readonly<TransformedText>;
|
|
2
|
+
export type Range = readonly [start: number, end: number];
|
|
3
3
|
export interface Mapped {
|
|
4
4
|
/**
|
|
5
5
|
* `(i, j)` number pairs where
|
|
@@ -29,7 +29,7 @@ interface TransformedText extends PartialOrUndefined<Mapped> {
|
|
|
29
29
|
*/
|
|
30
30
|
range: Range;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
type PartialOrUndefined<T> = {
|
|
33
33
|
[P in keyof T]?: T[P] | undefined;
|
|
34
34
|
};
|
|
35
35
|
export {};
|
package/dist/configFields.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSpellUserSettings } from './CSpellSettingsDef';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
|
|
3
|
+
export type CSpellUserSettingsFields = {
|
|
4
4
|
[key in ConfigKeys]: key;
|
|
5
5
|
};
|
|
6
6
|
export declare const ConfigFields: CSpellUserSettingsFields;
|
package/dist/features.d.ts
CHANGED
|
@@ -23,16 +23,16 @@ export interface FeaturesDeprecated {
|
|
|
23
23
|
*/
|
|
24
24
|
export interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {
|
|
25
25
|
}
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type Feature = FeatureEnableOnly | FeatureWithConfiguration;
|
|
27
|
+
export type FeatureEnableOnly = boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Feature Configuration.
|
|
30
30
|
*/
|
|
31
31
|
export interface FeatureWithConfiguration {
|
|
32
32
|
enable: boolean;
|
|
33
33
|
}
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
34
|
+
export type FeatureNamesKnown = keyof Features;
|
|
35
|
+
export type FeatureNamesExperimental = keyof FeaturesExperimental;
|
|
36
|
+
export type FeatureNamesActive = keyof FeaturesActive;
|
|
37
|
+
export type FeatureNamesDeprecated = keyof FeaturesDeprecated;
|
|
38
38
|
//# sourceMappingURL=features.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { ConfigFields } from './configFields';
|
|
2
2
|
export type { CSpellUserSettingsFields } from './configFields';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export { IssueType, MessageTypes } from './CSpellReporter';
|
|
4
|
+
export type { CSpellReporter, CSpellReporterModule, DebugEmitter, ErrorEmitter, ErrorLike, Issue, MessageEmitter, MessageType, MessageTypeLookup, ProgressBase, ProgressEmitter, ProgressFileBase, ProgressFileBegin, ProgressFileComplete, ProgressItem, ProgressTypes, ResultEmitter, RunResult, SpellingErrorEmitter, } from './CSpellReporter';
|
|
5
|
+
export type { AdvancedCSpellSettings, AdvancedCSpellSettingsWithSourceTrace, BaseSetting, CacheFormat, CacheSettings, CacheStrategy, CommandLineSettings, CSpellPackageSettings, CSpellSettings, CSpellSettingsWithSourceTrace, CSpellUserSettings, CSpellUserSettingsWithComments, ExperimentalBaseSettings, ExperimentalFileSettings, ExtendableSettings, FileSettings, FileSource, FsPath, FSPathResolvable, Glob, GlobDef, ImportFileRef, InMemorySource, LanguageId, LanguageIdMultiple, LanguageIdMultipleNeg, LanguageIdSingle, LanguageSetting, LanguageSettingFilterFields, LanguageSettingFilterFieldsDeprecated, LanguageSettingFilterFieldsPreferred, LegacySettings, LocaleId, LocalId, MergeSource, OverrideFilterFields, OverrideSettings, Pattern, PatternId, PatternRef, Plugin, PnPSettings, PredefinedPatterns, RegExpPatternDefinition, RegExpPatternList, ReporterSettings, ReportingConfiguration, Settings, SimpleGlob, Source, SuggestionsConfiguration, TrustLevel, Version, VersionLatest, VersionLegacy, WorkspaceTrustSettings, } from './CSpellSettingsDef';
|
|
6
|
+
export type { CustomDictionaryPath, CustomDictionaryScope, DictionaryDefinition, DictionaryDefinitionAlternate, DictionaryDefinitionAugmented, DictionaryDefinitionBase, DictionaryDefinitionCustom, DictionaryDefinitionLegacy, DictionaryDefinitionPreferred, DictionaryFileTypes, DictionaryId, DictionaryNegRef, DictionaryPath, DictionaryRef, DictionaryReference, ReplaceEntry, ReplaceMap, } from './DictionaryDefinition';
|
|
5
7
|
export type { CharacterSet, CharacterSetCosts, DictionaryInformation, EditCosts } from './DictionaryInformation';
|
|
6
8
|
export type { Feature, Features } from './features';
|
|
7
9
|
export type { ParsedText, Parser, ParseResult, ParserName, ParserOptions } from './Parser';
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ConfigFields = void 0;
|
|
3
|
+
exports.MessageTypes = exports.IssueType = exports.ConfigFields = void 0;
|
|
18
4
|
// Using old-style of `type` exports because the new style breaks some integrations.
|
|
19
5
|
var configFields_1 = require("./configFields");
|
|
20
6
|
Object.defineProperty(exports, "ConfigFields", { enumerable: true, get: function () { return configFields_1.ConfigFields; } });
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
var CSpellReporter_1 = require("./CSpellReporter");
|
|
8
|
+
Object.defineProperty(exports, "IssueType", { enumerable: true, get: function () { return CSpellReporter_1.IssueType; } });
|
|
9
|
+
Object.defineProperty(exports, "MessageTypes", { enumerable: true, get: function () { return CSpellReporter_1.MessageTypes; } });
|
|
23
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*
|
|
21
21
|
* Note: the default edit distance is 100.
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type SuggestionCostMapDef = CostMapDefReplace | CostMapDefInsDel | CostMapDefSwap;
|
|
24
|
+
export type SuggestionCostsDefs = SuggestionCostMapDef[];
|
|
25
25
|
interface CostMapDefBase {
|
|
26
26
|
/**
|
|
27
27
|
* The set of substrings to map, these are generally single character strings.
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export type Serialize<T> = T extends Function ? never : T extends null ? null : T extends any[] ? SerializeArray<T> : T extends object ? SerializeObj<T> : Primitives<T>;
|
|
2
|
+
type SerializeObj<T extends object> = {
|
|
3
3
|
[K in keyof T]: K extends string | number ? Serialize<T[K]> : never;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
type SerializeArray<T extends Array<any>> = T extends [infer R] ? [Serialize<R>] : T extends [infer R0, infer R1] ? [Serialize<R0>, Serialize<R1>] : T extends [infer R0, infer R1, infer R2] ? [Serialize<R0>, Serialize<R1>, Serialize<R2>] : T extends Array<infer R> ? Serialize<R>[] : never;
|
|
6
|
+
type Primitives<T> = Extract<T, number | string | null | boolean>;
|
|
7
|
+
export type Serializable = number | string | boolean | null | object;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "6.
|
|
6
|
+
"version": "6.15.0",
|
|
7
7
|
"description": "Types for cspell and cspell-lib",
|
|
8
8
|
"type": "commonjs",
|
|
9
9
|
"main": "dist/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"jest": "^29.3.1",
|
|
68
68
|
"rimraf": "^3.0.2",
|
|
69
69
|
"ts-json-schema-generator": "^1.1.2",
|
|
70
|
-
"typescript": "^4.
|
|
70
|
+
"typescript": "^4.9.3"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "8bbc20a6fabe0b95caafb7dac2035764cc73ba13"
|
|
73
73
|
}
|