@cspell/cspell-types 10.3.2-alpha.0 → 10.3.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/Parser/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export type { DelegateInfo, MappedText, ParseResult, ParsedTag, ParsedTags, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap };
|
|
1
|
+
import { _ as TextDocumentFragment, a as ParsedTag, c as Parser, d as Scope, f as ScopeChain, g as TextDocument, h as SourceMap, i as ParseResult, l as ParserName, m as Range, n as DelegateInfo, o as ParsedTags, p as ScopeString, r as DocumentParser, s as ParsedText, t as MappedText, u as ParserOptions } from "../index-ClTvqr3-.mjs";
|
|
2
|
+
export type { DelegateInfo, DocumentParser, MappedText, ParseResult, ParsedTag, ParsedTags, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap, TextDocument, TextDocumentFragment };
|
package/dist/Parser/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export type { DelegateInfo, MappedText, ParseResult, ParsedTag, ParsedTags, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap };
|
|
1
|
+
import { _ as TextDocumentFragment, a as ParsedTag, c as Parser, d as Scope, f as ScopeChain, g as TextDocument, h as SourceMap, i as ParseResult, l as ParserName, m as Range, n as DelegateInfo, o as ParsedTags, p as ScopeString, r as DocumentParser, s as ParsedText, t as MappedText, u as ParserOptions } from "../index-ClTvqr3-.js";
|
|
2
|
+
export type { DelegateInfo, DocumentParser, MappedText, ParseResult, ParsedTag, ParsedTags, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap, TextDocument, TextDocumentFragment };
|
|
@@ -49,6 +49,40 @@ type SourceMap = number[];
|
|
|
49
49
|
* The range is inclusive of the start and exclusive of the end.
|
|
50
50
|
*/
|
|
51
51
|
type Range = readonly [start: number, end: number];
|
|
52
|
+
/**
|
|
53
|
+
* Interface used to pass documents to the parser.
|
|
54
|
+
* @since 10.4.0
|
|
55
|
+
*/
|
|
56
|
+
interface TextDocument {
|
|
57
|
+
/**
|
|
58
|
+
* The associated URL for this document. Most documents have the `file:` protocol, indicating that they
|
|
59
|
+
* represent files on disk. However, some documents may have other protocols indicating that they are not
|
|
60
|
+
* available on disk.
|
|
61
|
+
*/
|
|
62
|
+
readonly url: URL | string;
|
|
63
|
+
/**
|
|
64
|
+
* the raw Document Text
|
|
65
|
+
*/
|
|
66
|
+
readonly text: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A fragment of a text document, representing a subset of the full document.
|
|
70
|
+
* @since 10.4.0
|
|
71
|
+
*/
|
|
72
|
+
interface TextDocumentFragment extends TextDocument {
|
|
73
|
+
/**
|
|
74
|
+
* the raw text fragment contained in this document fragment.
|
|
75
|
+
*/
|
|
76
|
+
readonly text: string;
|
|
77
|
+
/**
|
|
78
|
+
* The range of the text fragment within the full text of the document.
|
|
79
|
+
*/
|
|
80
|
+
readonly range: Range;
|
|
81
|
+
/**
|
|
82
|
+
* Optional full text of the document containing this fragment.
|
|
83
|
+
*/
|
|
84
|
+
readonly fullText?: string;
|
|
85
|
+
}
|
|
52
86
|
//#endregion
|
|
53
87
|
//#region src/Parser/Mapped.d.ts
|
|
54
88
|
interface Mapped {
|
|
@@ -78,6 +112,11 @@ type ParserName = string;
|
|
|
78
112
|
interface Parser {
|
|
79
113
|
/** Name of parser */
|
|
80
114
|
readonly name: ParserName;
|
|
115
|
+
/**
|
|
116
|
+
* Parse Method
|
|
117
|
+
* @param document - the text document to parse
|
|
118
|
+
*/
|
|
119
|
+
parseDocument?: ParseDocument;
|
|
81
120
|
/**
|
|
82
121
|
* Parse Method
|
|
83
122
|
* @param content - full content of the file
|
|
@@ -85,9 +124,34 @@ interface Parser {
|
|
|
85
124
|
*/
|
|
86
125
|
parse(content: string, filename: string): ParseResult;
|
|
87
126
|
}
|
|
127
|
+
type ParseDocument = (document: TextDocument) => ParseResult;
|
|
128
|
+
interface DocumentParser {
|
|
129
|
+
/** Name of parser */
|
|
130
|
+
readonly name: ParserName;
|
|
131
|
+
/**
|
|
132
|
+
* Parse Method
|
|
133
|
+
* @param document - the text document to parse
|
|
134
|
+
*/
|
|
135
|
+
parseDocument: ParseDocument;
|
|
136
|
+
/**
|
|
137
|
+
* Parse Method
|
|
138
|
+
* @param content - full content of the file
|
|
139
|
+
* @param filename - filename
|
|
140
|
+
*/
|
|
141
|
+
parse?: (content: string, filename: string) => ParseResult;
|
|
142
|
+
}
|
|
88
143
|
interface ParseResult {
|
|
89
|
-
|
|
90
|
-
|
|
144
|
+
/**
|
|
145
|
+
* The full content of the file being parsed.
|
|
146
|
+
* Optionally returned by the parser.
|
|
147
|
+
* For performance reasons, the parser may choose not to return the full content.
|
|
148
|
+
*/
|
|
149
|
+
readonly content?: string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* The name of the file being parsed.
|
|
152
|
+
* Optionally returned by the parser.
|
|
153
|
+
*/
|
|
154
|
+
readonly filename?: string | undefined;
|
|
91
155
|
readonly parsedTexts: Iterable<ParsedText>;
|
|
92
156
|
}
|
|
93
157
|
interface ParsedText extends Readonly<Mapped> {
|
|
@@ -108,7 +172,7 @@ interface ParsedText extends Readonly<Mapped> {
|
|
|
108
172
|
/**
|
|
109
173
|
* The tags associated with this segment of text.
|
|
110
174
|
*/
|
|
111
|
-
readonly tags?: ParsedTags | undefined;
|
|
175
|
+
readonly tags?: Readonly<ParsedTags> | undefined;
|
|
112
176
|
/**
|
|
113
177
|
* Used to delegate parsing the contents of `text` to another parser.
|
|
114
178
|
*
|
|
@@ -187,5 +251,5 @@ interface TransformedText extends Mapped {
|
|
|
187
251
|
rawText?: string | undefined;
|
|
188
252
|
}
|
|
189
253
|
//#endregion
|
|
190
|
-
export {
|
|
191
|
-
//# sourceMappingURL=index-
|
|
254
|
+
export { TextDocumentFragment as _, ParsedTag as a, Parser as c, Scope as d, ScopeChain as f, TextDocument as g, SourceMap as h, ParseResult as i, ParserName as l, Range as m, DelegateInfo as n, ParsedTags as o, ScopeString as p, DocumentParser as r, ParsedText as s, MappedText as t, ParserOptions as u };
|
|
255
|
+
//# sourceMappingURL=index-ClTvqr3-.d.mts.map
|
|
@@ -49,6 +49,40 @@ type SourceMap = number[];
|
|
|
49
49
|
* The range is inclusive of the start and exclusive of the end.
|
|
50
50
|
*/
|
|
51
51
|
type Range = readonly [start: number, end: number];
|
|
52
|
+
/**
|
|
53
|
+
* Interface used to pass documents to the parser.
|
|
54
|
+
* @since 10.4.0
|
|
55
|
+
*/
|
|
56
|
+
interface TextDocument {
|
|
57
|
+
/**
|
|
58
|
+
* The associated URL for this document. Most documents have the `file:` protocol, indicating that they
|
|
59
|
+
* represent files on disk. However, some documents may have other protocols indicating that they are not
|
|
60
|
+
* available on disk.
|
|
61
|
+
*/
|
|
62
|
+
readonly url: URL | string;
|
|
63
|
+
/**
|
|
64
|
+
* the raw Document Text
|
|
65
|
+
*/
|
|
66
|
+
readonly text: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A fragment of a text document, representing a subset of the full document.
|
|
70
|
+
* @since 10.4.0
|
|
71
|
+
*/
|
|
72
|
+
interface TextDocumentFragment extends TextDocument {
|
|
73
|
+
/**
|
|
74
|
+
* the raw text fragment contained in this document fragment.
|
|
75
|
+
*/
|
|
76
|
+
readonly text: string;
|
|
77
|
+
/**
|
|
78
|
+
* The range of the text fragment within the full text of the document.
|
|
79
|
+
*/
|
|
80
|
+
readonly range: Range;
|
|
81
|
+
/**
|
|
82
|
+
* Optional full text of the document containing this fragment.
|
|
83
|
+
*/
|
|
84
|
+
readonly fullText?: string;
|
|
85
|
+
}
|
|
52
86
|
//#endregion
|
|
53
87
|
//#region src/Parser/Mapped.d.ts
|
|
54
88
|
interface Mapped {
|
|
@@ -78,6 +112,11 @@ type ParserName = string;
|
|
|
78
112
|
interface Parser {
|
|
79
113
|
/** Name of parser */
|
|
80
114
|
readonly name: ParserName;
|
|
115
|
+
/**
|
|
116
|
+
* Parse Method
|
|
117
|
+
* @param document - the text document to parse
|
|
118
|
+
*/
|
|
119
|
+
parseDocument?: ParseDocument;
|
|
81
120
|
/**
|
|
82
121
|
* Parse Method
|
|
83
122
|
* @param content - full content of the file
|
|
@@ -85,9 +124,34 @@ interface Parser {
|
|
|
85
124
|
*/
|
|
86
125
|
parse(content: string, filename: string): ParseResult;
|
|
87
126
|
}
|
|
127
|
+
type ParseDocument = (document: TextDocument) => ParseResult;
|
|
128
|
+
interface DocumentParser {
|
|
129
|
+
/** Name of parser */
|
|
130
|
+
readonly name: ParserName;
|
|
131
|
+
/**
|
|
132
|
+
* Parse Method
|
|
133
|
+
* @param document - the text document to parse
|
|
134
|
+
*/
|
|
135
|
+
parseDocument: ParseDocument;
|
|
136
|
+
/**
|
|
137
|
+
* Parse Method
|
|
138
|
+
* @param content - full content of the file
|
|
139
|
+
* @param filename - filename
|
|
140
|
+
*/
|
|
141
|
+
parse?: (content: string, filename: string) => ParseResult;
|
|
142
|
+
}
|
|
88
143
|
interface ParseResult {
|
|
89
|
-
|
|
90
|
-
|
|
144
|
+
/**
|
|
145
|
+
* The full content of the file being parsed.
|
|
146
|
+
* Optionally returned by the parser.
|
|
147
|
+
* For performance reasons, the parser may choose not to return the full content.
|
|
148
|
+
*/
|
|
149
|
+
readonly content?: string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* The name of the file being parsed.
|
|
152
|
+
* Optionally returned by the parser.
|
|
153
|
+
*/
|
|
154
|
+
readonly filename?: string | undefined;
|
|
91
155
|
readonly parsedTexts: Iterable<ParsedText>;
|
|
92
156
|
}
|
|
93
157
|
interface ParsedText extends Readonly<Mapped> {
|
|
@@ -108,7 +172,7 @@ interface ParsedText extends Readonly<Mapped> {
|
|
|
108
172
|
/**
|
|
109
173
|
* The tags associated with this segment of text.
|
|
110
174
|
*/
|
|
111
|
-
readonly tags?: ParsedTags | undefined;
|
|
175
|
+
readonly tags?: Readonly<ParsedTags> | undefined;
|
|
112
176
|
/**
|
|
113
177
|
* Used to delegate parsing the contents of `text` to another parser.
|
|
114
178
|
*
|
|
@@ -187,5 +251,5 @@ interface TransformedText extends Mapped {
|
|
|
187
251
|
rawText?: string | undefined;
|
|
188
252
|
}
|
|
189
253
|
//#endregion
|
|
190
|
-
export {
|
|
191
|
-
//# sourceMappingURL=index-
|
|
254
|
+
export { TextDocumentFragment as _, ParsedTag as a, Parser as c, Scope as d, ScopeChain as f, TextDocument as g, SourceMap as h, ParseResult as i, ParserName as l, Range as m, DelegateInfo as n, ParsedTags as o, ScopeString as p, DocumentParser as r, ParsedText as s, MappedText as t, ParserOptions as u };
|
|
255
|
+
//# sourceMappingURL=index-ClTvqr3-.d.ts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as TextDocumentFragment, a as ParsedTag, c as Parser, g as TextDocument, h as SourceMap, i as ParseResult, l as ParserName, m as Range, o as ParsedTags, r as DocumentParser, s as ParsedText, t as MappedText, u as ParserOptions } from "./index-ClTvqr3-.mjs";
|
|
2
2
|
//#region src/cspell-vfs.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Binary data for CSpellVFS file.
|
|
@@ -396,6 +396,66 @@ interface UnknownWordsConfiguration {
|
|
|
396
396
|
unknownWords?: UnknownWordsChoices | undefined;
|
|
397
397
|
}
|
|
398
398
|
//#endregion
|
|
399
|
+
//#region src/CSpellValidation.d.ts
|
|
400
|
+
interface CSpellSettingsValidation {
|
|
401
|
+
/**
|
|
402
|
+
* Control which segments of text emitted by a parser are spell checked, based upon
|
|
403
|
+
* the `tags` assigned to each segment (see `ParsedText.tags`).
|
|
404
|
+
*
|
|
405
|
+
* By default, all text emitted by a parser is validated.
|
|
406
|
+
*
|
|
407
|
+
* Tags are matched hierarchically by dot-separated segments -- a key like `comment.block`
|
|
408
|
+
* also matches the more specific tag `comment.block.doc`, unless overridden by a more
|
|
409
|
+
* specific key.
|
|
410
|
+
*
|
|
411
|
+
* The special key `*` sets the default for any tag not otherwise matched.
|
|
412
|
+
*
|
|
413
|
+
* A value of:
|
|
414
|
+
* - `true` - validate (spell check) text with the matching tag.
|
|
415
|
+
* - `false` - do not validate text with the matching tag.
|
|
416
|
+
*
|
|
417
|
+
* **Example: only validate string content**
|
|
418
|
+
*
|
|
419
|
+
* ```
|
|
420
|
+
* { "*": false, "string": true }
|
|
421
|
+
* ```
|
|
422
|
+
*
|
|
423
|
+
* **Example: only validate doc-block comments**
|
|
424
|
+
*
|
|
425
|
+
* ```
|
|
426
|
+
* { "*": false, "comment.block.doc": true }
|
|
427
|
+
* ```
|
|
428
|
+
*
|
|
429
|
+
* @default { "*": true }
|
|
430
|
+
* @experimental
|
|
431
|
+
* @since 10.4.0
|
|
432
|
+
*/
|
|
433
|
+
validate?: ValidationTags;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* A pattern used to match validation tags.
|
|
437
|
+
* This can be a specific tag like `comment.block.doc` or a wildcard pattern like `*`.
|
|
438
|
+
* Examples:
|
|
439
|
+
* - `comment.block.doc` - matches only the `comment.block.doc` tag.
|
|
440
|
+
* - `comment.block.*` - matches any tag starting with `comment.block.`.
|
|
441
|
+
* - `*` - matches any tag.
|
|
442
|
+
* - `comment*` - matches any tag starting with `comment`.
|
|
443
|
+
*/
|
|
444
|
+
type TagPattern = string;
|
|
445
|
+
interface ValidationTags {
|
|
446
|
+
/**
|
|
447
|
+
* The default validation setting for any tag not otherwise matched.
|
|
448
|
+
* @default true
|
|
449
|
+
*/
|
|
450
|
+
"*"?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Validation setting for the specific tag.
|
|
453
|
+
*
|
|
454
|
+
* If not specified, the default (`'*'`) will be used.
|
|
455
|
+
*/
|
|
456
|
+
[tag: TagPattern]: boolean;
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
399
459
|
//#region src/suggestionCostsDef.d.ts
|
|
400
460
|
/**
|
|
401
461
|
* A WeightedMapDef enables setting weights for edits between related characters and substrings.
|
|
@@ -1166,6 +1226,48 @@ interface FeatureWithConfiguration {
|
|
|
1166
1226
|
enable: boolean;
|
|
1167
1227
|
}
|
|
1168
1228
|
//#endregion
|
|
1229
|
+
//#region src/Plugin/index.d.ts
|
|
1230
|
+
type CreateParser<Options = unknown> = (name: string, options?: Options) => Promise<DocumentParser | undefined> | DocumentParser | undefined;
|
|
1231
|
+
/**
|
|
1232
|
+
* @since 10.4.0
|
|
1233
|
+
*/
|
|
1234
|
+
interface AvailableParsers<Options> {
|
|
1235
|
+
/**
|
|
1236
|
+
* A collection of available parsers keyed by name.
|
|
1237
|
+
* Each entry can be a `DocumentParser` instance, a `Parser` instance, or a `CreateParser` function.
|
|
1238
|
+
*/
|
|
1239
|
+
[name: string]: DocumentParser | Parser | CreateParser<Options>;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* @since 10.4.0
|
|
1243
|
+
*/
|
|
1244
|
+
type Parsers = (DocumentParser | Parser)[];
|
|
1245
|
+
/**
|
|
1246
|
+
* Plugin API
|
|
1247
|
+
* @experimental
|
|
1248
|
+
* @since 6.2.0
|
|
1249
|
+
*/
|
|
1250
|
+
interface CSpellPlugin {
|
|
1251
|
+
/**
|
|
1252
|
+
* This is the name of the plugin.
|
|
1253
|
+
*/
|
|
1254
|
+
name?: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* List of parsers provided by the plugin.
|
|
1257
|
+
* Each entry can be either a `DocumentParser` instance or a `Parser` definition.
|
|
1258
|
+
* @since 6.2.0
|
|
1259
|
+
*/
|
|
1260
|
+
parsers?: Parsers;
|
|
1261
|
+
}
|
|
1262
|
+
interface CSpellSettingsPlugins {
|
|
1263
|
+
/**
|
|
1264
|
+
* Future Plugin support
|
|
1265
|
+
* @experimental
|
|
1266
|
+
* @since 6.2.0
|
|
1267
|
+
*/
|
|
1268
|
+
plugins?: CSpellPlugin[];
|
|
1269
|
+
}
|
|
1270
|
+
//#endregion
|
|
1169
1271
|
//#region src/Substitutions.d.ts
|
|
1170
1272
|
/**
|
|
1171
1273
|
* The ID for a substitution definition. This is used to reference the substitution definition in the substitutions array.
|
|
@@ -2086,14 +2188,7 @@ type ReporterSettings = ReporterModuleName | [name: ReporterModuleName] | [name:
|
|
|
2086
2188
|
* @experimental
|
|
2087
2189
|
* @hidden
|
|
2088
2190
|
*/
|
|
2089
|
-
interface ExperimentalFileSettings {
|
|
2090
|
-
/**
|
|
2091
|
-
* Future Plugin support
|
|
2092
|
-
* @experimental
|
|
2093
|
-
* @since 6.2.0
|
|
2094
|
-
*/
|
|
2095
|
-
plugins?: Plugin[];
|
|
2096
|
-
}
|
|
2191
|
+
interface ExperimentalFileSettings extends CSpellSettingsPlugins, CSpellSettingsValidation {}
|
|
2097
2192
|
/**
|
|
2098
2193
|
* Extends CSpellSettings with {@link ExperimentalFileSettings}
|
|
2099
2194
|
* @experimental
|
|
@@ -2115,14 +2210,6 @@ interface ExperimentalBaseSettings {
|
|
|
2115
2210
|
*/
|
|
2116
2211
|
parser?: ParserName;
|
|
2117
2212
|
}
|
|
2118
|
-
/**
|
|
2119
|
-
* Plugin API
|
|
2120
|
-
* @experimental
|
|
2121
|
-
* @since 6.2.0
|
|
2122
|
-
*/
|
|
2123
|
-
interface Plugin {
|
|
2124
|
-
parsers?: Parser[];
|
|
2125
|
-
}
|
|
2126
2213
|
/**
|
|
2127
2214
|
* Semantic Version Predicate
|
|
2128
2215
|
*
|
|
@@ -2166,12 +2253,12 @@ declare const defaultCSpellSettings: {
|
|
|
2166
2253
|
};
|
|
2167
2254
|
//#endregion
|
|
2168
2255
|
//#region src/defineConfig.d.ts
|
|
2169
|
-
declare function defineConfig(config:
|
|
2256
|
+
declare function defineConfig(config: AdvancedCSpellSettings): CSpellSettings;
|
|
2170
2257
|
//#endregion
|
|
2171
2258
|
//#region src/merge.d.ts
|
|
2172
2259
|
declare function mergeConfig(settings: CSpellSettings[]): CSpellSettings;
|
|
2173
2260
|
declare function mergeConfig(...settings: [CSpellSettings, ...CSpellSettings[]]): CSpellSettings;
|
|
2174
2261
|
declare function mergeConfig(...settings: [CSpellSettings[], ...CSpellSettings[]]): CSpellSettings;
|
|
2175
2262
|
//#endregion
|
|
2176
|
-
export { type AdvancedCSpellSettings, type AdvancedCSpellSettingsWithSourceTrace, type BaseSetting, type CSpellPackageSettings, type CSpellReporter, type CSpellReporterEmitters, type CSpellReporterModule, type CSpellSettings, type CSpellSettingsWithSourceTrace, type CSpellUserSettings, type CSpellUserSettingsFields, type CSpellUserSettingsWithComments, type CSpellVFS, type CSpellVFSBinaryData, type CSpellVFSData, type CSpellVFSFile, type CSpellVFSFileEntry, type CSpellVFSFileUrl, type CSpellVFSTextData, type CacheFormat, type CacheSettings, type CacheStrategy, type CharacterSet, type CharacterSetCosts, type CommandLineSettings, ConfigFields, type CustomDictionaryPath, type CustomDictionaryScope, type DebugEmitter, type DictionaryDefinition, type DictionaryDefinitionAlternate, type DictionaryDefinitionAugmented, type DictionaryDefinitionBase, type DictionaryDefinitionCustom, type DictionaryDefinitionInline, type DictionaryDefinitionInlineFlagWords, type DictionaryDefinitionInlineIgnoreWords, type DictionaryDefinitionInlineWords, type DictionaryDefinitionLegacy, type DictionaryDefinitionPreferred, type DictionaryDefinitionSimple, type DictionaryFileTypes, type DictionaryId, type DictionaryInformation, type DictionaryNegRef, type DictionaryPath, type DictionaryRef, type DictionaryReference, type EditCosts, type ErrorEmitter, type ErrorLike, type ExperimentalBaseSettings, type ExperimentalFileSettings, type ExtendableSettings, type FSPathResolvable, type Feature, type Features, type FeaturesSupportedByReporter, type FileSettings, type FileSource, type FsPath, type Glob, type GlobDef, type ImportFileRef, type InMemorySource, type Issue, IssueType, type LanguageId, type LanguageIdMultiple, type LanguageIdMultipleNeg, type LanguageIdSingle, type LanguageSetting, type LanguageSettingFilterFields, type LanguageSettingFilterFieldsDeprecated, type LanguageSettingFilterFieldsPreferred, type LegacySettings, type LocalId, type LocaleId, type MappedText, type MatchingFileType, type MergeSource, type MessageEmitter, type MessageType, type MessageTypeLookup, MessageTypes, type OverrideFilterFields, type OverrideSettings, type ParseResult, type ParsedTag, type ParsedTags, type ParsedText, type Parser, type ParserName, type ParserOptions, type
|
|
2263
|
+
export { type AdvancedCSpellSettings, type AdvancedCSpellSettingsWithSourceTrace, type AvailableParsers, type BaseSetting, type CSpellPackageSettings, type CSpellPlugin, type CSpellPlugin as Plugin, type CSpellReporter, type CSpellReporterEmitters, type CSpellReporterModule, type CSpellSettings, type CSpellSettingsWithSourceTrace, type CSpellUserSettings, type CSpellUserSettingsFields, type CSpellUserSettingsWithComments, type CSpellVFS, type CSpellVFSBinaryData, type CSpellVFSData, type CSpellVFSFile, type CSpellVFSFileEntry, type CSpellVFSFileUrl, type CSpellVFSTextData, type CacheFormat, type CacheSettings, type CacheStrategy, type CharacterSet, type CharacterSetCosts, type CommandLineSettings, ConfigFields, type CreateParser, type CustomDictionaryPath, type CustomDictionaryScope, type DebugEmitter, type DictionaryDefinition, type DictionaryDefinitionAlternate, type DictionaryDefinitionAugmented, type DictionaryDefinitionBase, type DictionaryDefinitionCustom, type DictionaryDefinitionInline, type DictionaryDefinitionInlineFlagWords, type DictionaryDefinitionInlineIgnoreWords, type DictionaryDefinitionInlineWords, type DictionaryDefinitionLegacy, type DictionaryDefinitionPreferred, type DictionaryDefinitionSimple, type DictionaryFileTypes, type DictionaryId, type DictionaryInformation, type DictionaryNegRef, type DictionaryPath, type DictionaryRef, type DictionaryReference, type DocumentParser, type EditCosts, type ErrorEmitter, type ErrorLike, type ExperimentalBaseSettings, type ExperimentalFileSettings, type ExtendableSettings, type FSPathResolvable, type Feature, type Features, type FeaturesSupportedByReporter, type FileSettings, type FileSource, type FsPath, type Glob, type GlobDef, type ImportFileRef, type InMemorySource, type Issue, IssueType, type LanguageId, type LanguageIdMultiple, type LanguageIdMultipleNeg, type LanguageIdSingle, type LanguageSetting, type LanguageSettingFilterFields, type LanguageSettingFilterFieldsDeprecated, type LanguageSettingFilterFieldsPreferred, type LegacySettings, type LocalId, type LocaleId, type MappedText, type MatchingFileType, type MergeSource, type MessageEmitter, type MessageType, type MessageTypeLookup, MessageTypes, type OverrideFilterFields, type OverrideSettings, type ParseResult, type ParsedTag, type ParsedTags, type ParsedText, type Parser, type ParserName, type ParserOptions, type Parsers, type Pattern, type PatternId, type PatternRef, type PnPSettings, type PredefinedPatterns, type ProgressBase, type ProgressEmitter, type ProgressFileBase, type ProgressFileBegin, type ProgressFileComplete, type ProgressItem, type ProgressTypes, type Range, type RegExpPatternDefinition, type RegExpPatternList, type ReplaceEntry, type ReplaceMap, type ReportIssueOptions, type ReporterConfiguration, type ReporterSettings, type ReportingConfiguration, type ResultEmitter, type RunResult, type Settings, type SimpleGlob, type SoftWordBreak, type SoftWordBreakDefinitions, type SoftWordBreakPattern, type SoftWordBreakRegExp, type SoftWordBreakRegExpString, type SoftWordBreakRule, type SoftWordBreaks, type Source, type SourceMap, type SpellingErrorEmitter, type SubstitutionDefinition, type SubstitutionDefinitions, type SubstitutionEntry, type SubstitutionID, type Substitutions, type SuggestionCostMapDef, type SuggestionCostsDefs, type SuggestionsConfiguration, type TagPattern, type TextDocument, type TextDocumentFragment, type TextDocumentOffset, type TextOffset, type TrustLevel, type UnknownWordsChoices, type UnknownWordsConfiguration, type ValidationTags, type Version, type VersionLatest, type VersionLegacy, type WordSegmentationSettings, type WorkspaceTrustSettings, defaultCSpellSettings, defineConfig, mergeConfig, unknownWordsChoices };
|
|
2177
2264
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as TextDocumentFragment, a as ParsedTag, c as Parser, g as TextDocument, h as SourceMap, i as ParseResult, l as ParserName, m as Range, o as ParsedTags, r as DocumentParser, s as ParsedText, t as MappedText, u as ParserOptions } from "./index-ClTvqr3-.js";
|
|
2
2
|
//#region src/cspell-vfs.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Binary data for CSpellVFS file.
|
|
@@ -396,6 +396,66 @@ interface UnknownWordsConfiguration {
|
|
|
396
396
|
unknownWords?: UnknownWordsChoices | undefined;
|
|
397
397
|
}
|
|
398
398
|
//#endregion
|
|
399
|
+
//#region src/CSpellValidation.d.ts
|
|
400
|
+
interface CSpellSettingsValidation {
|
|
401
|
+
/**
|
|
402
|
+
* Control which segments of text emitted by a parser are spell checked, based upon
|
|
403
|
+
* the `tags` assigned to each segment (see `ParsedText.tags`).
|
|
404
|
+
*
|
|
405
|
+
* By default, all text emitted by a parser is validated.
|
|
406
|
+
*
|
|
407
|
+
* Tags are matched hierarchically by dot-separated segments -- a key like `comment.block`
|
|
408
|
+
* also matches the more specific tag `comment.block.doc`, unless overridden by a more
|
|
409
|
+
* specific key.
|
|
410
|
+
*
|
|
411
|
+
* The special key `*` sets the default for any tag not otherwise matched.
|
|
412
|
+
*
|
|
413
|
+
* A value of:
|
|
414
|
+
* - `true` - validate (spell check) text with the matching tag.
|
|
415
|
+
* - `false` - do not validate text with the matching tag.
|
|
416
|
+
*
|
|
417
|
+
* **Example: only validate string content**
|
|
418
|
+
*
|
|
419
|
+
* ```
|
|
420
|
+
* { "*": false, "string": true }
|
|
421
|
+
* ```
|
|
422
|
+
*
|
|
423
|
+
* **Example: only validate doc-block comments**
|
|
424
|
+
*
|
|
425
|
+
* ```
|
|
426
|
+
* { "*": false, "comment.block.doc": true }
|
|
427
|
+
* ```
|
|
428
|
+
*
|
|
429
|
+
* @default { "*": true }
|
|
430
|
+
* @experimental
|
|
431
|
+
* @since 10.4.0
|
|
432
|
+
*/
|
|
433
|
+
validate?: ValidationTags;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* A pattern used to match validation tags.
|
|
437
|
+
* This can be a specific tag like `comment.block.doc` or a wildcard pattern like `*`.
|
|
438
|
+
* Examples:
|
|
439
|
+
* - `comment.block.doc` - matches only the `comment.block.doc` tag.
|
|
440
|
+
* - `comment.block.*` - matches any tag starting with `comment.block.`.
|
|
441
|
+
* - `*` - matches any tag.
|
|
442
|
+
* - `comment*` - matches any tag starting with `comment`.
|
|
443
|
+
*/
|
|
444
|
+
type TagPattern = string;
|
|
445
|
+
interface ValidationTags {
|
|
446
|
+
/**
|
|
447
|
+
* The default validation setting for any tag not otherwise matched.
|
|
448
|
+
* @default true
|
|
449
|
+
*/
|
|
450
|
+
"*"?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Validation setting for the specific tag.
|
|
453
|
+
*
|
|
454
|
+
* If not specified, the default (`'*'`) will be used.
|
|
455
|
+
*/
|
|
456
|
+
[tag: TagPattern]: boolean;
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
399
459
|
//#region src/suggestionCostsDef.d.ts
|
|
400
460
|
/**
|
|
401
461
|
* A WeightedMapDef enables setting weights for edits between related characters and substrings.
|
|
@@ -1166,6 +1226,48 @@ interface FeatureWithConfiguration {
|
|
|
1166
1226
|
enable: boolean;
|
|
1167
1227
|
}
|
|
1168
1228
|
//#endregion
|
|
1229
|
+
//#region src/Plugin/index.d.ts
|
|
1230
|
+
type CreateParser<Options = unknown> = (name: string, options?: Options) => Promise<DocumentParser | undefined> | DocumentParser | undefined;
|
|
1231
|
+
/**
|
|
1232
|
+
* @since 10.4.0
|
|
1233
|
+
*/
|
|
1234
|
+
interface AvailableParsers<Options> {
|
|
1235
|
+
/**
|
|
1236
|
+
* A collection of available parsers keyed by name.
|
|
1237
|
+
* Each entry can be a `DocumentParser` instance, a `Parser` instance, or a `CreateParser` function.
|
|
1238
|
+
*/
|
|
1239
|
+
[name: string]: DocumentParser | Parser | CreateParser<Options>;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* @since 10.4.0
|
|
1243
|
+
*/
|
|
1244
|
+
type Parsers = (DocumentParser | Parser)[];
|
|
1245
|
+
/**
|
|
1246
|
+
* Plugin API
|
|
1247
|
+
* @experimental
|
|
1248
|
+
* @since 6.2.0
|
|
1249
|
+
*/
|
|
1250
|
+
interface CSpellPlugin {
|
|
1251
|
+
/**
|
|
1252
|
+
* This is the name of the plugin.
|
|
1253
|
+
*/
|
|
1254
|
+
name?: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* List of parsers provided by the plugin.
|
|
1257
|
+
* Each entry can be either a `DocumentParser` instance or a `Parser` definition.
|
|
1258
|
+
* @since 6.2.0
|
|
1259
|
+
*/
|
|
1260
|
+
parsers?: Parsers;
|
|
1261
|
+
}
|
|
1262
|
+
interface CSpellSettingsPlugins {
|
|
1263
|
+
/**
|
|
1264
|
+
* Future Plugin support
|
|
1265
|
+
* @experimental
|
|
1266
|
+
* @since 6.2.0
|
|
1267
|
+
*/
|
|
1268
|
+
plugins?: CSpellPlugin[];
|
|
1269
|
+
}
|
|
1270
|
+
//#endregion
|
|
1169
1271
|
//#region src/Substitutions.d.ts
|
|
1170
1272
|
/**
|
|
1171
1273
|
* The ID for a substitution definition. This is used to reference the substitution definition in the substitutions array.
|
|
@@ -2086,14 +2188,7 @@ type ReporterSettings = ReporterModuleName | [name: ReporterModuleName] | [name:
|
|
|
2086
2188
|
* @experimental
|
|
2087
2189
|
* @hidden
|
|
2088
2190
|
*/
|
|
2089
|
-
interface ExperimentalFileSettings {
|
|
2090
|
-
/**
|
|
2091
|
-
* Future Plugin support
|
|
2092
|
-
* @experimental
|
|
2093
|
-
* @since 6.2.0
|
|
2094
|
-
*/
|
|
2095
|
-
plugins?: Plugin[];
|
|
2096
|
-
}
|
|
2191
|
+
interface ExperimentalFileSettings extends CSpellSettingsPlugins, CSpellSettingsValidation {}
|
|
2097
2192
|
/**
|
|
2098
2193
|
* Extends CSpellSettings with {@link ExperimentalFileSettings}
|
|
2099
2194
|
* @experimental
|
|
@@ -2115,14 +2210,6 @@ interface ExperimentalBaseSettings {
|
|
|
2115
2210
|
*/
|
|
2116
2211
|
parser?: ParserName;
|
|
2117
2212
|
}
|
|
2118
|
-
/**
|
|
2119
|
-
* Plugin API
|
|
2120
|
-
* @experimental
|
|
2121
|
-
* @since 6.2.0
|
|
2122
|
-
*/
|
|
2123
|
-
interface Plugin {
|
|
2124
|
-
parsers?: Parser[];
|
|
2125
|
-
}
|
|
2126
2213
|
/**
|
|
2127
2214
|
* Semantic Version Predicate
|
|
2128
2215
|
*
|
|
@@ -2166,12 +2253,12 @@ declare const defaultCSpellSettings: {
|
|
|
2166
2253
|
};
|
|
2167
2254
|
//#endregion
|
|
2168
2255
|
//#region src/defineConfig.d.ts
|
|
2169
|
-
declare function defineConfig(config:
|
|
2256
|
+
declare function defineConfig(config: AdvancedCSpellSettings): CSpellSettings;
|
|
2170
2257
|
//#endregion
|
|
2171
2258
|
//#region src/merge.d.ts
|
|
2172
2259
|
declare function mergeConfig(settings: CSpellSettings[]): CSpellSettings;
|
|
2173
2260
|
declare function mergeConfig(...settings: [CSpellSettings, ...CSpellSettings[]]): CSpellSettings;
|
|
2174
2261
|
declare function mergeConfig(...settings: [CSpellSettings[], ...CSpellSettings[]]): CSpellSettings;
|
|
2175
2262
|
//#endregion
|
|
2176
|
-
export { type AdvancedCSpellSettings, type AdvancedCSpellSettingsWithSourceTrace, type BaseSetting, type CSpellPackageSettings, type CSpellReporter, type CSpellReporterEmitters, type CSpellReporterModule, type CSpellSettings, type CSpellSettingsWithSourceTrace, type CSpellUserSettings, type CSpellUserSettingsFields, type CSpellUserSettingsWithComments, type CSpellVFS, type CSpellVFSBinaryData, type CSpellVFSData, type CSpellVFSFile, type CSpellVFSFileEntry, type CSpellVFSFileUrl, type CSpellVFSTextData, type CacheFormat, type CacheSettings, type CacheStrategy, type CharacterSet, type CharacterSetCosts, type CommandLineSettings, ConfigFields, type CustomDictionaryPath, type CustomDictionaryScope, type DebugEmitter, type DictionaryDefinition, type DictionaryDefinitionAlternate, type DictionaryDefinitionAugmented, type DictionaryDefinitionBase, type DictionaryDefinitionCustom, type DictionaryDefinitionInline, type DictionaryDefinitionInlineFlagWords, type DictionaryDefinitionInlineIgnoreWords, type DictionaryDefinitionInlineWords, type DictionaryDefinitionLegacy, type DictionaryDefinitionPreferred, type DictionaryDefinitionSimple, type DictionaryFileTypes, type DictionaryId, type DictionaryInformation, type DictionaryNegRef, type DictionaryPath, type DictionaryRef, type DictionaryReference, type EditCosts, type ErrorEmitter, type ErrorLike, type ExperimentalBaseSettings, type ExperimentalFileSettings, type ExtendableSettings, type FSPathResolvable, type Feature, type Features, type FeaturesSupportedByReporter, type FileSettings, type FileSource, type FsPath, type Glob, type GlobDef, type ImportFileRef, type InMemorySource, type Issue, IssueType, type LanguageId, type LanguageIdMultiple, type LanguageIdMultipleNeg, type LanguageIdSingle, type LanguageSetting, type LanguageSettingFilterFields, type LanguageSettingFilterFieldsDeprecated, type LanguageSettingFilterFieldsPreferred, type LegacySettings, type LocalId, type LocaleId, type MappedText, type MatchingFileType, type MergeSource, type MessageEmitter, type MessageType, type MessageTypeLookup, MessageTypes, type OverrideFilterFields, type OverrideSettings, type ParseResult, type ParsedTag, type ParsedTags, type ParsedText, type Parser, type ParserName, type ParserOptions, type
|
|
2263
|
+
export { type AdvancedCSpellSettings, type AdvancedCSpellSettingsWithSourceTrace, type AvailableParsers, type BaseSetting, type CSpellPackageSettings, type CSpellPlugin, type CSpellPlugin as Plugin, type CSpellReporter, type CSpellReporterEmitters, type CSpellReporterModule, type CSpellSettings, type CSpellSettingsWithSourceTrace, type CSpellUserSettings, type CSpellUserSettingsFields, type CSpellUserSettingsWithComments, type CSpellVFS, type CSpellVFSBinaryData, type CSpellVFSData, type CSpellVFSFile, type CSpellVFSFileEntry, type CSpellVFSFileUrl, type CSpellVFSTextData, type CacheFormat, type CacheSettings, type CacheStrategy, type CharacterSet, type CharacterSetCosts, type CommandLineSettings, ConfigFields, type CreateParser, type CustomDictionaryPath, type CustomDictionaryScope, type DebugEmitter, type DictionaryDefinition, type DictionaryDefinitionAlternate, type DictionaryDefinitionAugmented, type DictionaryDefinitionBase, type DictionaryDefinitionCustom, type DictionaryDefinitionInline, type DictionaryDefinitionInlineFlagWords, type DictionaryDefinitionInlineIgnoreWords, type DictionaryDefinitionInlineWords, type DictionaryDefinitionLegacy, type DictionaryDefinitionPreferred, type DictionaryDefinitionSimple, type DictionaryFileTypes, type DictionaryId, type DictionaryInformation, type DictionaryNegRef, type DictionaryPath, type DictionaryRef, type DictionaryReference, type DocumentParser, type EditCosts, type ErrorEmitter, type ErrorLike, type ExperimentalBaseSettings, type ExperimentalFileSettings, type ExtendableSettings, type FSPathResolvable, type Feature, type Features, type FeaturesSupportedByReporter, type FileSettings, type FileSource, type FsPath, type Glob, type GlobDef, type ImportFileRef, type InMemorySource, type Issue, IssueType, type LanguageId, type LanguageIdMultiple, type LanguageIdMultipleNeg, type LanguageIdSingle, type LanguageSetting, type LanguageSettingFilterFields, type LanguageSettingFilterFieldsDeprecated, type LanguageSettingFilterFieldsPreferred, type LegacySettings, type LocalId, type LocaleId, type MappedText, type MatchingFileType, type MergeSource, type MessageEmitter, type MessageType, type MessageTypeLookup, MessageTypes, type OverrideFilterFields, type OverrideSettings, type ParseResult, type ParsedTag, type ParsedTags, type ParsedText, type Parser, type ParserName, type ParserOptions, type Parsers, type Pattern, type PatternId, type PatternRef, type PnPSettings, type PredefinedPatterns, type ProgressBase, type ProgressEmitter, type ProgressFileBase, type ProgressFileBegin, type ProgressFileComplete, type ProgressItem, type ProgressTypes, type Range, type RegExpPatternDefinition, type RegExpPatternList, type ReplaceEntry, type ReplaceMap, type ReportIssueOptions, type ReporterConfiguration, type ReporterSettings, type ReportingConfiguration, type ResultEmitter, type RunResult, type Settings, type SimpleGlob, type SoftWordBreak, type SoftWordBreakDefinitions, type SoftWordBreakPattern, type SoftWordBreakRegExp, type SoftWordBreakRegExpString, type SoftWordBreakRule, type SoftWordBreaks, type Source, type SourceMap, type SpellingErrorEmitter, type SubstitutionDefinition, type SubstitutionDefinitions, type SubstitutionEntry, type SubstitutionID, type Substitutions, type SuggestionCostMapDef, type SuggestionCostsDefs, type SuggestionsConfiguration, type TagPattern, type TextDocument, type TextDocumentFragment, type TextDocumentOffset, type TextOffset, type TrustLevel, type UnknownWordsChoices, type UnknownWordsConfiguration, type ValidationTags, type Version, type VersionLatest, type VersionLegacy, type WordSegmentationSettings, type WorkspaceTrustSettings, defaultCSpellSettings, defineConfig, mergeConfig, unknownWordsChoices };
|
|
2177
2264
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
7
|
-
"version": "10.3.
|
|
7
|
+
"version": "10.3.3",
|
|
8
8
|
"description": "Types for cspell and cspell-lib",
|
|
9
9
|
"type": "commonjs",
|
|
10
10
|
"sideEffects": false,
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"node": ">=22.18.0"
|
|
86
86
|
},
|
|
87
87
|
"homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-types#readme",
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "e6e01b7294cca7174344b33639c05030100d1f4c"
|
|
89
89
|
}
|