@cspell/cspell-types 6.14.1 → 6.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CSpellReporter.d.ts +11 -11
- package/dist/CSpellSettingsDef.d.ts +38 -38
- 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/suggestionCostsDef.d.ts +2 -2
- package/dist/types.d.ts +5 -5
- package/package.json +4 -4
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;
|
|
@@ -2,13 +2,13 @@ import type { DictionaryInformation } from './DictionaryInformation';
|
|
|
2
2
|
import type { Features } from './features';
|
|
3
3
|
import { Parser, ParserName } from './Parser';
|
|
4
4
|
import { Serializable } from './types';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type ReplaceEntry = [string, string];
|
|
6
|
+
export type ReplaceMap = ReplaceEntry[];
|
|
7
7
|
/**
|
|
8
8
|
* These settings come from user and workspace settings.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type CSpellPackageSettings = CSpellUserSettings;
|
|
11
|
+
export type CSpellUserSettings = CSpellSettings;
|
|
12
12
|
export interface CSpellSettings extends FileSettings, LegacySettings {
|
|
13
13
|
}
|
|
14
14
|
export interface ImportFileRef {
|
|
@@ -268,8 +268,8 @@ export interface PnPSettings {
|
|
|
268
268
|
* - `metadata` - uses the file system timestamp and size to detect changes (fastest).
|
|
269
269
|
* - `content` - uses a hash of the file content to check file changes (slower - more accurate).
|
|
270
270
|
*/
|
|
271
|
-
export
|
|
272
|
-
export
|
|
271
|
+
export type CacheStrategy = 'metadata' | 'content';
|
|
272
|
+
export type CacheFormat = 'legacy' | 'universal';
|
|
273
273
|
export interface CacheSettings {
|
|
274
274
|
/**
|
|
275
275
|
* Store the results of processed files in order to only operate on the changed ones.
|
|
@@ -482,8 +482,8 @@ export interface BaseSetting extends ExperimentalBaseSettings {
|
|
|
482
482
|
*/
|
|
483
483
|
patterns?: RegExpPatternDefinition[];
|
|
484
484
|
}
|
|
485
|
-
export
|
|
486
|
-
export
|
|
485
|
+
export type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
|
|
486
|
+
export type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
|
|
487
487
|
export interface DictionaryDefinitionBase {
|
|
488
488
|
/**
|
|
489
489
|
* This is the name of a dictionary.
|
|
@@ -588,7 +588,7 @@ export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
|
|
|
588
588
|
/**
|
|
589
589
|
* Specifies the scope of a dictionary.
|
|
590
590
|
*/
|
|
591
|
-
export
|
|
591
|
+
export type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
|
|
592
592
|
/**
|
|
593
593
|
* For Defining Custom dictionaries. They are generally scoped to a
|
|
594
594
|
* `user`, `workspace`, or `folder`.
|
|
@@ -630,15 +630,15 @@ export interface LanguageSettingFilterFieldsDeprecated {
|
|
|
630
630
|
local?: LocaleId | LocaleId[];
|
|
631
631
|
}
|
|
632
632
|
/** @hidden */
|
|
633
|
-
|
|
634
|
-
export
|
|
635
|
-
export
|
|
633
|
+
type InternalRegExp = RegExp;
|
|
634
|
+
export type Pattern = string | InternalRegExp;
|
|
635
|
+
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
636
|
/** This matches the name in a pattern definition. */
|
|
637
|
-
export
|
|
637
|
+
export type PatternId = string;
|
|
638
638
|
/** A PatternRef is a Pattern or PatternId. */
|
|
639
|
-
export
|
|
639
|
+
export type PatternRef = Pattern | PatternId | PredefinedPatterns;
|
|
640
640
|
/** A list of pattern names or regular expressions. */
|
|
641
|
-
export
|
|
641
|
+
export type RegExpPatternList = PatternRef[];
|
|
642
642
|
/**
|
|
643
643
|
* This is the name of a dictionary.
|
|
644
644
|
*
|
|
@@ -651,12 +651,12 @@ export declare type RegExpPatternList = PatternRef[];
|
|
|
651
651
|
*
|
|
652
652
|
* @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
653
653
|
*/
|
|
654
|
-
export
|
|
654
|
+
export type DictionaryId = string;
|
|
655
655
|
/**
|
|
656
656
|
* This a reference to a named dictionary.
|
|
657
657
|
* It is expected to match the name of a dictionary.
|
|
658
658
|
*/
|
|
659
|
-
export
|
|
659
|
+
export type DictionaryRef = DictionaryId;
|
|
660
660
|
/**
|
|
661
661
|
* This a negative reference to a named dictionary.
|
|
662
662
|
*
|
|
@@ -671,36 +671,36 @@ export declare type DictionaryRef = DictionaryId;
|
|
|
671
671
|
*
|
|
672
672
|
* @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
|
|
673
673
|
*/
|
|
674
|
-
export
|
|
674
|
+
export type DictionaryNegRef = string;
|
|
675
675
|
/**
|
|
676
676
|
* Reference to a dictionary by name.
|
|
677
677
|
* One of:
|
|
678
678
|
* - {@link DictionaryRef}
|
|
679
679
|
* - {@link DictionaryNegRef}
|
|
680
680
|
*/
|
|
681
|
-
export
|
|
681
|
+
export type DictionaryReference = DictionaryRef | DictionaryNegRef;
|
|
682
682
|
/** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
|
|
683
|
-
export
|
|
683
|
+
export type LocaleId = string;
|
|
684
684
|
/**
|
|
685
685
|
* Configuration File Version.
|
|
686
686
|
*/
|
|
687
|
-
export
|
|
687
|
+
export type VersionLatest = '0.2';
|
|
688
688
|
/**
|
|
689
689
|
* Legacy Configuration File Versions.
|
|
690
690
|
* @deprecated true
|
|
691
691
|
* @deprecationMessage Use `0.2` instead.
|
|
692
692
|
*/
|
|
693
|
-
export
|
|
694
|
-
export
|
|
693
|
+
export type VersionLegacy = '0.1';
|
|
694
|
+
export type Version = VersionLatest | VersionLegacy;
|
|
695
695
|
/**
|
|
696
696
|
* @deprecated true
|
|
697
697
|
* @deprecationMessage Use `LocaleId` instead.
|
|
698
698
|
*/
|
|
699
|
-
export
|
|
699
|
+
export type LocalId = LocaleId;
|
|
700
700
|
/** These are glob expressions. */
|
|
701
|
-
export
|
|
701
|
+
export type Glob = SimpleGlob | GlobDef;
|
|
702
702
|
/** Simple Glob string, the root will be globRoot. */
|
|
703
|
-
export
|
|
703
|
+
export type SimpleGlob = string;
|
|
704
704
|
/**
|
|
705
705
|
* Used to define fully qualified glob patterns.
|
|
706
706
|
* It is currently hidden to make the json-schema a bit easier to use
|
|
@@ -722,22 +722,22 @@ export interface GlobDef {
|
|
|
722
722
|
* This can be '*', 'typescript', 'cpp', 'json', etc.
|
|
723
723
|
* @pattern ^(!?[-\w_\s]+)|(\*)$
|
|
724
724
|
*/
|
|
725
|
-
export
|
|
725
|
+
export type LanguageIdSingle = string;
|
|
726
726
|
/**
|
|
727
727
|
* This can be 'typescript,cpp,json,literal haskell', etc.
|
|
728
728
|
* @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
|
|
729
729
|
*/
|
|
730
|
-
export
|
|
730
|
+
export type LanguageIdMultiple = string;
|
|
731
731
|
/**
|
|
732
732
|
* This can be 'typescript,cpp,json,literal haskell', etc.
|
|
733
733
|
* @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
|
|
734
734
|
*/
|
|
735
|
-
export
|
|
736
|
-
export
|
|
735
|
+
export type LanguageIdMultipleNeg = string;
|
|
736
|
+
export type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
|
|
737
737
|
/**
|
|
738
738
|
* A File System Path. Relative paths are relative to the configuration file.
|
|
739
739
|
*/
|
|
740
|
-
export
|
|
740
|
+
export type FsPath = string;
|
|
741
741
|
/**
|
|
742
742
|
* A File System Path.
|
|
743
743
|
*
|
|
@@ -745,18 +745,18 @@ export declare type FsPath = string;
|
|
|
745
745
|
* - `${cwd}` prefix - will be replaced with the current working directory.
|
|
746
746
|
* - Relative paths are relative to the configuration file.
|
|
747
747
|
*/
|
|
748
|
-
export
|
|
748
|
+
export type FSPathResolvable = FsPath;
|
|
749
749
|
/** Trust Security Level. */
|
|
750
|
-
export
|
|
750
|
+
export type TrustLevel = 'trusted' | 'untrusted';
|
|
751
751
|
/**
|
|
752
752
|
* A File System Path to a dictionary file.
|
|
753
753
|
* @pattern ^.*\.(?:txt|trie)(?:\.gz)?$
|
|
754
754
|
*/
|
|
755
|
-
export
|
|
755
|
+
export type DictionaryPath = string;
|
|
756
756
|
/**
|
|
757
757
|
* A File System Path to a dictionary file.
|
|
758
758
|
*/
|
|
759
|
-
export
|
|
759
|
+
export type CustomDictionaryPath = FsPath;
|
|
760
760
|
export interface RegExpPatternDefinition {
|
|
761
761
|
/**
|
|
762
762
|
* Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
|
|
@@ -772,8 +772,8 @@ export interface RegExpPatternDefinition {
|
|
|
772
772
|
*/
|
|
773
773
|
description?: string | undefined;
|
|
774
774
|
}
|
|
775
|
-
export
|
|
776
|
-
export
|
|
775
|
+
export type CSpellUserSettingsWithComments = CSpellUserSettings;
|
|
776
|
+
export type Source = FileSource | MergeSource | InMemorySource | BaseSource;
|
|
777
777
|
export interface FileSource extends BaseSource {
|
|
778
778
|
/** Name of source. */
|
|
779
779
|
name: string;
|
|
@@ -817,7 +817,7 @@ interface BaseSource {
|
|
|
817
817
|
/**
|
|
818
818
|
* Reporter name or reporter name + reporter config.
|
|
819
819
|
*/
|
|
820
|
-
export
|
|
820
|
+
export type ReporterSettings = string | [string] | [string, Serializable];
|
|
821
821
|
/**
|
|
822
822
|
* Experimental Configuration / Options
|
|
823
823
|
*
|
|
@@ -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
|
|
@@ -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.14.
|
|
6
|
+
"version": "6.14.3",
|
|
7
7
|
"description": "Types for cspell and cspell-lib",
|
|
8
8
|
"type": "commonjs",
|
|
9
9
|
"main": "dist/index.js",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"ajv-cli": "^5.0.0",
|
|
67
|
-
"jest": "^29.
|
|
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": "df0efdbb0dc7b084579130ba5fe97441c0ab67ca"
|
|
73
73
|
}
|