@cspell/cspell-types 5.18.3 → 5.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cspell.schema.json +33 -2
- package/dist/CSpellSettingsDef.d.ts +6 -2
- package/dist/DictionaryInformation.d.ts +14 -99
- package/dist/TextOffset.d.ts +11 -0
- package/dist/index.js +5 -1
- package/package.json +7 -7
package/cspell.schema.json
CHANGED
|
@@ -403,8 +403,14 @@
|
|
|
403
403
|
"type": "array"
|
|
404
404
|
}
|
|
405
405
|
],
|
|
406
|
-
"
|
|
407
|
-
|
|
406
|
+
"description": "The accent characters.\n\nDefault: `\"\\u0300-\\u0341\"`"
|
|
407
|
+
},
|
|
408
|
+
"adjustments": {
|
|
409
|
+
"description": "A collection of patterns to test against the suggested words. If the word matches the pattern, then the penalty is applied.",
|
|
410
|
+
"items": {
|
|
411
|
+
"$ref": "#/definitions/PatternAdjustment"
|
|
412
|
+
},
|
|
413
|
+
"type": "array"
|
|
408
414
|
},
|
|
409
415
|
"alphabet": {
|
|
410
416
|
"anyOf": [
|
|
@@ -948,6 +954,29 @@
|
|
|
948
954
|
"Pattern": {
|
|
949
955
|
"type": "string"
|
|
950
956
|
},
|
|
957
|
+
"PatternAdjustment": {
|
|
958
|
+
"additionalProperties": false,
|
|
959
|
+
"properties": {
|
|
960
|
+
"id": {
|
|
961
|
+
"description": "Id of the Adjustment, i.e. `short-compound`",
|
|
962
|
+
"type": "string"
|
|
963
|
+
},
|
|
964
|
+
"penalty": {
|
|
965
|
+
"description": "The amount of penalty to apply.",
|
|
966
|
+
"type": "number"
|
|
967
|
+
},
|
|
968
|
+
"regexp": {
|
|
969
|
+
"description": "RegExp pattern to match",
|
|
970
|
+
"type": "string"
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
"required": [
|
|
974
|
+
"id",
|
|
975
|
+
"regexp",
|
|
976
|
+
"penalty"
|
|
977
|
+
],
|
|
978
|
+
"type": "object"
|
|
979
|
+
},
|
|
951
980
|
"PatternId": {
|
|
952
981
|
"description": "This matches the name in a pattern definition.",
|
|
953
982
|
"type": "string"
|
|
@@ -1128,6 +1157,8 @@
|
|
|
1128
1157
|
},
|
|
1129
1158
|
"properties": {
|
|
1130
1159
|
"$schema": {
|
|
1160
|
+
"default": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
|
|
1161
|
+
"description": "Url to JSON Schema",
|
|
1131
1162
|
"type": "string"
|
|
1132
1163
|
},
|
|
1133
1164
|
"allowCompoundWords": {
|
|
@@ -8,15 +8,19 @@ export declare type ReplaceMap = ReplaceEntry[];
|
|
|
8
8
|
export declare type CSpellPackageSettings = CSpellUserSettings;
|
|
9
9
|
export declare type CSpellUserSettings = CSpellSettings;
|
|
10
10
|
export interface CSpellSettings extends FileSettings, LegacySettings {
|
|
11
|
+
/**
|
|
12
|
+
* Url to JSON Schema
|
|
13
|
+
* @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
|
|
14
|
+
*/
|
|
11
15
|
$schema?: string;
|
|
12
16
|
}
|
|
13
17
|
export interface ImportFileRef {
|
|
14
18
|
filename: string;
|
|
15
|
-
error?: Error;
|
|
19
|
+
error?: Error | undefined;
|
|
16
20
|
referencedBy?: Source[];
|
|
17
21
|
}
|
|
18
22
|
export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
|
|
19
|
-
source?: Source;
|
|
23
|
+
source?: Source | undefined;
|
|
20
24
|
__importRef?: ImportFileRef;
|
|
21
25
|
__imports?: Map<string, ImportFileRef>;
|
|
22
26
|
}
|
|
@@ -17,8 +17,9 @@ export interface DictionaryInformation {
|
|
|
17
17
|
*/
|
|
18
18
|
alphabet?: CharacterSet | CharacterSetCosts[];
|
|
19
19
|
/**
|
|
20
|
-
* The accent characters
|
|
21
|
-
*
|
|
20
|
+
* The accent characters.
|
|
21
|
+
*
|
|
22
|
+
* Default: `"\u0300-\u0341"`
|
|
22
23
|
*/
|
|
23
24
|
accents?: CharacterSet | CharacterSetCosts[];
|
|
24
25
|
/**
|
|
@@ -34,105 +35,11 @@ export interface DictionaryInformation {
|
|
|
34
35
|
* Used by dictionary authors
|
|
35
36
|
*/
|
|
36
37
|
hunspellInformation?: HunspellInformation;
|
|
37
|
-
}
|
|
38
|
-
export interface HunspellInformationParsed {
|
|
39
|
-
/**
|
|
40
|
-
* This is generally the alphabet used in the dictionary.
|
|
41
|
-
* It stands for the characters to try using for substitutions
|
|
42
|
-
* when looking for a suggestions.
|
|
43
|
-
*
|
|
44
|
-
* Example:
|
|
45
|
-
* - Hunspell:
|
|
46
|
-
* ```hunspell
|
|
47
|
-
* TRY aeistlunkodmrvpgjhäõbüoöfcwzxðqþ`
|
|
48
|
-
* ```
|
|
49
|
-
* - Use: yaml
|
|
50
|
-
* ```yaml
|
|
51
|
-
* tryChars: "aeistlunkodmrvpgjhäõbüoöfcwzxðqþ"
|
|
52
|
-
* ```
|
|
53
|
-
* <!--- cspell:ignore aeistlunkodmrvpgjhäõbüoöfcwzxðqþ --
|
|
54
|
-
*/
|
|
55
|
-
tryChars?: string;
|
|
56
|
-
/**
|
|
57
|
-
* This defines characters that are good substitutes for each other.
|
|
58
|
-
* - A `()` is need for multi character sequences like letters with multiple accents.
|
|
59
|
-
* - Separate unrelated characters with `|` or `\n`
|
|
60
|
-
*
|
|
61
|
-
* Example:
|
|
62
|
-
* - Hunspell:
|
|
63
|
-
* ```hunspell
|
|
64
|
-
* MAP aàâäAÀÂÄ
|
|
65
|
-
* MAP eéèêëEÉÈÊË
|
|
66
|
-
* MAP iîïyIÎÏY
|
|
67
|
-
* MAP oôöOÔÖ
|
|
68
|
-
* MAP (IJ)(IJ)
|
|
69
|
-
* ```
|
|
70
|
-
* - Use:
|
|
71
|
-
* `yaml`
|
|
72
|
-
* ```yaml
|
|
73
|
-
* mapSets: |
|
|
74
|
-
* aàâäAÀÂÄ|eéèêëEÉÈÊË`
|
|
75
|
-
* eéèêëEÉÈÊË|iîïyIÎÏY
|
|
76
|
-
* oôöOÔÖ|(IJ)(IJ)
|
|
77
|
-
* ```
|
|
78
|
-
* <!--- cspell:ignore aàâä eéèêë iîïy -->
|
|
79
|
-
*/
|
|
80
|
-
mapSets?: string | string[];
|
|
81
|
-
/**
|
|
82
|
-
* This represents the layout of a common keyboard.
|
|
83
|
-
* Used for adjacency mistakes.
|
|
84
|
-
*
|
|
85
|
-
* Hunspell:
|
|
86
|
-
* ```hunspell
|
|
87
|
-
* KEY qwertyuiop|asdfghjkl|zxcvbnm
|
|
88
|
-
* ```
|
|
89
|
-
* Use:
|
|
90
|
-
* ```yaml
|
|
91
|
-
* keyboard: qwertyuiop|asdfghjkl|zxcvbnm
|
|
92
|
-
* ```
|
|
93
|
-
* <!--- cspell:ignore asdfghjkl qwertyuiop zxcvbnm -->
|
|
94
|
-
*/
|
|
95
|
-
keyboard?: string;
|
|
96
38
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*/
|
|
100
|
-
outConvert?: string | string[];
|
|
101
|
-
inConvert?: string | string[];
|
|
102
|
-
/**
|
|
103
|
-
* Common Substitutions.
|
|
104
|
-
* Special characters:
|
|
105
|
-
* - `^` - matches the beginning of a word.
|
|
106
|
-
* - `$` - matches the end of a word.
|
|
107
|
-
*
|
|
108
|
-
* Hunspell:
|
|
109
|
-
* ```hunspell
|
|
110
|
-
* REP c ss
|
|
111
|
-
* REP e ij
|
|
112
|
-
* REP é ee
|
|
113
|
-
* REP g ch
|
|
114
|
-
* REP ï ii
|
|
115
|
-
* REP t d # gebiest=>gebiesd
|
|
116
|
-
* REP u ij
|
|
117
|
-
* ```
|
|
118
|
-
*
|
|
119
|
-
* Use:
|
|
120
|
-
* ```yaml
|
|
121
|
-
* replace: |
|
|
122
|
-
* c ss
|
|
123
|
-
* e ij
|
|
124
|
-
* é ee
|
|
125
|
-
* g ch
|
|
126
|
-
* ï ii
|
|
127
|
-
* t d
|
|
128
|
-
* u ij
|
|
129
|
-
* ```
|
|
130
|
-
*
|
|
131
|
-
* <!--- cspell:ignore gebiesd gebiest -->
|
|
39
|
+
* A collection of patterns to test against the suggested words.
|
|
40
|
+
* If the word matches the pattern, then the penalty is applied.
|
|
132
41
|
*/
|
|
133
|
-
|
|
134
|
-
/** The costs to apply when using the hunspell settings */
|
|
135
|
-
costs?: HunspellCosts;
|
|
42
|
+
adjustments?: PatternAdjustment[];
|
|
136
43
|
}
|
|
137
44
|
export interface HunspellInformation {
|
|
138
45
|
/**
|
|
@@ -282,5 +189,13 @@ export interface CharacterSetCosts {
|
|
|
282
189
|
*/
|
|
283
190
|
penalty?: number;
|
|
284
191
|
}
|
|
192
|
+
export interface PatternAdjustment {
|
|
193
|
+
/** Id of the Adjustment, i.e. `short-compound` */
|
|
194
|
+
id: string;
|
|
195
|
+
/** RegExp pattern to match */
|
|
196
|
+
regexp: string | RegExp;
|
|
197
|
+
/** The amount of penalty to apply. */
|
|
198
|
+
penalty: number;
|
|
199
|
+
}
|
|
285
200
|
export {};
|
|
286
201
|
//# sourceMappingURL=DictionaryInformation.d.ts.map
|
package/dist/TextOffset.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
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
|
+
*/
|
|
2
6
|
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* The offset into the document.
|
|
9
|
+
*/
|
|
3
10
|
offset: number;
|
|
11
|
+
/**
|
|
12
|
+
* Assumed to match `text.length` if the text has not been transformed.
|
|
13
|
+
*/
|
|
14
|
+
length?: number;
|
|
4
15
|
}
|
|
5
16
|
export interface TextDocumentOffset extends TextOffset {
|
|
6
17
|
uri?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.
|
|
6
|
+
"version": "5.19.0",
|
|
7
7
|
"description": "Types for cspell and cspell-lib",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"typings": "dist/index.d.ts",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"ajv-cli": "^5.0.0",
|
|
53
|
-
"jest": "^27.
|
|
53
|
+
"jest": "^27.5.1",
|
|
54
54
|
"rimraf": "^3.0.2",
|
|
55
|
-
"ts-json-schema-generator": "^0.
|
|
56
|
-
"typedoc": "0.22.
|
|
57
|
-
"typedoc-plugin-markdown": "^3.11.
|
|
58
|
-
"typescript": "^4.
|
|
55
|
+
"ts-json-schema-generator": "^0.98.0",
|
|
56
|
+
"typedoc": "0.22.13",
|
|
57
|
+
"typedoc-plugin-markdown": "^3.11.14",
|
|
58
|
+
"typescript": "^4.6.2"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "7873efe40a3287d3e025f705e1712c12d3cb392e"
|
|
61
61
|
}
|