@cspell/cspell-types 8.17.0 → 8.17.2

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
package/dist/index.js CHANGED
@@ -1,13 +1,116 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineConfig = exports.defaultCSpellSettings = exports.MessageTypes = exports.IssueType = exports.ConfigFields = void 0;
4
- var configFields_js_1 = require("./configFields.js");
5
- Object.defineProperty(exports, "ConfigFields", { enumerable: true, get: function () { return configFields_js_1.ConfigFields; } });
6
- var CSpellReporter_js_1 = require("./CSpellReporter.js");
7
- Object.defineProperty(exports, "IssueType", { enumerable: true, get: function () { return CSpellReporter_js_1.IssueType; } });
8
- Object.defineProperty(exports, "MessageTypes", { enumerable: true, get: function () { return CSpellReporter_js_1.MessageTypes; } });
9
- var defaultConfigSettings_js_1 = require("./defaultConfigSettings.js");
10
- Object.defineProperty(exports, "defaultCSpellSettings", { enumerable: true, get: function () { return defaultConfigSettings_js_1.defaultCSpellSettings; } });
11
- var defineConfig_js_1 = require("./defineConfig.js");
12
- Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return defineConfig_js_1.defineConfig; } });
13
- //# 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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ConfigFields: () => ConfigFields,
24
+ IssueType: () => IssueType,
25
+ MessageTypes: () => MessageTypes,
26
+ defaultCSpellSettings: () => defaultCSpellSettings,
27
+ defineConfig: () => defineConfig
28
+ });
29
+ module.exports = __toCommonJS(index_exports);
30
+
31
+ // src/configFields.ts
32
+ var ConfigFields = {
33
+ allowCompoundWords: "allowCompoundWords",
34
+ cache: "cache",
35
+ caseSensitive: "caseSensitive",
36
+ description: "description",
37
+ dictionaries: "dictionaries",
38
+ dictionaryDefinitions: "dictionaryDefinitions",
39
+ enabled: "enabled",
40
+ enabledLanguageIds: "enabledLanguageIds",
41
+ enableFiletypes: "enableFiletypes",
42
+ enabledFileTypes: "enabledFileTypes",
43
+ enableGlobDot: "enableGlobDot",
44
+ failFast: "failFast",
45
+ features: "features",
46
+ files: "files",
47
+ flagWords: "flagWords",
48
+ gitignoreRoot: "gitignoreRoot",
49
+ globRoot: "globRoot",
50
+ ignorePaths: "ignorePaths",
51
+ ignoreRegExpList: "ignoreRegExpList",
52
+ ignoreWords: "ignoreWords",
53
+ ignoreRandomStrings: "ignoreRandomStrings",
54
+ import: "import",
55
+ includeRegExpList: "includeRegExpList",
56
+ language: "language",
57
+ languageId: "languageId",
58
+ languageSettings: "languageSettings",
59
+ loadDefaultConfiguration: "loadDefaultConfiguration",
60
+ maxDuplicateProblems: "maxDuplicateProblems",
61
+ maxNumberOfProblems: "maxNumberOfProblems",
62
+ minWordLength: "minWordLength",
63
+ minRandomLength: "minRandomLength",
64
+ name: "name",
65
+ noConfigSearch: "noConfigSearch",
66
+ noSuggestDictionaries: "noSuggestDictionaries",
67
+ numSuggestions: "numSuggestions",
68
+ overrides: "overrides",
69
+ patterns: "patterns",
70
+ pnpFiles: "pnpFiles",
71
+ readonly: "readonly",
72
+ reporters: "reporters",
73
+ showStatus: "showStatus",
74
+ spellCheckDelayMs: "spellCheckDelayMs",
75
+ suggestionNumChanges: "suggestionNumChanges",
76
+ suggestionsTimeout: "suggestionsTimeout",
77
+ suggestWords: "suggestWords",
78
+ useGitignore: "useGitignore",
79
+ usePnP: "usePnP",
80
+ userWords: "userWords",
81
+ validateDirectives: "validateDirectives",
82
+ words: "words",
83
+ // Experimental
84
+ parser: "parser"
85
+ };
86
+
87
+ // src/CSpellReporter.ts
88
+ var IssueType = /* @__PURE__ */ ((IssueType2) => {
89
+ IssueType2[IssueType2["spelling"] = 0] = "spelling";
90
+ IssueType2[IssueType2["directive"] = 1] = "directive";
91
+ return IssueType2;
92
+ })(IssueType || {});
93
+ var MessageTypes = {
94
+ Debug: "Debug",
95
+ Info: "Info",
96
+ Warning: "Warning"
97
+ };
98
+
99
+ // src/defaultConfigSettings.ts
100
+ var defaultCSpellSettings = {
101
+ ignoreRandomStrings: true,
102
+ minRandomLength: 40
103
+ };
104
+
105
+ // src/defineConfig.ts
106
+ function defineConfig(config) {
107
+ return config;
108
+ }
109
+ // Annotate the CommonJS export names for ESM import in node:
110
+ 0 && (module.exports = {
111
+ ConfigFields,
112
+ IssueType,
113
+ MessageTypes,
114
+ defaultCSpellSettings,
115
+ defineConfig
116
+ });
package/dist/index.mjs CHANGED
@@ -1,2 +1,85 @@
1
- export * from './index.js';
2
- //# sourceMappingURL=index.mjs.map
1
+ // src/configFields.ts
2
+ var ConfigFields = {
3
+ allowCompoundWords: "allowCompoundWords",
4
+ cache: "cache",
5
+ caseSensitive: "caseSensitive",
6
+ description: "description",
7
+ dictionaries: "dictionaries",
8
+ dictionaryDefinitions: "dictionaryDefinitions",
9
+ enabled: "enabled",
10
+ enabledLanguageIds: "enabledLanguageIds",
11
+ enableFiletypes: "enableFiletypes",
12
+ enabledFileTypes: "enabledFileTypes",
13
+ enableGlobDot: "enableGlobDot",
14
+ failFast: "failFast",
15
+ features: "features",
16
+ files: "files",
17
+ flagWords: "flagWords",
18
+ gitignoreRoot: "gitignoreRoot",
19
+ globRoot: "globRoot",
20
+ ignorePaths: "ignorePaths",
21
+ ignoreRegExpList: "ignoreRegExpList",
22
+ ignoreWords: "ignoreWords",
23
+ ignoreRandomStrings: "ignoreRandomStrings",
24
+ import: "import",
25
+ includeRegExpList: "includeRegExpList",
26
+ language: "language",
27
+ languageId: "languageId",
28
+ languageSettings: "languageSettings",
29
+ loadDefaultConfiguration: "loadDefaultConfiguration",
30
+ maxDuplicateProblems: "maxDuplicateProblems",
31
+ maxNumberOfProblems: "maxNumberOfProblems",
32
+ minWordLength: "minWordLength",
33
+ minRandomLength: "minRandomLength",
34
+ name: "name",
35
+ noConfigSearch: "noConfigSearch",
36
+ noSuggestDictionaries: "noSuggestDictionaries",
37
+ numSuggestions: "numSuggestions",
38
+ overrides: "overrides",
39
+ patterns: "patterns",
40
+ pnpFiles: "pnpFiles",
41
+ readonly: "readonly",
42
+ reporters: "reporters",
43
+ showStatus: "showStatus",
44
+ spellCheckDelayMs: "spellCheckDelayMs",
45
+ suggestionNumChanges: "suggestionNumChanges",
46
+ suggestionsTimeout: "suggestionsTimeout",
47
+ suggestWords: "suggestWords",
48
+ useGitignore: "useGitignore",
49
+ usePnP: "usePnP",
50
+ userWords: "userWords",
51
+ validateDirectives: "validateDirectives",
52
+ words: "words",
53
+ // Experimental
54
+ parser: "parser"
55
+ };
56
+
57
+ // src/CSpellReporter.ts
58
+ var IssueType = /* @__PURE__ */ ((IssueType2) => {
59
+ IssueType2[IssueType2["spelling"] = 0] = "spelling";
60
+ IssueType2[IssueType2["directive"] = 1] = "directive";
61
+ return IssueType2;
62
+ })(IssueType || {});
63
+ var MessageTypes = {
64
+ Debug: "Debug",
65
+ Info: "Info",
66
+ Warning: "Warning"
67
+ };
68
+
69
+ // src/defaultConfigSettings.ts
70
+ var defaultCSpellSettings = {
71
+ ignoreRandomStrings: true,
72
+ minRandomLength: 40
73
+ };
74
+
75
+ // src/defineConfig.ts
76
+ function defineConfig(config) {
77
+ return config;
78
+ }
79
+ export {
80
+ ConfigFields,
81
+ IssueType,
82
+ MessageTypes,
83
+ defaultCSpellSettings,
84
+ defineConfig
85
+ };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "8.17.0",
7
+ "version": "8.17.2",
8
8
  "description": "Types for cspell and cspell-lib",
