lucid-extension-sdk 0.0.63 → 0.0.65

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -12,6 +12,7 @@ export declare enum CollectionEnumFieldNames {
12
12
  Color = "color",
13
13
  IconUrl = "iconUrl"
14
14
  }
15
+ export declare const isCollectionEnumFieldNames: (x: unknown) => x is CollectionEnumFieldNames;
15
16
  export declare class CollectionEnumFieldType {
16
17
  readonly collectionId: string;
17
18
  /**
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSerializedCollectionEnumFieldType = exports.deserializeCollectionEnumFieldType = exports.isCollectionEnumFieldType = exports.CollectionEnumFieldType = exports.CollectionEnumFieldNames = exports.CollectionEnumFieldTypeKey = void 0;
3
+ exports.isSerializedCollectionEnumFieldType = exports.deserializeCollectionEnumFieldType = exports.isCollectionEnumFieldType = exports.CollectionEnumFieldType = exports.isCollectionEnumFieldNames = exports.CollectionEnumFieldNames = exports.CollectionEnumFieldTypeKey = void 0;
4
4
  const checks_1 = require("../../checks");
5
+ const validators_1 = require("../../validators/validators");
5
6
  exports.CollectionEnumFieldTypeKey = 'COLLECTION_ENUM';
6
7
  /**
7
8
  * Contains the field names of all valid fields for a groovy metadata collection.
@@ -16,6 +17,7 @@ var CollectionEnumFieldNames;
16
17
  CollectionEnumFieldNames["Color"] = "color";
17
18
  CollectionEnumFieldNames["IconUrl"] = "iconUrl";
18
19
  })(CollectionEnumFieldNames = exports.CollectionEnumFieldNames || (exports.CollectionEnumFieldNames = {}));
20
+ exports.isCollectionEnumFieldNames = (0, validators_1.enumValidator)(CollectionEnumFieldNames);
19
21
  class CollectionEnumFieldType {
20
22
  constructor(collectionId) {
21
23
  this.collectionId = collectionId;
@@ -8,12 +8,12 @@ import { DestructureGuardedTypeObj, GuardToType, Validator } from '../guards';
8
8
  * Creates a validator which tests if the target is a string
9
9
  * and is one of the values in the specified enum (object).
10
10
  */
11
- export declare function stringEnumValidator<T>(enumMap: T): (x: unknown) => x is T[keyof T];
11
+ export declare function stringEnumValidator<T>(enumMap: T): (x: unknown) => x is {} extends T ? never : T[keyof T];
12
12
  /**
13
13
  * Creates a validator which tests if the target is a value in the specified enum.
14
14
  * Note that numbers in enums are reverse-mapped by the TS transpiler, so the specified keys are also values.
15
15
  */
16
- export declare function enumValidator<T>(enumMap: T): (x: unknown) => x is T[keyof T];
16
+ export declare function enumValidator<T>(enumMap: T): (x: unknown) => x is {} extends T ? never : T[keyof T];
17
17
  /**
18
18
  * Creates a validator which tests if the target is a number
19
19
  * and is equal to or between the min and max values.