@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.
- package/{ajv.config.js → ajv.config.cjs} +0 -0
- package/dist/{CSpellReporter.d.ts → cjs/CSpellReporter.d.ts} +1 -1
- package/dist/{CSpellSettingsDef.d.ts → cjs/CSpellSettingsDef.d.ts} +4 -4
- package/dist/{DictionaryDefinition.d.ts → cjs/DictionaryDefinition.d.ts} +1 -1
- package/dist/{DictionaryInformation.d.ts → cjs/DictionaryInformation.d.ts} +1 -1
- package/dist/cjs/Parser/CSpellReporter.d.ts +103 -0
- package/dist/cjs/Parser/CSpellSettingsDef.d.ts +689 -0
- package/dist/cjs/Parser/DictionaryDefinition.d.ts +184 -0
- package/dist/cjs/Parser/DictionaryInformation.d.ts +210 -0
- package/dist/{Parser.d.ts → cjs/Parser/Parser/index.d.ts} +1 -1
- package/dist/{TextMap.d.ts → cjs/Parser/TextMap.d.ts} +0 -0
- package/dist/{TextOffset.d.ts → cjs/Parser/TextOffset.d.ts} +0 -0
- package/dist/{configFields.d.ts → cjs/Parser/configFields.d.ts} +1 -1
- package/dist/{features.d.ts → cjs/Parser/features.d.ts} +0 -0
- package/dist/cjs/Parser/index.cjs +3 -0
- package/dist/{index.d.ts → cjs/Parser/index.d.ts} +12 -12
- package/dist/{suggestionCostsDef.d.ts → cjs/Parser/suggestionCostsDef.d.ts} +0 -0
- package/dist/{types.d.ts → cjs/Parser/types.d.ts} +0 -0
- package/dist/cjs/TextMap.d.ts +36 -0
- package/dist/cjs/TextOffset.d.ts +23 -0
- package/dist/cjs/configFields.d.ts +7 -0
- package/dist/cjs/features.d.ts +38 -0
- package/dist/cjs/index.cjs +68 -0
- package/dist/cjs/index.d.ts +13 -0
- package/dist/cjs/suggestionCostsDef.d.ts +88 -0
- package/dist/cjs/types.d.ts +9 -0
- package/dist/esm/CSpellReporter.d.ts +103 -0
- package/dist/esm/CSpellReporter.js +11 -0
- package/dist/esm/CSpellSettingsDef.d.ts +689 -0
- package/dist/esm/CSpellSettingsDef.js +2 -0
- package/dist/esm/DictionaryDefinition.d.ts +184 -0
- package/dist/esm/DictionaryDefinition.js +2 -0
- package/dist/esm/DictionaryInformation.d.ts +210 -0
- package/dist/esm/DictionaryInformation.js +2 -0
- package/dist/esm/Parser/index.d.ts +126 -0
- package/dist/esm/Parser/index.js +2 -0
- package/dist/esm/TextMap.d.ts +36 -0
- package/dist/esm/TextMap.js +2 -0
- package/dist/esm/TextOffset.d.ts +23 -0
- package/dist/esm/TextOffset.js +2 -0
- package/dist/esm/configFields.d.ts +7 -0
- package/dist/{configFields.js → esm/configFields.js} +1 -4
- package/dist/esm/features.d.ts +38 -0
- package/dist/esm/features.js +3 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/suggestionCostsDef.d.ts +88 -0
- package/dist/esm/suggestionCostsDef.js +2 -0
- package/dist/esm/types.d.ts +9 -0
- package/dist/esm/types.js +4 -0
- package/package.json +53 -27
- package/dist/CSpellReporter.js +0 -14
- package/dist/CSpellSettingsDef.js +0 -3
- package/dist/DictionaryDefinition.js +0 -3
- package/dist/DictionaryInformation.js +0 -3
- package/dist/Parser.js +0 -3
- package/dist/TextMap.js +0 -3
- package/dist/TextOffset.js +0 -3
- package/dist/features.js +0 -4
- package/dist/index.js +0 -9
- package/dist/suggestionCostsDef.js +0 -3
- package/dist/types.js +0 -5
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { DictionaryInformation } from './DictionaryInformation.js';
|
|
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
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { SuggestionCostsDefs } from './suggestionCostsDef.js';
|
|
2
|
+
/**
|
|
3
|
+
* Use by dictionary authors to help improve the quality of suggestions
|
|
4
|
+
* given from the dictionary.
|
|
5
|
+
*
|
|
6
|
+
* Added with `v5.16.0`.
|
|
7
|
+
*/
|
|
8
|
+
export interface DictionaryInformation {
|
|
9
|
+
/**
|
|
10
|
+
* The locale of the dictionary.
|
|
11
|
+
* Example: `nl,nl-be`
|
|
12
|
+
*/
|
|
13
|
+
locale?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The alphabet to use.
|
|
16
|
+
* @default "a-zA-Z"
|
|
17
|
+
*/
|
|
18
|
+
alphabet?: CharacterSet | CharacterSetCosts[];
|
|
19
|
+
/**
|
|
20
|
+
* The accent characters.
|
|
21
|
+
*
|
|
22
|
+
* Default: `"\u0300-\u0341"`
|
|
23
|
+
*/
|
|
24
|
+
accents?: CharacterSet | CharacterSetCosts[];
|
|
25
|
+
/**
|
|
26
|
+
* Define edit costs.
|
|
27
|
+
*/
|
|
28
|
+
costs?: EditCosts;
|
|
29
|
+
/**
|
|
30
|
+
* Used in making suggestions. The lower the value, the more likely the suggestion
|
|
31
|
+
* will be near the top of the suggestion list.
|
|
32
|
+
*/
|
|
33
|
+
suggestionEditCosts?: SuggestionCostsDefs | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Used by dictionary authors
|
|
36
|
+
*/
|
|
37
|
+
hunspellInformation?: HunspellInformation;
|
|
38
|
+
/**
|
|
39
|
+
* A collection of patterns to test against the suggested words.
|
|
40
|
+
* If the word matches the pattern, then the penalty is applied.
|
|
41
|
+
*/
|
|
42
|
+
adjustments?: PatternAdjustment[];
|
|
43
|
+
/**
|
|
44
|
+
* An optional set of characters that can possibly be removed from a word before
|
|
45
|
+
* checking it.
|
|
46
|
+
*
|
|
47
|
+
* This is useful in languages like Arabic where Harakat accents are optional.
|
|
48
|
+
*
|
|
49
|
+
* Note: All matching characters are removed or none. Partial removal is not supported.
|
|
50
|
+
*/
|
|
51
|
+
ignore?: CharacterSet;
|
|
52
|
+
}
|
|
53
|
+
export interface HunspellInformation {
|
|
54
|
+
/**
|
|
55
|
+
* Selected Hunspell AFF content.
|
|
56
|
+
* The content must be UTF-8
|
|
57
|
+
*
|
|
58
|
+
* Sections:
|
|
59
|
+
* - TRY
|
|
60
|
+
* - MAP
|
|
61
|
+
* - REP
|
|
62
|
+
* - KEY
|
|
63
|
+
* - ICONV
|
|
64
|
+
* - OCONV
|
|
65
|
+
*
|
|
66
|
+
* Example:
|
|
67
|
+
* ```hunspell
|
|
68
|
+
* # Comment
|
|
69
|
+
* TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
|
|
70
|
+
* MAP aàâäAÀÂÄ
|
|
71
|
+
* MAP eéèêëEÉÈÊË
|
|
72
|
+
* MAP iîïyIÎÏY
|
|
73
|
+
* MAP oôöOÔÖ
|
|
74
|
+
* MAP (IJ)(IJ)
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
aff: HunspellAffContent;
|
|
78
|
+
/** The costs to apply when using the hunspell settings */
|
|
79
|
+
costs?: HunspellCosts;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Selected Hunspell AFF content.
|
|
83
|
+
* The content must be UTF-8
|
|
84
|
+
*
|
|
85
|
+
* Sections:
|
|
86
|
+
* - TRY
|
|
87
|
+
* - NO-TRY
|
|
88
|
+
* - MAP
|
|
89
|
+
* - REP
|
|
90
|
+
* - KEY
|
|
91
|
+
* - ICONV
|
|
92
|
+
* - OCONV
|
|
93
|
+
*
|
|
94
|
+
* Example:
|
|
95
|
+
* ```hunspell
|
|
96
|
+
* # Comment
|
|
97
|
+
* TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
|
|
98
|
+
* NO-TRY -0123456789 # Discourage adding numbers and dashes.
|
|
99
|
+
* MAP aàâäAÀÂÄ
|
|
100
|
+
* MAP eéèêëEÉÈÊË
|
|
101
|
+
* MAP iîïyIÎÏY
|
|
102
|
+
* MAP oôöOÔÖ
|
|
103
|
+
* MAP (IJ)(IJ)
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
type HunspellAffContent = string;
|
|
107
|
+
interface HunspellCosts extends EditCosts {
|
|
108
|
+
/**
|
|
109
|
+
* The cost of inserting / deleting / or swapping any `tryChars`
|
|
110
|
+
* Defaults to `baseCosts`
|
|
111
|
+
*/
|
|
112
|
+
tryCharCost?: number;
|
|
113
|
+
/**
|
|
114
|
+
* The cost of replacing or swapping any adjacent keyboard characters.
|
|
115
|
+
*
|
|
116
|
+
* This should be slightly cheaper than `tryCharCost`.
|
|
117
|
+
* @default 99
|
|
118
|
+
*/
|
|
119
|
+
keyboardCost?: number;
|
|
120
|
+
/**
|
|
121
|
+
* mapSet replacement cost is the cost to substitute one character with another from
|
|
122
|
+
* the same set.
|
|
123
|
+
*
|
|
124
|
+
* Map characters are considered very similar to each other and are often
|
|
125
|
+
* the cause of simple mistakes.
|
|
126
|
+
*
|
|
127
|
+
* @default 25
|
|
128
|
+
*/
|
|
129
|
+
mapCost?: number;
|
|
130
|
+
/**
|
|
131
|
+
* The cost to convert between convert pairs.
|
|
132
|
+
*
|
|
133
|
+
* The value should be slightly higher than the mapCost.
|
|
134
|
+
*
|
|
135
|
+
* @default 30
|
|
136
|
+
*/
|
|
137
|
+
ioConvertCost?: number;
|
|
138
|
+
/**
|
|
139
|
+
* The cost to substitute pairs found in the replace settings.
|
|
140
|
+
*
|
|
141
|
+
* @default 75
|
|
142
|
+
*/
|
|
143
|
+
replaceCosts?: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
export interface EditCosts {
|
|
149
|
+
/**
|
|
150
|
+
* This is the base cost for making an edit.
|
|
151
|
+
* @default 100
|
|
152
|
+
*/
|
|
153
|
+
baseCost?: number;
|
|
154
|
+
/**
|
|
155
|
+
* This is the cost for characters not in the alphabet.
|
|
156
|
+
* @default 110
|
|
157
|
+
*/
|
|
158
|
+
nonAlphabetCosts?: number;
|
|
159
|
+
/**
|
|
160
|
+
* The extra cost incurred for changing the first letter of a word.
|
|
161
|
+
* This value should be less than `100 - baseCost`.
|
|
162
|
+
* @default 4
|
|
163
|
+
*/
|
|
164
|
+
firstLetterPenalty?: number;
|
|
165
|
+
/**
|
|
166
|
+
* The cost to change capitalization.
|
|
167
|
+
* This should be very cheap, it helps with fixing capitalization issues.
|
|
168
|
+
* @default 1
|
|
169
|
+
*/
|
|
170
|
+
capsCosts?: number;
|
|
171
|
+
/**
|
|
172
|
+
* The cost to add / remove an accent
|
|
173
|
+
* This should be very cheap, it helps with fixing accent issues.
|
|
174
|
+
* @default 1
|
|
175
|
+
*/
|
|
176
|
+
accentCosts?: number;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* This is a set of characters that can include `-` or `|`
|
|
180
|
+
* - `-` - indicates a range of characters: `a-c` => `abc`
|
|
181
|
+
* - `|` - is a group separator, indicating that the characters on either side
|
|
182
|
+
* are not related.
|
|
183
|
+
*/
|
|
184
|
+
export type CharacterSet = string;
|
|
185
|
+
export interface CharacterSetCosts {
|
|
186
|
+
/**
|
|
187
|
+
* This is a set of characters that can include `-` or `|`
|
|
188
|
+
* - `-` - indicates a range of characters: `a-c` => `abc`
|
|
189
|
+
* - `|` - is a group separator, indicating that the characters on either side
|
|
190
|
+
* are not related.
|
|
191
|
+
*/
|
|
192
|
+
characters: CharacterSet;
|
|
193
|
+
/** the cost to insert / delete / replace / swap the characters in a group */
|
|
194
|
+
cost: number;
|
|
195
|
+
/**
|
|
196
|
+
* The penalty cost to apply if the accent is used.
|
|
197
|
+
* This is used to discourage
|
|
198
|
+
*/
|
|
199
|
+
penalty?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface PatternAdjustment {
|
|
202
|
+
/** Id of the Adjustment, i.e. `short-compound` */
|
|
203
|
+
id: string;
|
|
204
|
+
/** RegExp pattern to match */
|
|
205
|
+
regexp: string | RegExp;
|
|
206
|
+
/** The amount of penalty to apply. */
|
|
207
|
+
penalty: number;
|
|
208
|
+
}
|
|
209
|
+
export {};
|
|
210
|
+
//# sourceMappingURL=DictionaryInformation.d.ts.map
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSpellUserSettings } from './CSpellSettingsDef';
|
|
1
|
+
import type { CSpellUserSettings } from './CSpellSettingsDef.js';
|
|
2
2
|
export type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
|
|
3
3
|
export type CSpellUserSettingsFields = {
|
|
4
4
|
[key in ConfigKeys]: key;
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export type { CSpellUserSettingsFields } from './configFields';
|
|
2
|
-
export { ConfigFields } from './configFields';
|
|
3
|
-
export type { CSpellReporter, CSpellReporterModule, DebugEmitter, ErrorEmitter, ErrorLike, Issue, MessageEmitter, MessageType, MessageTypeLookup, ProgressBase, ProgressEmitter, ProgressFileBase, ProgressFileBegin, ProgressFileComplete, ProgressItem, ProgressTypes, ResultEmitter, RunResult, SpellingErrorEmitter, } from './CSpellReporter';
|
|
4
|
-
export { IssueType, MessageTypes } 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';
|
|
7
|
-
export type { CharacterSet, CharacterSetCosts, DictionaryInformation, EditCosts } from './DictionaryInformation';
|
|
8
|
-
export type { Feature, Features } from './features';
|
|
9
|
-
export type { ParsedText, Parser, ParseResult, ParserName, ParserOptions } from './Parser';
|
|
10
|
-
export type { SuggestionCostMapDef, SuggestionCostsDefs } from './suggestionCostsDef';
|
|
11
|
-
export type { MappedText } from './TextMap';
|
|
12
|
-
export type { TextDocumentOffset, TextOffset } from './TextOffset';
|
|
1
|
+
export type { CSpellUserSettingsFields } from './configFields.js';
|
|
2
|
+
export { ConfigFields } from './configFields.js';
|
|
3
|
+
export type { CSpellReporter, CSpellReporterModule, DebugEmitter, ErrorEmitter, ErrorLike, Issue, MessageEmitter, MessageType, MessageTypeLookup, ProgressBase, ProgressEmitter, ProgressFileBase, ProgressFileBegin, ProgressFileComplete, ProgressItem, ProgressTypes, ResultEmitter, RunResult, SpellingErrorEmitter, } from './CSpellReporter.js';
|
|
4
|
+
export { IssueType, MessageTypes } from './CSpellReporter.js';
|
|
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.js';
|
|
6
|
+
export type { CustomDictionaryPath, CustomDictionaryScope, DictionaryDefinition, DictionaryDefinitionAlternate, DictionaryDefinitionAugmented, DictionaryDefinitionBase, DictionaryDefinitionCustom, DictionaryDefinitionLegacy, DictionaryDefinitionPreferred, DictionaryFileTypes, DictionaryId, DictionaryNegRef, DictionaryPath, DictionaryRef, DictionaryReference, ReplaceEntry, ReplaceMap, } from './DictionaryDefinition.js';
|
|
7
|
+
export type { CharacterSet, CharacterSetCosts, DictionaryInformation, EditCosts } from './DictionaryInformation.js';
|
|
8
|
+
export type { Feature, Features } from './features.js';
|
|
9
|
+
export type { ParsedText, Parser, ParseResult, ParserName, ParserOptions } from './Parser/index.js';
|
|
10
|
+
export type { SuggestionCostMapDef, SuggestionCostsDefs } from './suggestionCostsDef.js';
|
|
11
|
+
export type { MappedText } from './TextMap.js';
|
|
12
|
+
export type { TextDocumentOffset, TextOffset } from './TextOffset.js';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type MappedText = Readonly<TransformedText>;
|
|
2
|
+
export type Range = readonly [start: number, end: number];
|
|
3
|
+
export interface Mapped {
|
|
4
|
+
/**
|
|
5
|
+
* `(i, j)` number pairs where
|
|
6
|
+
* - `i` is the offset in the source
|
|
7
|
+
* - `j` is the offset in the destination
|
|
8
|
+
*
|
|
9
|
+
* Example:
|
|
10
|
+
* - source text = `"caf\xe9"`
|
|
11
|
+
* - mapped text = `"café"`
|
|
12
|
+
* - map = `[3, 3, 7, 4]`, which is equivalent to `[0, 0, 3, 3, 7, 4]`
|
|
13
|
+
* where the `[0, 0]` is unnecessary.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
map: number[];
|
|
17
|
+
}
|
|
18
|
+
interface TransformedText extends PartialOrUndefined<Mapped> {
|
|
19
|
+
/**
|
|
20
|
+
* Transformed text with an optional map.
|
|
21
|
+
*/
|
|
22
|
+
text: string;
|
|
23
|
+
/**
|
|
24
|
+
* The original text
|
|
25
|
+
*/
|
|
26
|
+
rawText?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The start and end offset of the text in the document.
|
|
29
|
+
*/
|
|
30
|
+
range: Range;
|
|
31
|
+
}
|
|
32
|
+
type PartialOrUndefined<T> = {
|
|
33
|
+
[P in keyof T]?: T[P] | undefined;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=TextMap.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface TextOffset {
|
|
2
|
+
/**
|
|
3
|
+
* The text found at the offset. If the text has been transformed, then the length might not match `length`.
|
|
4
|
+
* Example: Original: `cafe\u0301`, text: `café`
|
|
5
|
+
*/
|
|
6
|
+
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* The offset into the document.
|
|
9
|
+
*/
|
|
10
|
+
offset: number;
|
|
11
|
+
/**
|
|
12
|
+
* Assumed to match `text.length` if the text has not been transformed.
|
|
13
|
+
*/
|
|
14
|
+
length?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface TextDocumentOffset extends TextOffset {
|
|
17
|
+
uri?: string;
|
|
18
|
+
doc: string;
|
|
19
|
+
row: number;
|
|
20
|
+
col: number;
|
|
21
|
+
line: TextOffset;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=TextOffset.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSpellUserSettings } from './CSpellSettingsDef.js';
|
|
2
|
+
export type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
|
|
3
|
+
export type CSpellUserSettingsFields = {
|
|
4
|
+
[key in ConfigKeys]: key;
|
|
5
|
+
};
|
|
6
|
+
export declare const ConfigFields: CSpellUserSettingsFields;
|
|
7
|
+
//# sourceMappingURL=configFields.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are experimental features and are subject to change or removal without notice.
|
|
3
|
+
*/
|
|
4
|
+
export interface FeaturesExperimental {
|
|
5
|
+
/**
|
|
6
|
+
* Enable/disable using weighted suggestions.
|
|
7
|
+
*/
|
|
8
|
+
'weighted-suggestions': FeatureEnableOnly;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* These are the current set of active features
|
|
12
|
+
*/
|
|
13
|
+
export interface FeaturesActive {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* These are feature settings that have been deprecated or moved elsewhere they will have no
|
|
17
|
+
* effect on the code but are here to prevent schema errors. The will get cleaned out on major versions.
|
|
18
|
+
*/
|
|
19
|
+
export interface FeaturesDeprecated {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Features are behaviors or settings that can be explicitly configured.
|
|
23
|
+
*/
|
|
24
|
+
export interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {
|
|
25
|
+
}
|
|
26
|
+
export type Feature = FeatureEnableOnly | FeatureWithConfiguration;
|
|
27
|
+
export type FeatureEnableOnly = boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Feature Configuration.
|
|
30
|
+
*/
|
|
31
|
+
export interface FeatureWithConfiguration {
|
|
32
|
+
enable: boolean;
|
|
33
|
+
}
|
|
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
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ConfigFields = {
|
|
4
|
+
allowCompoundWords: 'allowCompoundWords',
|
|
5
|
+
cache: 'cache',
|
|
6
|
+
caseSensitive: 'caseSensitive',
|
|
7
|
+
description: 'description',
|
|
8
|
+
dictionaries: 'dictionaries',
|
|
9
|
+
dictionaryDefinitions: 'dictionaryDefinitions',
|
|
10
|
+
enabled: 'enabled',
|
|
11
|
+
enabledLanguageIds: 'enabledLanguageIds',
|
|
12
|
+
enableFiletypes: 'enableFiletypes',
|
|
13
|
+
enableGlobDot: 'enableGlobDot',
|
|
14
|
+
failFast: 'failFast',
|
|
15
|
+
features: 'features',
|
|
16
|
+
files: 'files',
|
|
17
|
+
flagWords: 'flagWords',
|
|
18
|
+
gitignoreRoot: 'gitignoreRoot',
|
|
19
|
+
globRoot: 'globRoot',
|
|
20
|
+
ignorePaths: 'ignorePaths',
|
|
21
|
+
ignoreRegExpList: 'ignoreRegExpList',
|
|
22
|
+
ignoreWords: 'ignoreWords',
|
|
23
|
+
import: 'import',
|
|
24
|
+
includeRegExpList: 'includeRegExpList',
|
|
25
|
+
language: 'language',
|
|
26
|
+
languageId: 'languageId',
|
|
27
|
+
languageSettings: 'languageSettings',
|
|
28
|
+
loadDefaultConfiguration: 'loadDefaultConfiguration',
|
|
29
|
+
maxDuplicateProblems: 'maxDuplicateProblems',
|
|
30
|
+
maxNumberOfProblems: 'maxNumberOfProblems',
|
|
31
|
+
minWordLength: 'minWordLength',
|
|
32
|
+
name: 'name',
|
|
33
|
+
noConfigSearch: 'noConfigSearch',
|
|
34
|
+
noSuggestDictionaries: 'noSuggestDictionaries',
|
|
35
|
+
numSuggestions: 'numSuggestions',
|
|
36
|
+
overrides: 'overrides',
|
|
37
|
+
patterns: 'patterns',
|
|
38
|
+
pnpFiles: 'pnpFiles',
|
|
39
|
+
readonly: 'readonly',
|
|
40
|
+
reporters: 'reporters',
|
|
41
|
+
showStatus: 'showStatus',
|
|
42
|
+
spellCheckDelayMs: 'spellCheckDelayMs',
|
|
43
|
+
suggestionNumChanges: 'suggestionNumChanges',
|
|
44
|
+
suggestionsTimeout: 'suggestionsTimeout',
|
|
45
|
+
useGitignore: 'useGitignore',
|
|
46
|
+
usePnP: 'usePnP',
|
|
47
|
+
userWords: 'userWords',
|
|
48
|
+
validateDirectives: 'validateDirectives',
|
|
49
|
+
words: 'words',
|
|
50
|
+
// Experimental
|
|
51
|
+
parser: 'parser',
|
|
52
|
+
};
|
|
53
|
+
// export const ConfigKeysNames = Object.values(ConfigKeysByField);
|
|
54
|
+
|
|
55
|
+
exports.IssueType = void 0;
|
|
56
|
+
(function (IssueType) {
|
|
57
|
+
IssueType[IssueType["spelling"] = 0] = "spelling";
|
|
58
|
+
IssueType[IssueType["directive"] = 1] = "directive";
|
|
59
|
+
})(exports.IssueType = exports.IssueType || (exports.IssueType = {}));
|
|
60
|
+
const MessageTypes = {
|
|
61
|
+
Debug: 'Debug',
|
|
62
|
+
Info: 'Info',
|
|
63
|
+
Warning: 'Warning',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.ConfigFields = ConfigFields;
|
|
67
|
+
exports.MessageTypes = MessageTypes;
|
|
68
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { CSpellUserSettingsFields } from './configFields.js';
|
|
2
|
+
export { ConfigFields } from './configFields.js';
|
|
3
|
+
export type { CSpellReporter, CSpellReporterModule, DebugEmitter, ErrorEmitter, ErrorLike, Issue, MessageEmitter, MessageType, MessageTypeLookup, ProgressBase, ProgressEmitter, ProgressFileBase, ProgressFileBegin, ProgressFileComplete, ProgressItem, ProgressTypes, ResultEmitter, RunResult, SpellingErrorEmitter, } from './CSpellReporter.js';
|
|
4
|
+
export { IssueType, MessageTypes } from './CSpellReporter.js';
|
|
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.js';
|
|
6
|
+
export type { CustomDictionaryPath, CustomDictionaryScope, DictionaryDefinition, DictionaryDefinitionAlternate, DictionaryDefinitionAugmented, DictionaryDefinitionBase, DictionaryDefinitionCustom, DictionaryDefinitionLegacy, DictionaryDefinitionPreferred, DictionaryFileTypes, DictionaryId, DictionaryNegRef, DictionaryPath, DictionaryRef, DictionaryReference, ReplaceEntry, ReplaceMap, } from './DictionaryDefinition.js';
|
|
7
|
+
export type { CharacterSet, CharacterSetCosts, DictionaryInformation, EditCosts } from './DictionaryInformation.js';
|
|
8
|
+
export type { Feature, Features } from './features.js';
|
|
9
|
+
export type { ParsedText, Parser, ParseResult, ParserName, ParserOptions } from './Parser/index.js';
|
|
10
|
+
export type { SuggestionCostMapDef, SuggestionCostsDefs } from './suggestionCostsDef.js';
|
|
11
|
+
export type { MappedText } from './TextMap.js';
|
|
12
|
+
export type { TextDocumentOffset, TextOffset } from './TextOffset.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|