9
9
  "type": "commonjs",
10
10
  "sideEffects": false,
@@ -53,8 +53,9 @@
53
53
  },
54
54
  "scripts": {
55
55
  "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
56
- "build": "pnpm build:tsc && pnpm run build-schema",
56
+ "build": "pnpm build:tsc && pnpm build:tsup && pnpm run build-schema",
57
57
  "build:tsc": "tsc -p tsconfig.json",
58
+ "build:tsup": "tsup-node --entry src/index.ts --entry src/Parser/index.ts --format cjs,esm --dts --out-dir dist",
58
59
  "build-schema": "pnpm build-cspell-schema",
59
60
  "clean-build": "pnpm run clean && pnpm run build",
60
61
  "coverage": "vitest run --coverage",
@@ -88,5 +89,5 @@
88
89
  "node": ">=18"
89
90
  },
90
91
  "homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-types#readme",
91
- "gitHead": "cac17fe7b993db5965aa441648b1c22cb5486929"
92
+ "gitHead": "160c982e8d1e3b4951acb6fc003d013f3b0597e0"
92
93
  }
@@ -1,164 +0,0 @@
1
- import type { TextDocumentOffset, TextOffset } from './TextOffset.js';
2
- export interface Suggestion {
3
- /**
4
- * Word to suggest.
5
- */
6
- word: string;
7
- /**
8
- * The suggested word adjusted to match the original case.
9
- */
10
- wordAdjustedToMatchCase?: string;
11
- /**
12
- * `true` - if this suggestion can be an automatic fix.
13
- */
14
- isPreferred?: boolean;
15
- }
16
- export interface Issue extends Omit<TextDocumentOffset, 'doc'> {
17
- /** text surrounding the issue text */
18
- context: TextOffset;
19
- /**
20
- * true if the issue has been flagged as a forbidden word.
21
- */
22
- isFlagged?: boolean;
23
- /**
24
- * An optional array of replacement strings.
25
- */
26
- suggestions?: string[];
27
- /**
28
- * An optional array of suggestions.
29
- */
30
- suggestionsEx?: Suggestion[];
31
- /**
32
- * Issues are spelling issues unless otherwise specified.
33
- */
34
- issueType?: IssueType;
35
- /**
36
- * Optional message to show.
37
- */
38
- message?: string;
39
- }
40
- export declare enum IssueType {
41
- spelling = 0,
42
- directive = 1
43
- }
44
- export type MessageType = 'Debug' | 'Info' | 'Warning';
45
- export type MessageTypeLookup = {
46
- [key in MessageType]: key;
47
- };
48
- export declare const MessageTypes: MessageTypeLookup;
49
- export type MessageEmitter = (message: string, msgType: MessageType) => void;
50
- export type DebugEmitter = (message: string) => void;
51
- export type ErrorLike = Error | {
52
- message: string;
53
- name: string;
54
- toString: () => string;
55
- };
56
- export type ErrorEmitter = (message: string, error: ErrorLike) => void;
57
- export type SpellingErrorEmitter = (issue: Issue) => void;
58
- export type ProgressTypes = 'ProgressFileBegin' | 'ProgressFileComplete';
59
- export type ProgressItem = ProgressFileBegin | ProgressFileComplete;
60
- export interface ProgressBase {
61
- type: ProgressTypes;
62
- }
63
- export interface ProgressFileBase extends ProgressBase {
64
- type: ProgressTypes;
65
- fileNum: number;
66
- fileCount: number;
67
- filename: string;
68
- }
69
- export interface ProgressFileComplete extends ProgressFileBase {
70
- type: 'ProgressFileComplete';
71
- elapsedTimeMs: number | undefined;
72
- processed: boolean | undefined;
73
- numErrors: number | undefined;
74
- cached?: boolean;
75
- }
76
- /**
77
- * Notification sent just before processing a file.
78
- */
79
- export interface ProgressFileBegin extends ProgressFileBase {
80
- type: 'ProgressFileBegin';
81
- }
82
- export type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
83
- export interface RunResult {
84
- /** Number of files processed. */
85
- files: number;
86
- /** Set of files where issues were found. */
87
- filesWithIssues: Set<string>;
88
- /** Number of issues found. */
89
- issues: number;
90
- /** Number of processing errors. */
91
- errors: number;
92
- /** Number files that used results from the cache. */
93
- cachedFiles?: number;
94
- }
95
- export type ResultEmitter = (result: RunResult) => void | Promise<void>;
96
- export interface CSpellReporter {
97
- issue?: SpellingErrorEmitter;
98
- info?: MessageEmitter;
99
- debug?: DebugEmitter;
100
- error?: ErrorEmitter;
101
- progress?: ProgressEmitter;
102
- result?: ResultEmitter;
103
- }
104
- export interface ReporterConfigurationBase {
105
- /**
106
- * The maximum number of problems to report in a file.
107
- *
108
- * @default 10000
109
- */
110
- maxNumberOfProblems?: number;
111
- /**
112
- * The maximum number of times the same word can be flagged as an error in a file.
113
- *
114
- * @default 5
115
- */
116
- maxDuplicateProblems?: number;
117
- /**
118
- * The minimum length of a word before checking it against a dictionary.
119
- *
120
- * @default 4
121
- */
122
- minWordLength?: number;
123
- /**
124
- * Ignore sequences of characters that look like random strings.
125
- *
126
- * @default true
127
- */
128
- ignoreRandomStrings?: boolean;
129
- /**
130
- * The minimum length of a random string to be ignored.
131
- *
132
- * @default 40
133
- */
134
- minRandomLength?: number;
135
- }
136
- interface ReporterCommandLineOptions {
137
- /**
138
- * Display verbose information
139
- */
140
- verbose?: boolean;
141
- /**
142
- * Show extensive output.
143
- */
144
- debug?: boolean;
145
- /**
146
- * Only report the words, no line numbers or file names.
147
- */
148
- wordsOnly?: boolean;
149
- /**
150
- * unique errors per file only.
151
- */
152
- unique?: boolean;
153
- /**
154
- * root directory, defaults to `cwd`
155
- */
156
- root?: string;
157
- }
158
- export interface ReporterConfiguration extends ReporterCommandLineOptions, ReporterConfigurationBase {
159
- }
160
- export interface CSpellReporterModule {
161
- getReporter: (settings: unknown, config: ReporterConfiguration) => CSpellReporter;
162
- }
163
- export {};
164
- //# sourceMappingURL=CSpellReporter.d.ts.map
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MessageTypes = exports.IssueType = void 0;
4
- var IssueType;
5
- (function (IssueType) {
6
- IssueType[IssueType["spelling"] = 0] = "spelling";
7
- IssueType[IssueType["directive"] = 1] = "directive";
8
- })(IssueType || (exports.IssueType = IssueType = {}));
9
- exports.MessageTypes = {
10
- Debug: 'Debug',
11
- Info: 'Info',
12
- Warning: 'Warning',
13
- };
14
- //# sourceMappingURL=CSpellReporter.js.map