@cspell/cspell-types 6.19.2 → 6.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/{ajv.config.js → ajv.config.cjs} +0 -0
  2. package/dist/{CSpellReporter.d.ts → cjs/CSpellReporter.d.ts} +1 -1
  3. package/dist/{CSpellSettingsDef.d.ts → cjs/CSpellSettingsDef.d.ts} +4 -4
  4. package/dist/{DictionaryDefinition.d.ts → cjs/DictionaryDefinition.d.ts} +1 -1
  5. package/dist/{DictionaryInformation.d.ts → cjs/DictionaryInformation.d.ts} +1 -1
  6. package/dist/cjs/Parser/CSpellReporter.d.ts +103 -0
  7. package/dist/cjs/Parser/CSpellSettingsDef.d.ts +689 -0
  8. package/dist/cjs/Parser/DictionaryDefinition.d.ts +184 -0
  9. package/dist/cjs/Parser/DictionaryInformation.d.ts +210 -0
  10. package/dist/{Parser.d.ts → cjs/Parser/Parser/index.d.ts} +1 -1
  11. package/dist/{TextMap.d.ts → cjs/Parser/TextMap.d.ts} +0 -0
  12. package/dist/{TextOffset.d.ts → cjs/Parser/TextOffset.d.ts} +0 -0
  13. package/dist/{configFields.d.ts → cjs/Parser/configFields.d.ts} +1 -1
  14. package/dist/{features.d.ts → cjs/Parser/features.d.ts} +0 -0
  15. package/dist/cjs/Parser/index.cjs +3 -0
  16. package/dist/{index.d.ts → cjs/Parser/index.d.ts} +12 -12
  17. package/dist/{suggestionCostsDef.d.ts → cjs/Parser/suggestionCostsDef.d.ts} +0 -0
  18. package/dist/{types.d.ts → cjs/Parser/types.d.ts} +0 -0
  19. package/dist/cjs/TextMap.d.ts +36 -0
  20. package/dist/cjs/TextOffset.d.ts +23 -0
  21. package/dist/cjs/configFields.d.ts +7 -0
  22. package/dist/cjs/features.d.ts +38 -0
  23. package/dist/cjs/index.cjs +68 -0
  24. package/dist/cjs/index.d.ts +13 -0
  25. package/dist/cjs/suggestionCostsDef.d.ts +88 -0
  26. package/dist/cjs/types.d.ts +9 -0
  27. package/dist/esm/CSpellReporter.d.ts +103 -0
  28. package/dist/esm/CSpellReporter.js +11 -0
  29. package/dist/esm/CSpellSettingsDef.d.ts +689 -0
  30. package/dist/esm/CSpellSettingsDef.js +2 -0
  31. package/dist/esm/DictionaryDefinition.d.ts +184 -0
  32. package/dist/esm/DictionaryDefinition.js +2 -0
  33. package/dist/esm/DictionaryInformation.d.ts +210 -0
  34. package/dist/esm/DictionaryInformation.js +2 -0
  35. package/dist/esm/Parser/index.d.ts +126 -0
  36. package/dist/esm/Parser/index.js +2 -0
  37. package/dist/esm/TextMap.d.ts +36 -0
  38. package/dist/esm/TextMap.js +2 -0
  39. package/dist/esm/TextOffset.d.ts +23 -0
  40. package/dist/esm/TextOffset.js +2 -0
  41. package/dist/esm/configFields.d.ts +7 -0
  42. package/dist/{configFields.js → esm/configFields.js} +1 -4
  43. package/dist/esm/features.d.ts +38 -0
  44. package/dist/esm/features.js +3 -0
  45. package/dist/esm/index.d.ts +13 -0
  46. package/dist/esm/index.js +3 -0
  47. package/dist/esm/suggestionCostsDef.d.ts +88 -0
  48. package/dist/esm/suggestionCostsDef.js +2 -0
  49. package/dist/esm/types.d.ts +9 -0
  50. package/dist/esm/types.js +4 -0
  51. package/package.json +53 -27
  52. package/dist/CSpellReporter.js +0 -14
  53. package/dist/CSpellSettingsDef.js +0 -3
  54. package/dist/DictionaryDefinition.js +0 -3
  55. package/dist/DictionaryInformation.js +0 -3
  56. package/dist/Parser.js +0 -3
  57. package/dist/TextMap.js +0 -3
  58. package/dist/TextOffset.js +0 -3
  59. package/dist/features.js +0 -4
  60. package/dist/index.js +0 -9
  61. package/dist/suggestionCostsDef.js +0 -3
  62. package/dist/types.js +0 -5
