@cspell/cspell-types 6.2.0-alpha.1 → 6.2.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.
@@ -1103,7 +1103,9 @@
1103
1103
  {
1104
1104
  "type": "string"
1105
1105
  },
1106
- {}
1106
+ {
1107
+ "$ref": "#/definitions/Serializable"
1108
+ }
1107
1109
  ],
1108
1110
  "maxItems": 2,
1109
1111
  "minItems": 2,
@@ -1112,6 +1114,25 @@
1112
1114
  ],
1113
1115
  "description": "Reporter name or reporter name + reporter config."
1114
1116
  },
1117
+ "Serializable": {
1118
+ "anyOf": [
1119
+ {
1120
+ "type": "number"
1121
+ },
1122
+ {
1123
+ "type": "string"
1124
+ },
1125
+ {
1126
+ "type": "boolean"
1127
+ },
1128
+ {
1129
+ "type": "null"
1130
+ },
1131
+ {
1132
+ "type": "object"
1133
+ }
1134
+ ]
1135
+ },
1115
1136
  "SimpleGlob": {
1116
1137
  "description": "Simple Glob string, the root will be globRoot.",
1117
1138
  "type": "string"
@@ -1,6 +1,7 @@
1
1
  import type { DictionaryInformation } from './DictionaryInformation';
2
2
  import type { Features } from './features';
3
3
  import { Parser, ParserName } from './Parser';
4
+ import { Serializable } from './types';
4
5
  export declare type ReplaceEntry = [string, string];
5
6
  export declare type ReplaceMap = ReplaceEntry[];
6
7
  /**
@@ -9,11 +10,6 @@ export declare type ReplaceMap = ReplaceEntry[];
9
10
  export declare type CSpellPackageSettings = CSpellUserSettings;
10
11
  export declare type CSpellUserSettings = CSpellSettings;
11
12
  export interface CSpellSettings extends FileSettings, LegacySettings {
12
- /**
13
- * Url to JSON Schema
14
- * @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
15
- */
16
- $schema?: string;
17
13
  }
18
14
  export interface ImportFileRef {
19
15
  filename: string;
@@ -25,7 +21,14 @@ export interface CSpellSettingsWithSourceTrace extends CSpellSettings {
25
21
  __importRef?: ImportFileRef;
26
22
  __imports?: Map<string, ImportFileRef>;
27
23
  }
28
- export interface FileSettings extends ExtendableSettings, CommandLineSettings, ExperimentalFileSettings {
24
+ export interface AdvancedCSpellSettingsWithSourceTrace extends CSpellSettingsWithSourceTrace, ExperimentalFileSettings {
25
+ }
26
+ export interface FileSettings extends ExtendableSettings, CommandLineSettings {
27
+ /**
28
+ * Url to JSON Schema
29
+ * @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json"
30
+ */
31
+ $schema?: string;
29
32
  /**
30
33
  * Configuration format version of the settings file.
31
34
  *
@@ -802,7 +805,7 @@ interface BaseSource {
802
805
  /**
803
806
  * Reporter name or reporter name + reporter config.
804
807
  */
805
- export declare type ReporterSettings = string | [string] | [string, unknown];
808
+ export declare type ReporterSettings = string | [string] | [string, Serializable];
806
809
  /**
807
810
  * Experimental Configuration / Options
808
811
  *
@@ -816,7 +819,14 @@ export interface ExperimentalFileSettings {
816
819
  * @experimental
817
820
  * @version 6.2.0
818
821
  */
819
- plugins?: Plugin[] | undefined;
822
+ plugins?: Plugin[];
823
+ }
824
+ /**
825
+ * Extends CSpellSettings with ExperimentalFileSettings
826
+ * @experimental
827
+ * @hidden
828
+ */
829
+ export interface AdvancedCSpellSettings extends CSpellSettings, ExperimentalFileSettings {
820
830
  }
821
831
  /**
822
832
  * Experimental Configuration / Options
@@ -831,7 +841,7 @@ export interface ExperimentalBaseSettings {
831
841
  * @experimental
832
842
  * @version 6.2.0
833
843
  */
834
- parser?: ParserName | undefined;
844
+ parser?: ParserName;
835
845
  }
836
846
  /**
837
847
  * Plugin API
@@ -839,7 +849,7 @@ export interface ExperimentalBaseSettings {
839
849
  * @version 6.2.0
840
850
  */
841
851
  export interface Plugin {
842
- parsers?: Parser[] | undefined;
852
+ parsers?: Parser[];
843
853
  }
844
854
  export {};
845
855
  //# sourceMappingURL=CSpellSettingsDef.d.ts.map
@@ -49,7 +49,6 @@ exports.ConfigFields = {
49
49
  words: 'words',
50
50
  // Experimental
51
51
  parser: 'parser',
52
- plugins: 'plugins',
53
52
  };
54
53
  // export const ConfigKeysNames = Object.values(ConfigKeysByField);
55
54
  //# sourceMappingURL=configFields.js.map
@@ -0,0 +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> = {
3
+ [K in keyof T]: K extends string | number ? Serialize<T[K]> : never;
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;
8
+ export {};
9
+ //# sourceMappingURL=types.d.ts.map
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /* eslint-disable @typescript-eslint/ban-types */
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "6.2.0-alpha.1",
6
+ "version": "6.2.0",
7
7
  "description": "Types for cspell and cspell-lib",
8
8
  "type": "commonjs",
9
9
  "main": "dist/index.js",
@@ -69,5 +69,5 @@
69
69
  "ts-json-schema-generator": "^1.0.0",
70
70
  "typescript": "^4.7.4"
71
71
  },
72
- "gitHead": "bb1862e9d5116b64451e625eb002f835e2873f9b"
72
+ "gitHead": "ef9bf8e390692145b067843dbcc44a6dc2d9aa31"
73
73
  }