@cspell/cspell-types 6.14.1 → 6.14.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.
@@ -23,22 +23,22 @@ export declare enum IssueType {
23
23
  spelling = 0,
24
24
  directive = 1
25
25
  }
26
- export declare type MessageType = 'Debug' | 'Info' | 'Warning';
27
- export declare type MessageTypeLookup = {
26
+ export type MessageType = 'Debug' | 'Info' | 'Warning';
27
+ export type MessageTypeLookup = {
28
28
  [key in MessageType]: key;
29
29
  };
30
30
  export declare const MessageTypes: MessageTypeLookup;
31
- export declare type MessageEmitter = (message: string, msgType: MessageType) => void;
32
- export declare type DebugEmitter = (message: string) => void;
33
- export declare type ErrorLike = Error | {
31
+ export type MessageEmitter = (message: string, msgType: MessageType) => void;
32
+ export type DebugEmitter = (message: string) => void;
33
+ export type ErrorLike = Error | {
34
34
  message: string;
35
35
  name: string;
36
36
  toString: () => string;
37
37
  };
38
- export declare type ErrorEmitter = (message: string, error: ErrorLike) => void;
39
- export declare type SpellingErrorEmitter = (issue: Issue) => void;
40
- export declare type ProgressTypes = 'ProgressFileBegin' | 'ProgressFileComplete';
41
- export declare type ProgressItem = ProgressFileBegin | ProgressFileComplete;
38
+ export type ErrorEmitter = (message: string, error: ErrorLike) => void;
39
+ export type SpellingErrorEmitter = (issue: Issue) => void;
40
+ export type ProgressTypes = 'ProgressFileBegin' | 'ProgressFileComplete';
41
+ export type ProgressItem = ProgressFileBegin | ProgressFileComplete;
42
42
  export interface ProgressBase {
43
43
  type: ProgressTypes;
44
44
  }
@@ -61,7 +61,7 @@ export interface ProgressFileComplete extends ProgressFileBase {
61
61
  export interface ProgressFileBegin extends ProgressFileBase {
62
62
  type: 'ProgressFileBegin';
63
63
  }
64
- export declare type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
64
+ export type ProgressEmitter = (p: ProgressItem | ProgressFileComplete) => void;
65
65
  export interface RunResult {
66
66
  /** Number of files processed. */
67
67
  files: number;
@@ -74,7 +74,7 @@ export interface RunResult {
74
74
  /** Number files that used results from the cache. */
75
75
  cachedFiles?: number;
76
76
  }
77
- export declare type ResultEmitter = (result: RunResult) => void | Promise<void>;
77
+ export type ResultEmitter = (result: RunResult) => void | Promise<void>;
78
78
  export interface CSpellReporter {
79
79
  issue: SpellingErrorEmitter;
80
80
  info: MessageEmitter;
@@ -2,13 +2,13 @@ import type { DictionaryInformation } from './DictionaryInformation';
2
2
  import type { Features } from './features';
3
3
  import { Parser, ParserName } from './Parser';
4
4
  import { Serializable } from './types';
5
- export declare type ReplaceEntry = [string, string];
6
- export declare type ReplaceMap = ReplaceEntry[];
5
+ export type ReplaceEntry = [string, string];
6
+ export type ReplaceMap = ReplaceEntry[];
7
7
  /**
8
8
  * These settings come from user and workspace settings.
9
9
  */
10
- export declare type CSpellPackageSettings = CSpellUserSettings;
11
- export declare type CSpellUserSettings = CSpellSettings;
10
+ export type CSpellPackageSettings = CSpellUserSettings;
11
+ export type CSpellUserSettings = CSpellSettings;
12
12
  export interface CSpellSettings extends FileSettings, LegacySettings {
13
13
  }
14
14
  export interface ImportFileRef {
@@ -268,8 +268,8 @@ export interface PnPSettings {
268
268
  * - `metadata` - uses the file system timestamp and size to detect changes (fastest).
269
269
  * - `content` - uses a hash of the file content to check file changes (slower - more accurate).
270
270
  */
271
- export declare type CacheStrategy = 'metadata' | 'content';
272
- export declare type CacheFormat = 'legacy' | 'universal';
271
+ export type CacheStrategy = 'metadata' | 'content';
272
+ export type CacheFormat = 'legacy' | 'universal';
273
273
  export interface CacheSettings {
274
274
  /**
275
275
  * Store the results of processed files in order to only operate on the changed ones.
@@ -482,8 +482,8 @@ export interface BaseSetting extends ExperimentalBaseSettings {
482
482
  */
483
483
  patterns?: RegExpPatternDefinition[];
484
484
  }
485
- export declare type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
486
- export declare type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
485
+ export type DictionaryFileTypes = 'S' | 'W' | 'C' | 'T';
486
+ export type DictionaryDefinition = DictionaryDefinitionPreferred | DictionaryDefinitionCustom | DictionaryDefinitionAugmented | DictionaryDefinitionAlternate | DictionaryDefinitionLegacy;
487
487
  export interface DictionaryDefinitionBase {
488
488
  /**
489
489
  * This is the name of a dictionary.
@@ -588,7 +588,7 @@ export interface DictionaryDefinitionLegacy extends DictionaryDefinitionBase {
588
588
  /**
589
589
  * Specifies the scope of a dictionary.
590
590
  */
591
- export declare type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
591
+ export type CustomDictionaryScope = 'user' | 'workspace' | 'folder';
592
592
  /**
593
593
  * For Defining Custom dictionaries. They are generally scoped to a
594
594
  * `user`, `workspace`, or `folder`.
@@ -630,15 +630,15 @@ export interface LanguageSettingFilterFieldsDeprecated {
630
630
  local?: LocaleId | LocaleId[];
631
631
  }
632
632
  /** @hidden */
633
- declare type InternalRegExp = RegExp;
634
- export declare type Pattern = string | InternalRegExp;
635
- export declare type PredefinedPatterns = 'Base64' | 'Base64MultiLine' | 'Base64SingleLine' | 'CStyleComment' | 'CStyleHexValue' | 'CSSHexValue' | 'CommitHash' | 'CommitHashLink' | 'Email' | 'EscapeCharacters' | 'HexValues' | 'href' | 'PhpHereDoc' | 'PublicKey' | 'RsaCert' | 'SshRsa' | 'SHA' | 'HashStrings' | 'SpellCheckerDisable' | 'SpellCheckerDisableBlock' | 'SpellCheckerDisableLine' | 'SpellCheckerDisableNext' | 'SpellCheckerIgnoreInDocSetting' | 'string' | 'UnicodeRef' | 'Urls' | 'UUID' | 'Everything';
633
+ type InternalRegExp = RegExp;
634
+ export type Pattern = string | InternalRegExp;
635
+ export type PredefinedPatterns = 'Base64' | 'Base64MultiLine' | 'Base64SingleLine' | 'CStyleComment' | 'CStyleHexValue' | 'CSSHexValue' | 'CommitHash' | 'CommitHashLink' | 'Email' | 'EscapeCharacters' | 'HexValues' | 'href' | 'PhpHereDoc' | 'PublicKey' | 'RsaCert' | 'SshRsa' | 'SHA' | 'HashStrings' | 'SpellCheckerDisable' | 'SpellCheckerDisableBlock' | 'SpellCheckerDisableLine' | 'SpellCheckerDisableNext' | 'SpellCheckerIgnoreInDocSetting' | 'string' | 'UnicodeRef' | 'Urls' | 'UUID' | 'Everything';
636
636
  /** This matches the name in a pattern definition. */
637
- export declare type PatternId = string;
637
+ export type PatternId = string;
638
638
  /** A PatternRef is a Pattern or PatternId. */
639
- export declare type PatternRef = Pattern | PatternId | PredefinedPatterns;
639
+ export type PatternRef = Pattern | PatternId | PredefinedPatterns;
640
640
  /** A list of pattern names or regular expressions. */
641
- export declare type RegExpPatternList = PatternRef[];
641
+ export type RegExpPatternList = PatternRef[];
642
642
  /**
643
643
  * This is the name of a dictionary.
644
644
  *
@@ -651,12 +651,12 @@ export declare type RegExpPatternList = PatternRef[];
651
651
  *
652
652
  * @pattern ^(?=[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
653
653
  */
654
- export declare type DictionaryId = string;
654
+ export type DictionaryId = string;
655
655
  /**
656
656
  * This a reference to a named dictionary.
657
657
  * It is expected to match the name of a dictionary.
658
658
  */
659
- export declare type DictionaryRef = DictionaryId;
659
+ export type DictionaryRef = DictionaryId;
660
660
  /**
661
661
  * This a negative reference to a named dictionary.
662
662
  *
@@ -671,36 +671,36 @@ export declare type DictionaryRef = DictionaryId;
671
671
  *
672
672
  * @pattern ^(?=!+[^!*,;{}[\]~\n]+$)(?=(.*\w)).+$
673
673
  */
674
- export declare type DictionaryNegRef = string;
674
+ export type DictionaryNegRef = string;
675
675
  /**
676
676
  * Reference to a dictionary by name.
677
677
  * One of:
678
678
  * - {@link DictionaryRef}
679
679
  * - {@link DictionaryNegRef}
680
680
  */
681
- export declare type DictionaryReference = DictionaryRef | DictionaryNegRef;
681
+ export type DictionaryReference = DictionaryRef | DictionaryNegRef;
682
682
  /** This is a written language locale like: 'en', 'en-GB', 'fr', 'es', 'de', etc. */
683
- export declare type LocaleId = string;
683
+ export type LocaleId = string;
684
684
  /**
685
685
  * Configuration File Version.
686
686
  */
687
- export declare type VersionLatest = '0.2';
687
+ export type VersionLatest = '0.2';
688
688
  /**
689
689
  * Legacy Configuration File Versions.
690
690
  * @deprecated true
691
691
  * @deprecationMessage Use `0.2` instead.
692
692
  */
693
- export declare type VersionLegacy = '0.1';
694
- export declare type Version = VersionLatest | VersionLegacy;
693
+ export type VersionLegacy = '0.1';
694
+ export type Version = VersionLatest | VersionLegacy;
695
695
  /**
696
696
  * @deprecated true
697
697
  * @deprecationMessage Use `LocaleId` instead.
698
698
  */
699
- export declare type LocalId = LocaleId;
699
+ export type LocalId = LocaleId;
700
700
  /** These are glob expressions. */
701
- export declare type Glob = SimpleGlob | GlobDef;
701
+ export type Glob = SimpleGlob | GlobDef;
702
702
  /** Simple Glob string, the root will be globRoot. */
703
- export declare type SimpleGlob = string;
703
+ export type SimpleGlob = string;
704
704
  /**
705
705
  * Used to define fully qualified glob patterns.
706
706
  * It is currently hidden to make the json-schema a bit easier to use
@@ -722,22 +722,22 @@ export interface GlobDef {
722
722
  * This can be '*', 'typescript', 'cpp', 'json', etc.
723
723
  * @pattern ^(!?[-\w_\s]+)|(\*)$
724
724
  */
725
- export declare type LanguageIdSingle = string;
725
+ export type LanguageIdSingle = string;
726
726
  /**
727
727
  * This can be 'typescript,cpp,json,literal haskell', etc.
728
728
  * @pattern ^([-\w_\s]+)(,[-\w_\s]+)*$
729
729
  */
730
- export declare type LanguageIdMultiple = string;
730
+ export type LanguageIdMultiple = string;
731
731
  /**
732
732
  * This can be 'typescript,cpp,json,literal haskell', etc.
733
733
  * @pattern ^(![-\w_\s]+)(,![-\w_\s]+)*$
734
734
  */
735
- export declare type LanguageIdMultipleNeg = string;
736
- export declare type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
735
+ export type LanguageIdMultipleNeg = string;
736
+ export type LanguageId = LanguageIdSingle | LanguageIdMultiple | LanguageIdMultipleNeg;
737
737
  /**
738
738
  * A File System Path. Relative paths are relative to the configuration file.
739
739
  */
740
- export declare type FsPath = string;
740
+ export type FsPath = string;
741
741
  /**
742
742
  * A File System Path.
743
743
  *
@@ -745,18 +745,18 @@ export declare type FsPath = string;
745
745
  * - `${cwd}` prefix - will be replaced with the current working directory.
746
746
  * - Relative paths are relative to the configuration file.
747
747
  */
748
- export declare type FSPathResolvable = FsPath;
748
+ export type FSPathResolvable = FsPath;
749
749
  /** Trust Security Level. */
750
- export declare type TrustLevel = 'trusted' | 'untrusted';
750
+ export type TrustLevel = 'trusted' | 'untrusted';
751
751
  /**
752
752
  * A File System Path to a dictionary file.
753
753
  * @pattern ^.*\.(?:txt|trie)(?:\.gz)?$
754
754
  */
755
- export declare type DictionaryPath = string;
755
+ export type DictionaryPath = string;
756
756
  /**
757
757
  * A File System Path to a dictionary file.
758
758
  */
759
- export declare type CustomDictionaryPath = FsPath;
759
+ export type CustomDictionaryPath = FsPath;
760
760
  export interface RegExpPatternDefinition {
761
761
  /**
762
762
  * Pattern name, used as an identifier in ignoreRegExpList and includeRegExpList.
@@ -772,8 +772,8 @@ export interface RegExpPatternDefinition {
772
772
  */
773
773
  description?: string | undefined;
774
774
  }
775
- export declare type CSpellUserSettingsWithComments = CSpellUserSettings;
776
- export declare type Source = FileSource | MergeSource | InMemorySource | BaseSource;
775
+ export type CSpellUserSettingsWithComments = CSpellUserSettings;
776
+ export type Source = FileSource | MergeSource | InMemorySource | BaseSource;
777
777
  export interface FileSource extends BaseSource {
778
778
  /** Name of source. */
779
779
  name: string;
@@ -817,7 +817,7 @@ interface BaseSource {
817
817
  /**
818
818
  * Reporter name or reporter name + reporter config.
819
819
  */
820
- export declare type ReporterSettings = string | [string] | [string, Serializable];
820
+ export type ReporterSettings = string | [string] | [string, Serializable];
821
821
  /**
822
822
  * Experimental Configuration / Options
823
823
  *
@@ -103,7 +103,7 @@ export interface HunspellInformation {
103
103
  * MAP (IJ)(IJ)
104
104
  * ```
105
105
  */
106
- declare type HunspellAffContent = string;
106
+ type HunspellAffContent = string;
107
107
  interface HunspellCosts extends EditCosts {
108
108
  /**
109
109
  * The cost of inserting / deleting / or swapping any `tryChars`
@@ -181,7 +181,7 @@ export interface EditCosts {
181
181
  * - `|` - is a group separator, indicating that the characters on either side
182
182
  * are not related.
183
183
  */
184
- export declare type CharacterSet = string;
184
+ export type CharacterSet = string;
185
185
  export interface CharacterSetCosts {
186
186
  /**
187
187
  * This is a set of characters that can include `-` or `|`
package/dist/Parser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare type ParserOptions = Record<string, unknown>;
2
- export declare type ParserName = string;
1
+ export type ParserOptions = Record<string, unknown>;
2
+ export type ParserName = string;
3
3
  export interface Parser {
4
4
  /** Name of parser */
5
5
  readonly name: ParserName;
@@ -74,8 +74,8 @@ export interface ParsedText {
74
74
  *
75
75
  * <!--- cspell:ignore Bjørvika rvika --->
76
76
  */
77
- export declare type SourceMap = number[];
78
- export declare type Range = readonly [start: number, end: number];
77
+ export type SourceMap = number[];
78
+ export 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
@@ -121,6 +121,6 @@ export interface ScopeChain {
121
121
  *
122
122
  * Example: `comment.block.documentation.ts meta.interface.ts source.ts`
123
123
  */
124
- export declare type ScopeString = string;
125
- export declare type Scope = ScopeChain | ScopeString;
124
+ export type ScopeString = string;
125
+ export type Scope = ScopeChain | ScopeString;
126
126
  //# sourceMappingURL=Parser.d.ts.map
package/dist/TextMap.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare type MappedText = Readonly<TransformedText>;
2
- export declare type Range = readonly [start: number, end: number];
1
+ export type MappedText = Readonly<TransformedText>;
2
+ export type Range = readonly [start: number, end: number];
3
3
  export interface Mapped {
4
4
  /**
5
5
  * `(i, j)` number pairs where
@@ -29,7 +29,7 @@ interface TransformedText extends PartialOrUndefined<Mapped> {
29
29
  */
30
30
  range: Range;
31
31
  }
32
- declare type PartialOrUndefined<T> = {
32
+ type PartialOrUndefined<T> = {
33
33
  [P in keyof T]?: T[P] | undefined;
34
34
  };
35
35
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { CSpellUserSettings } from './CSpellSettingsDef';
2
- export declare type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
3
- export declare type CSpellUserSettingsFields = {
2
+ export type ConfigKeys = Exclude<keyof CSpellUserSettings, '$schema' | 'version' | 'id'>;
3
+ export type CSpellUserSettingsFields = {
4
4
  [key in ConfigKeys]: key;
5
5
  };
6
6
  export declare const ConfigFields: CSpellUserSettingsFields;
@@ -23,16 +23,16 @@ export interface FeaturesDeprecated {
23
23
  */
24
24
  export interface Features extends Partial<FeaturesActive>, Partial<FeaturesDeprecated>, Partial<FeaturesExperimental> {
25
25
  }
26
- export declare type Feature = FeatureEnableOnly | FeatureWithConfiguration;
27
- export declare type FeatureEnableOnly = boolean;
26
+ export type Feature = FeatureEnableOnly | FeatureWithConfiguration;
27
+ export type FeatureEnableOnly = boolean;
28
28
  /**
29
29
  * Feature Configuration.
30
30
  */
31
31
  export interface FeatureWithConfiguration {
32
32
  enable: boolean;
33
33
  }
34
- export declare type FeatureNamesKnown = keyof Features;
35
- export declare type FeatureNamesExperimental = keyof FeaturesExperimental;
36
- export declare type FeatureNamesActive = keyof FeaturesActive;
37
- export declare type FeatureNamesDeprecated = keyof FeaturesDeprecated;
34
+ export type FeatureNamesKnown = keyof Features;
35
+ export type FeatureNamesExperimental = keyof FeaturesExperimental;
36
+ export type FeatureNamesActive = keyof FeaturesActive;
37
+ export type FeatureNamesDeprecated = keyof FeaturesDeprecated;
38
38
  //# sourceMappingURL=features.d.ts.map
@@ -20,8 +20,8 @@
20
20
  *
21
21
  * Note: the default edit distance is 100.
22
22
  */
23
- export declare type SuggestionCostMapDef = CostMapDefReplace | CostMapDefInsDel | CostMapDefSwap;
24
- export declare type SuggestionCostsDefs = SuggestionCostMapDef[];
23
+ export type SuggestionCostMapDef = CostMapDefReplace | CostMapDefInsDel | CostMapDefSwap;
24
+ export type SuggestionCostsDefs = SuggestionCostMapDef[];
25
25
  interface CostMapDefBase {
26
26
  /**
27
27
  * The set of substrings to map, these are generally single character strings.
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare type Serialize<T> = T extends Function ? never : T extends null ? null : T extends any[] ? SerializeArray<T> : T extends object ? SerializeObj<T> : Primitives<T>;
2
- declare type SerializeObj<T extends object> = {
1
+ export type Serialize<T> = T extends Function ? never : T extends null ? null : T extends any[] ? SerializeArray<T> : T extends object ? SerializeObj<T> : Primitives<T>;
2
+ type SerializeObj<T extends object> = {
3
3
  [K in keyof T]: K extends string | number ? Serialize<T[K]> : never;
4
4
  };
5
- declare type SerializeArray<T extends Array<any>> = T extends [infer R] ? [Serialize<R>] : T extends [infer R0, infer R1] ? [Serialize<R0>, Serialize<R1>] : T extends [infer R0, infer R1, infer R2] ? [Serialize<R0>, Serialize<R1>, Serialize<R2>] : T extends Array<infer R> ? Serialize<R>[] : never;
6
- declare type Primitives<T> = Extract<T, number | string | null | boolean>;
7
- export declare type Serializable = number | string | boolean | null | object;
5
+ type SerializeArray<T extends Array<any>> = T extends [infer R] ? [Serialize<R>] : T extends [infer R0, infer R1] ? [Serialize<R0>, Serialize<R1>] : T extends [infer R0, infer R1, infer R2] ? [Serialize<R0>, Serialize<R1>, Serialize<R2>] : T extends Array<infer R> ? Serialize<R>[] : never;
6
+ type Primitives<T> = Extract<T, number | string | null | boolean>;
7
+ export type Serializable = number | string | boolean | null | object;
8
8
  export {};
9
9
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "6.14.1",
6
+ "version": "6.14.3",
7
7
  "description": "Types for cspell and cspell-lib",
8
8
  "type": "commonjs",
9
9
  "main": "dist/index.js",
@@ -64,10 +64,10 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "ajv-cli": "^5.0.0",
67
- "jest": "^29.2.2",
67
+ "jest": "^29.3.1",
68
68
  "rimraf": "^3.0.2",
69
69
  "ts-json-schema-generator": "^1.1.2",
70
- "typescript": "^4.8.4"
70
+ "typescript": "^4.9.3"
71
71
  },
72
- "gitHead": "35db1ed216cd9aaf479429d3268482f30d824e70"
72
+ "gitHead": "df0efdbb0dc7b084579130ba5fe97441c0ab67ca"
73
73
  }