@cspell/cspell-types 7.0.2 → 7.2.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.
Files changed (83) hide show
  1. package/dist/Parser/index.d.mts +2 -0
  2. package/dist/Parser/index.mjs +2 -0
  3. package/dist/index.d.mts +2 -0
  4. package/dist/index.mjs +2 -0
  5. package/package.json +19 -16
  6. package/dist/esm/CSpellReporter.d.mts +0 -152
  7. package/dist/esm/CSpellReporter.d.ts +0 -152
  8. package/dist/esm/CSpellReporter.js +0 -10
  9. package/dist/esm/CSpellReporter.mjs +0 -10
  10. package/dist/esm/CSpellSettingsDef.d.mts +0 -705
  11. package/dist/esm/CSpellSettingsDef.d.ts +0 -705
  12. package/dist/esm/CSpellSettingsDef.js +0 -1
  13. package/dist/esm/CSpellSettingsDef.mjs +0 -1
  14. package/dist/esm/DictionaryDefinition.d.mts +0 -219
  15. package/dist/esm/DictionaryDefinition.d.ts +0 -219
  16. package/dist/esm/DictionaryDefinition.js +0 -1
  17. package/dist/esm/DictionaryDefinition.mjs +0 -1
  18. package/dist/esm/DictionaryInformation.d.mts +0 -210
  19. package/dist/esm/DictionaryInformation.d.ts +0 -210
  20. package/dist/esm/DictionaryInformation.js +0 -1
  21. package/dist/esm/DictionaryInformation.mjs +0 -1
  22. package/dist/esm/InlineDictionary.d.mts +0 -44
  23. package/dist/esm/InlineDictionary.d.ts +0 -44
  24. package/dist/esm/InlineDictionary.js +0 -1
  25. package/dist/esm/InlineDictionary.mjs +0 -1
  26. package/dist/esm/Parser/index.d.mts +0 -126
  27. package/dist/esm/Parser/index.d.ts +0 -126
  28. package/dist/esm/Parser/index.js +0 -1
  29. package/dist/esm/Parser/index.mjs +0 -1
  30. package/dist/esm/TextMap.d.mts +0 -36
  31. package/dist/esm/TextMap.d.ts +0 -36
  32. package/dist/esm/TextMap.js +0 -1
  33. package/dist/esm/TextMap.mjs +0 -1
  34. package/dist/esm/TextOffset.d.mts +0 -23
  35. package/dist/esm/TextOffset.d.ts +0 -23
  36. package/dist/esm/TextOffset.js +0 -1
  37. package/dist/esm/TextOffset.mjs +0 -1
  38. package/dist/esm/configFields.d.mts +0 -7
  39. package/dist/esm/configFields.d.ts +0 -7
  40. package/dist/esm/configFields.js +0 -52
  41. package/dist/esm/configFields.mjs +0 -52
  42. package/dist/esm/features.d.mts +0 -38
  43. package/dist/esm/features.d.ts +0 -38
  44. package/dist/esm/features.js +0 -2
  45. package/dist/esm/features.mjs +0 -2
  46. package/dist/esm/index.d.mts +0 -13
  47. package/dist/esm/index.d.ts +0 -13
  48. package/dist/esm/index.js +0 -2
  49. package/dist/esm/index.mjs +0 -2
  50. package/dist/esm/suggestionCostsDef.d.mts +0 -88
  51. package/dist/esm/suggestionCostsDef.d.ts +0 -88
  52. package/dist/esm/suggestionCostsDef.js +0 -1
  53. package/dist/esm/suggestionCostsDef.mjs +0 -1
  54. package/dist/esm/types.d.mts +0 -9
  55. package/dist/esm/types.d.ts +0 -9
  56. package/dist/esm/types.js +0 -3
  57. package/dist/esm/types.mjs +0 -3
  58. /package/dist/{cjs/CSpellReporter.d.ts → CSpellReporter.d.ts} +0 -0
  59. /package/dist/{cjs/CSpellReporter.js → CSpellReporter.js} +0 -0
  60. /package/dist/{cjs/CSpellSettingsDef.d.ts → CSpellSettingsDef.d.ts} +0 -0
  61. /package/dist/{cjs/CSpellSettingsDef.js → CSpellSettingsDef.js} +0 -0
  62. /package/dist/{cjs/DictionaryDefinition.d.ts → DictionaryDefinition.d.ts} +0 -0
  63. /package/dist/{cjs/DictionaryDefinition.js → DictionaryDefinition.js} +0 -0
  64. /package/dist/{cjs/DictionaryInformation.d.ts → DictionaryInformation.d.ts} +0 -0
  65. /package/dist/{cjs/DictionaryInformation.js → DictionaryInformation.js} +0 -0
  66. /package/dist/{cjs/InlineDictionary.d.ts → InlineDictionary.d.ts} +0 -0
  67. /package/dist/{cjs/InlineDictionary.js → InlineDictionary.js} +0 -0
  68. /package/dist/{cjs/Parser → Parser}/index.d.ts +0 -0
  69. /package/dist/{cjs/Parser → Parser}/index.js +0 -0
  70. /package/dist/{cjs/TextMap.d.ts → TextMap.d.ts} +0 -0
  71. /package/dist/{cjs/TextMap.js → TextMap.js} +0 -0
  72. /package/dist/{cjs/TextOffset.d.ts → TextOffset.d.ts} +0 -0
  73. /package/dist/{cjs/TextOffset.js → TextOffset.js} +0 -0
  74. /package/dist/{cjs/configFields.d.ts → configFields.d.ts} +0 -0
  75. /package/dist/{cjs/configFields.js → configFields.js} +0 -0
  76. /package/dist/{cjs/features.d.ts → features.d.ts} +0 -0
  77. /package/dist/{cjs/features.js → features.js} +0 -0
  78. /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
  79. /package/dist/{cjs/index.js → index.js} +0 -0
  80. /package/dist/{cjs/suggestionCostsDef.d.ts → suggestionCostsDef.d.ts} +0 -0
  81. /package/dist/{cjs/suggestionCostsDef.js → suggestionCostsDef.js} +0 -0
  82. /package/dist/{cjs/types.d.ts → types.d.ts} +0 -0
  83. /package/dist/{cjs/types.js → types.js} +0 -0
