@cspell/cspell-types 8.17.1 → 8.17.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.
Files changed (41) hide show
  1. package/dist/Parser/index.d.mts +127 -2
  2. package/dist/Parser/index.d.ts +13 -12
  3. package/dist/Parser/index.js +17 -2
  4. package/dist/Parser/index.mjs +0 -2
  5. package/dist/index.d.mts +1610 -2
  6. package/dist/index.d.ts +1610 -15
  7. package/dist/index.js +115 -12
  8. package/dist/index.mjs +85 -2
  9. package/package.json +4 -3
  10. package/dist/CSpellReporter.d.ts +0 -164
  11. package/dist/CSpellReporter.js +0 -14
  12. package/dist/CSpellSettingsDef.d.ts +0 -755
  13. package/dist/CSpellSettingsDef.js +0 -3
  14. package/dist/Dictionary.d.ts +0 -16
  15. package/dist/Dictionary.js +0 -3
  16. package/dist/DictionaryDefinition.d.ts +0 -241
  17. package/dist/DictionaryDefinition.js +0 -3
  18. package/dist/DictionaryInformation.d.ts +0 -214
  19. package/dist/DictionaryInformation.js +0 -3
  20. package/dist/DynamicDictionaryDefinition.d.ts +0 -20
  21. package/dist/DynamicDictionaryDefinition.js +0 -5
  22. package/dist/IO.d.ts +0 -9
  23. package/dist/IO.js +0 -3
  24. package/dist/InlineDictionary.d.ts +0 -44
  25. package/dist/InlineDictionary.js +0 -3
  26. package/dist/TextMap.d.ts +0 -36
  27. package/dist/TextMap.js +0 -3
  28. package/dist/TextOffset.d.ts +0 -23
  29. package/dist/TextOffset.js +0 -3
  30. package/dist/configFields.d.ts +0 -7
  31. package/dist/configFields.js +0 -59
  32. package/dist/defaultConfigSettings.d.ts +0 -5
  33. package/dist/defaultConfigSettings.js +0 -8
  34. package/dist/defineConfig.d.ts +0 -3
  35. package/dist/defineConfig.js +0 -7
  36. package/dist/features.d.ts +0 -46
  37. package/dist/features.js +0 -3
  38. package/dist/suggestionCostsDef.d.ts +0 -88
  39. package/dist/suggestionCostsDef.js +0 -3
  40. package/dist/types.d.ts +0 -9
  41. package/dist/types.js +0 -4
@@ -1,2 +1,127 @@
1
- export * from './index.js';
2
- //# sourceMappingURL=index.d.mts.map
1
+ type ParserOptions = Record<string, unknown>;
2
+ type ParserName = string;
3
+ 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
+ interface ParseResult {
14
+ readonly content: string;
15
+ readonly filename: string;
16
+ readonly parsedTexts: Iterable<ParsedText>;
17
+ }
18
+ 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
+ type SourceMap = number[];
78
+ 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
+ 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
+ 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
+ type ScopeString = string;
125
+ type Scope = ScopeChain | ScopeString;
126
+
127
+ export type { DelegateInfo, ParseResult, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap };
@@ -1,6 +1,6 @@
1
- export type ParserOptions = Record<string, unknown>;
2
- export type ParserName = string;
3
- export interface Parser {
1
+ type ParserOptions = Record<string, unknown>;
2
+ type ParserName = string;
3
+ interface Parser {
4
4
  /** Name of parser */
5
5
  readonly name: ParserName;
6
6
  /**
@@ -10,12 +10,12 @@ export interface Parser {
10
10
  */
11
11
  parse(content: string, filename: string): ParseResult;
12
12
  }
13
- export interface ParseResult {
13
+ interface ParseResult {
14
14
  readonly content: string;
15
15
  readonly filename: string;
16
16
  readonly parsedTexts: Iterable<ParsedText>;
17
17
  }
18
- export interface ParsedText {
18
+ interface ParsedText {
19
19
  /**
20
20
  * The text extracted and possibly transformed
21
21
  */
@@ -74,14 +74,14 @@ export interface ParsedText {
74
74
  *
75
75
  * <!--- cspell:ignore Bjørvika rvika --->
76
76
  */
77
- export type SourceMap = number[];
78
- export type Range = readonly [start: number, end: number];
77
+ type SourceMap = number[];
78
+ type Range = readonly [start: number, end: number];
79
79
  /**
80
80
  * DelegateInfo is used by a parser to delegate parsing a subsection of a document to
81
81
  * another parser. The following information is used by the spell checker to match
82
82
  * the parser.
83
83
  */
84
- export interface DelegateInfo {
84
+ interface DelegateInfo {
85
85
  /**
86
86
  * Proposed virtual file name including the extension.
87
87
  * Format: `./${source_filename}/${block_number}.${ext}
@@ -112,7 +112,7 @@ export interface DelegateInfo {
112
112
  * `comment.block.documentation.ts` -> `meta.interface.ts` -> `source.ts`
113
113
  * ```
114
114
  */
115
- export interface ScopeChain {
115
+ interface ScopeChain {
116
116
  readonly value: string;
117
117
  readonly parent?: ScopeChain | undefined;
118
118
  }
@@ -121,6 +121,7 @@ export interface ScopeChain {
121
121
  *
122
122
  * Example: `comment.block.documentation.ts meta.interface.ts source.ts`
123
123
  */
124
- export type ScopeString = string;
125
- export type Scope = ScopeChain | ScopeString;
126
- //# sourceMappingURL=index.d.ts.map
124
+ type ScopeString = string;
125
+ type Scope = ScopeChain | ScopeString;
126
+
127
+ export type { DelegateInfo, ParseResult, ParsedText, Parser, ParserName, ParserOptions, Range, Scope, ScopeChain, ScopeString, SourceMap };
@@ -1,3 +1,18 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/Parser/index.ts
17
+ var Parser_exports = {};
18
+ module.exports = __toCommonJS(Parser_exports);
@@ -1,2 +0,0 @@
1
- export * from './index.js';
2
- //# sourceMappingURL=index.mjs.map