@cspell/cspell-types 6.19.2 → 6.20.1

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 (62) hide show
  1. package/{ajv.config.js → ajv.config.cjs} +0 -0
  2. package/dist/{CSpellReporter.d.ts → cjs/CSpellReporter.d.ts} +1 -1
  3. package/dist/{CSpellSettingsDef.d.ts → cjs/CSpellSettingsDef.d.ts} +4 -4
  4. package/dist/{DictionaryDefinition.d.ts → cjs/DictionaryDefinition.d.ts} +1 -1
  5. package/dist/{DictionaryInformation.d.ts → cjs/DictionaryInformation.d.ts} +1 -1
  6. package/dist/cjs/Parser/CSpellReporter.d.ts +103 -0
  7. package/dist/cjs/Parser/CSpellSettingsDef.d.ts +689 -0
  8. package/dist/cjs/Parser/DictionaryDefinition.d.ts +184 -0
  9. package/dist/cjs/Parser/DictionaryInformation.d.ts +210 -0
  10. package/dist/{Parser.d.ts → cjs/Parser/Parser/index.d.ts} +1 -1
  11. package/dist/{TextMap.d.ts → cjs/Parser/TextMap.d.ts} +0 -0
  12. package/dist/{TextOffset.d.ts → cjs/Parser/TextOffset.d.ts} +0 -0
  13. package/dist/{configFields.d.ts → cjs/Parser/configFields.d.ts} +1 -1
  14. package/dist/{features.d.ts → cjs/Parser/features.d.ts} +0 -0
  15. package/dist/cjs/Parser/index.cjs +3 -0
  16. package/dist/{index.d.ts → cjs/Parser/index.d.ts} +12 -12
  17. package/dist/{suggestionCostsDef.d.ts → cjs/Parser/suggestionCostsDef.d.ts} +0 -0
  18. package/dist/{types.d.ts → cjs/Parser/types.d.ts} +0 -0
  19. package/dist/cjs/TextMap.d.ts +36 -0
  20. package/dist/cjs/TextOffset.d.ts +23 -0
  21. package/dist/cjs/configFields.d.ts +7 -0
  22. package/dist/cjs/features.d.ts +38 -0
  23. package/dist/cjs/index.cjs +68 -0
  24. package/dist/cjs/index.d.ts +13 -0
  25. package/dist/cjs/suggestionCostsDef.d.ts +88 -0
  26. package/dist/cjs/types.d.ts +9 -0
  27. package/dist/esm/CSpellReporter.d.ts +103 -0
  28. package/dist/esm/CSpellReporter.js +11 -0
  29. package/dist/esm/CSpellSettingsDef.d.ts +689 -0
  30. package/dist/esm/CSpellSettingsDef.js +2 -0
  31. package/dist/esm/DictionaryDefinition.d.ts +184 -0
  32. package/dist/esm/DictionaryDefinition.js +2 -0
  33. package/dist/esm/DictionaryInformation.d.ts +210 -0
  34. package/dist/esm/DictionaryInformation.js +2 -0
  35. package/dist/esm/Parser/index.d.ts +126 -0
  36. package/dist/esm/Parser/index.js +2 -0
  37. package/dist/esm/TextMap.d.ts +36 -0
  38. package/dist/esm/TextMap.js +2 -0
  39. package/dist/esm/TextOffset.d.ts +23 -0
  40. package/dist/esm/TextOffset.js +2 -0
  41. package/dist/esm/configFields.d.ts +7 -0
  42. package/dist/{configFields.js → esm/configFields.js} +1 -4
  43. package/dist/esm/features.d.ts +38 -0
  44. package/dist/esm/features.js +3 -0
  45. package/dist/esm/index.d.ts +13 -0
  46. package/dist/esm/index.js +3 -0
  47. package/dist/esm/suggestionCostsDef.d.ts +88 -0
  48. package/dist/esm/suggestionCostsDef.js +2 -0
  49. package/dist/esm/types.d.ts +9 -0
  50. package/dist/esm/types.js +4 -0
  51. package/package.json +53 -27
  52. package/dist/CSpellReporter.js +0 -14
  53. package/dist/CSpellSettingsDef.js +0 -3
  54. package/dist/DictionaryDefinition.js +0 -3
  55. package/dist/DictionaryInformation.js +0 -3
  56. package/dist/Parser.js +0 -3
  57. package/dist/TextMap.js +0 -3
  58. package/dist/TextOffset.js +0 -3
  59. package/dist/features.js +0 -4
  60. package/dist/index.js +0 -9
  61. package/dist/suggestionCostsDef.js +0 -3
  62. package/dist/types.js +0 -5