@@ -0,0 +1,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DictionaryDefinition.js.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
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DictionaryInformation.js.map
@@ -0,0 +1,126 @@
1
+ export type ParserOptions = Record<string, unknown>;
2
+ export type ParserName = string;
3
+ export interface Parser {
4
+ /** Name of parser */
5
+ readonly name: ParserName;
6
+ /**
7
+ * Parse Method
8
+ * @param content - full content of the file
9
+ * @param filename - filename
10
+ */
11
+ parse(content: string, filename: string): ParseResult;
12
+ }
13
+ export interface ParseResult {
14
+ readonly content: string;
15
+ readonly filename: string;
16
+ readonly parsedTexts: Iterable<ParsedText>;
17
+ }
18
+ export interface ParsedText {
19
+ /**
20
+ * The text extracted and possibly transformed
21
+ */
22
+ readonly text: string;
23
+ /**
24
+ * The raw text before it has been transformed
25
+ */
26
+ readonly rawText?: string | undefined;
27
+ /**
28
+ * start and end offsets of the text
29
+ */
30
+ readonly range: Range;
31
+ /**
32
+ * The Scope annotation for a segment of text.
33
+ * Used by the spell checker to apply spell checking options
34
+ * based upon the value of the scope.
35
+ */
36
+ readonly scope?: Scope | undefined;
37
+ /**
38
+ * The source map is used to support text transformations.
39
+ *
40
+ * See: {@link SourceMap}
41
+ */
42
+ readonly map?: SourceMap | undefined;
43
+ /**
44
+ * Used to delegate parsing the contents of `text` to another parser.
45
+ *
46
+ */
47
+ readonly delegate?: DelegateInfo | undefined;
48
+ }
49
+ /**
50
+ * A SourceMap is used to map transform a piece of text back to its original text.
51
+ * This is necessary in order to report the correct location of a spelling issue.
52
+ * An empty source map indicates that it was a 1:1 transformation.
53
+ *
54
+ * The values in a source map are number pairs (even, odd) relative to the beginning of each
55
+ * string segment.
56
+ * - even - offset in the source text
57
+ * - odd - offset in the transformed text
58
+ *
59
+ * Offsets start a 0
60
+ *
61
+ * Example:
62
+ *
63
+ * - Original text: `Grand Caf\u00e9 Bj\u00f8rvika`
64
+ * - Transformed text: `Grand Café Bjørvika`
65
+ * - Map: [9, 9, 15, 10, 18, 13, 24, 14]
66
+ *
67
+ * | offset | original | offset | transformed |
68
+ * | ------ | ----------- | ------ | ----------- |
69
+ * | 0-9 | `Grand Caf` | 0-9 | `Grand Caf` |
70
+ * | 9-15 | `\u00e9` | 9-10 | `é` |
71
+ * | 15-18 | ` Bj` | 10-13 | ` Bj` |
72
+ * | 18-24 | `\u00f8` | 13-14 | `ø` |
73
+ * | 24-29 | `rvika` | 14-19 | `rvika` |
74
+ *
75
+ * <!--- cspell:ignore Bjørvika rvika --->
76
+ */
77
+ export type SourceMap = number[];
78
+ export type Range = readonly [start: number, end: number];
79
+ /**
80
+ * DelegateInfo is used by a parser to delegate parsing a subsection of a document to
81
+ * another parser. The following information is used by the spell checker to match
82
+ * the parser.
83
+ */
84
+ export interface DelegateInfo {
85
+ /**
86
+ * Proposed virtual file name including the extension.
87
+ * Format: `./${source_filename}/${block_number}.${ext}
88
+ * Example: `./README.md/1.js`
89
+ */
90
+ readonly filename: string;
91
+ /**
92
+ * The filename of the origin of the virtual file block.
93
+ * Example: `./README.md`
94
+ */
95
+ readonly originFilename: string;
96
+ /**
97
+ * Proposed file extension
98
+ * Example: `.js`
99
+ */
100
+ readonly extension: string;
101
+ /**
102
+ * Filetype to use
103
+ * Example: `javascript`
104
+ */
105
+ readonly fileType?: string;
106
+ }
107
+ /**
108
+ * Scope - chain of scope going from local to global
109
+ *
110
+ * Example:
111
+ * ```
112
+ * `comment.block.documentation.ts` -> `meta.interface.ts` -> `source.ts`
113
+ * ```
114
+ */
115
+ export interface ScopeChain {
116
+ readonly value: string;
117
+ readonly parent?: ScopeChain | undefined;
118
+ }
119
+ /**
120
+ * A string representing a scope chain separated by spaces
121
+ *
122
+ * Example: `comment.block.documentation.ts meta.interface.ts source.ts`
123
+ */
124
+ export type ScopeString = string;
125
+ export type Scope = ScopeChain | ScopeString;
126
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TextMap.js.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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TextOffset.js.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
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConfigFields = void 0;
4
- exports.ConfigFields = {
1
+ export const ConfigFields = {
5
2
  allowCompoundWords: 'allowCompoundWords',
6
3
  cache: 'cache',
7
4
  caseSensitive: 'caseSensitive',
@@ -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,3 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-interface */
2
+ export {};
3
+ //# sourceMappingURL=features.js.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
@@ -0,0 +1,3 @@
1
+ export { ConfigFields } from './configFields.js';
2
+ export { IssueType, MessageTypes } from './CSpellReporter.js';
3
+ //# sourceMappingURL=index.js.map