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