@@ -1,210 +0,0 @@
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
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- export interface InlineDictionary {
2
- /**
3
- * List of words to be considered correct.
4
- */
5
- words?: string[];
6
- /**
7
- * List of words to always be considered incorrect. Words found in `flagWords` override `words`.
8
- *
9
- * Format of `flagWords`
10
- * - single word entry - `word`
11
- * - with suggestions - `word:suggestion` or `word->suggestion, suggestions`
12
- *
13
- * Example:
14
- * ```ts
15
- * "flagWords": [
16
- * "color: colour",
17
- * "incase: in case, encase",
18
- * "canot->cannot",
19
- * "cancelled->canceled"
20
- * ]
21
- * ```
22
- */
23
- flagWords?: string[];
24
- /**
25
- * List of words to be ignored. An ignored word will not show up as an error, even if it is
26
- * also in the `flagWords`.
27
- */
28
- ignoreWords?: string[];
29
- /**
30
- * A list of suggested replacements for words.
31
- * Suggested words provide a way to make preferred suggestions on word replacements.
32
- * To hint at a preferred change, but not to require it.
33
- *
34
- * Format of `suggestWords`
35
- * - Single suggestion (possible auto fix)
36
- * - `word: suggestion`
37
- * - `word->suggestion`
38
- * - Multiple suggestions (not auto fixable)
39
- * - `word: first, second, third`
40
- * - `word->first, second, third`
41
- */
42
- suggestWords?: string[];
43
- }
44
- //# sourceMappingURL=InlineDictionary.d.mts.map
@@ -1,44 +0,0 @@
1
- export interface InlineDictionary {
2
- /**
3
- * List of words to be considered correct.
4
- */
5
- words?: string[];
6
- /**
7
- * List of words to always be considered incorrect. Words found in `flagWords` override `words`.
8
- *
9
- * Format of `flagWords`
10
- * - single word entry - `word`
11
- * - with suggestions - `word:suggestion` or `word->suggestion, suggestions`
12
- *
13
- * Example:
14
- * ```ts
15
- * "flagWords": [
16
- * "color: colour",
17
- * "incase: in case, encase",
18
- * "canot->cannot",
19
- * "cancelled->canceled"
20
- * ]
21
- * ```
22
- */
23
- flagWords?: string[];
24
- /**
25
- * List of words to be ignored. An ignored word will not show up as an error, even if it is
26
- * also in the `flagWords`.
27
- */
28
- ignoreWords?: string[];
29
- /**
30
- * A list of suggested replacements for words.
31
- * Suggested words provide a way to make preferred suggestions on word replacements.
32
- * To hint at a preferred change, but not to require it.
33
- *
34
- * Format of `suggestWords`
35
- * - Single suggestion (possible auto fix)
36
- * - `word: suggestion`
37
- * - `word->suggestion`
38
- * - Multiple suggestions (not auto fixable)
39
- * - `word: first, second, third`
40
- * - `word->first, second, third`
41
- */
42
- suggestWords?: string[];
43
- }
44
- //# sourceMappingURL=InlineDictionary.d.ts.map
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,126 +0,0 @@
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.mts.map
@@ -1,126 +0,0 @@
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
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +0,0 @@
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.mts.map
@@ -1,36 +0,0 @@
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
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
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.mts.map
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
1
- export {};