File without changes
@@ -1,4 +1,4 @@
1
- import type { TextDocumentOffset, TextOffset } from './TextOffset';
1
+ import type { TextDocumentOffset, TextOffset } from './TextOffset.js';
2
2
  export interface Suggestion {
3
3
  /**
4
4
  * Word to suggest.
@@ -1,7 +1,7 @@
1
- import type { DictionaryDefinition, DictionaryReference } from './DictionaryDefinition';
2
- import type { Features } from './features';
3
- import type { Parser, ParserName } from './Parser';
4
- import type { Serializable } from './types';
1
+ import type { DictionaryDefinition, DictionaryReference } from './DictionaryDefinition.js';
2
+ import type { Features } from './features.js';
3
+ import type { Parser, ParserName } from './Parser/index.js';
4
+ import type { Serializable } from './types.js';
5
5
  /**
6
6
  * These settings come from user and workspace settings.
7
7
  */
@@ -1,4 +1,4 @@
1
- import type { DictionaryInformation } from './DictionaryInformation';
1
+ import type { DictionaryInformation } from './DictionaryInformation.js';
2
2
  export type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
3
3
  export type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
4
4
  export interface DictionaryDefinitionBase {
@@ -1,4 +1,4 @@
1
- import type { SuggestionCostsDefs } from './suggestionCostsDef';
1
+ import type { SuggestionCostsDefs } from './suggestionCostsDef.js';
2
2
  /**
3
3
  * Use by dictionary authors to help improve the quality of suggestions
4
4
  * given from the dictionary.
@@ -0,0 +1,103 @@
1
+ import type { TextDocumentOffset, TextOffset } from './TextOffset.js';
2
+ export interface Suggestion {
3
+ /**
4
+ * Word to suggest.
5
+ */
6
+ word: string;
7
+ /**
8
+ * `true` - if this suggestion can be an automatic fix.
9
+ */
10
+ isPreferred?: boolean;
11
+ }
12
+ export interface Issue extends Omit<TextDocumentOffset, 'doc'> {
13
+ /** text surrounding the issue text */
14
+ context: TextOffset;
15
+ /**
16
+ * true if the issue has been flagged as a forbidden word.
17
+ */
18
+ isFlagged?: boolean;
19
+ /**
20
+ * An optional array of replacement strings.
21
+ */
22
+ suggestions?: string[];
23
+ /**
24
+ * An optional array of suggestions.
25
+ */
26
+ suggestionsEx?: Suggestion[];
27
+ /**
28
+ * Issues are spelling issues unless otherwise specified.
29
+ */
30
+ issueType?: IssueType;
31
+ /**
32
+ * Optional message to show.
33
+ */
34
+ message?: string;
35
+ }
36
+ export declare enum IssueType {
37
+ spelling = 0,
38
+ directive = 1
39
+ }
40
+ export type MessageType = 'Debug' | 'Info' | 'Warning';
41
+ export type MessageTypeLookup = {
42
+ [key in MessageType]: key;
43
+ };
44
+ export declare const MessageTypes: MessageTypeLookup;
45
+ export type MessageEmitter = (message: string, msgType: MessageType) => void;
46
+ export type DebugEmitter = (message: string) => void;
47
+ export type ErrorLike = Error | {
48
+ message: string;
49
+ name: string;
50
+ toString: () => string;
51
+ };
52
+ export type ErrorEmitter = (message: string, error: ErrorLike) => void;
53
+ export type SpellingErrorEmitter = (issue: Issue) => void;
54
+ export type ProgressTypes = 'ProgressFileBegin' | 'ProgressFileComplete';
55
+ export type ProgressItem = ProgressFileBegin | ProgressFileComplete;
56
+ export interface ProgressBase {
57
+ type: ProgressTypes;
58
+ }
59
+ export interface ProgressFileBase extends ProgressBase {
60
+ type: ProgressTypes;
61
+ fileNum: number;
62
+ fileCount: number;
63
+ filename: string;
64
+ }
65
+ export interface ProgressFileComplete extends ProgressFileBase {
66
+ type: 'ProgressFileComplete';
67
+ elapsedTimeMs: number | undefined;
68
+ processed: boolean | undefined;
69
+ numErrors: number | undefined;
70
+ cached?: boolean;
71
+ }
72
+ /**
73
+ * Notification sent just before processing a file.
74
+ */
75
+ export interface ProgressFileBegin extends ProgressFileBase {
76
+ type: 'ProgressFileBegin';
77
+ }
78
+ export type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
79
+ export interface RunResult {
80
+ /** Number of files processed. */
81
+ files: number;
82
+ /** Set of files where issues were found. */
83
+ filesWithIssues: Set<string>;
84
+ /** Number of issues found. */
85
+ issues: number;
86
+ /** Number of processing errors. */
87
+ errors: number;
88
+ /** Number files that used results from the cache. */
89
+ cachedFiles?: number;
90
+ }
91
+ export type ResultEmitter = (result: RunResult) => void | Promise<void>;
92
+ export interface CSpellReporter {
93
+ issue: SpellingErrorEmitter;
94
+ info: MessageEmitter;
95
+ debug: DebugEmitter;
96
+ error: ErrorEmitter;
97
+ progress: ProgressEmitter;
98
+ result: ResultEmitter;
99
+ }
100
+ export interface CSpellReporterModule {
101
+ getReporter: (settings: unknown) => CSpellReporter;
102
+ }
103
+ //# sourceMappingURL=CSpellReporter.d.ts.map