lucid-extension-sdk 0.0.371 → 0.0.373

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/core/checks.d.ts CHANGED
@@ -117,6 +117,13 @@ export declare function isArray(val: unknown): val is unknown[];
117
117
  * @return Whether variable is an array of the given type.
118
118
  */
119
119
  export declare function isTypedArray<T>(typeGuard: (a: unknown) => a is T): (val: unknown) => val is T[];
120
+ /**
121
+ * Returns true if the specified value is an array and every element is defined and not null.
122
+ *
123
+ * @param val Variable to test.
124
+ * @returns Whether variable is an array of defined and not null elements.
125
+ */
126
+ export declare function isDefinedArray<T>(val: (T | undefined | null)[]): val is T[];
120
127
  /**
121
128
  * Returns true if the specified value is a map.
122
129
  *
package/core/checks.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isInstanceOf = exports.isLiteral = exports.isPromise = exports.isUnknown = exports.isAny = exports.isEmptyOrNullishObject = exports.isPair = exports.isAtLeastLength = exports.isExactLength = exports.isMap = exports.isTypedArray = exports.isArray = exports.isRecord = exports.isObjectUnsafer = exports.isObjectUnsafe = exports.isObject = exports.isFunction = exports.isInfinite = exports.isInt = exports.isNumber = exports.isBoolean = exports.isString = exports.isNullish = exports.isDefAndNotNull = exports.isVoid = exports.isUndefined = exports.isNull = exports.isDef = void 0;
3
+ exports.isInstanceOf = exports.isLiteral = exports.isPromise = exports.isUnknown = exports.isAny = exports.isEmptyOrNullishObject = exports.isPair = exports.isAtLeastLength = exports.isExactLength = exports.isMap = exports.isDefinedArray = exports.isTypedArray = exports.isArray = exports.isRecord = exports.isObjectUnsafer = exports.isObjectUnsafe = exports.isObject = exports.isFunction = exports.isInfinite = exports.isInt = exports.isNumber = exports.isBoolean = exports.isString = exports.isNullish = exports.isDefAndNotNull = exports.isVoid = exports.isUndefined = exports.isNull = exports.isDef = void 0;
4
4
  /**
5
5
  * Returns true if the specified value is not undefined.
6
6
  *
@@ -177,6 +177,16 @@ function isTypedArray(typeGuard) {
177
177
  };
178
178
  }
179
179
  exports.isTypedArray = isTypedArray;
180
+ /**
181
+ * Returns true if the specified value is an array and every element is defined and not null.
182
+ *
183
+ * @param val Variable to test.
184
+ * @returns Whether variable is an array of defined and not null elements.
185
+ */
186
+ function isDefinedArray(val) {
187
+ return isArray(val) && val.every(isDefAndNotNull);
188
+ }
189
+ exports.isDefinedArray = isDefinedArray;
180
190
  /**
181
191
  * Returns true if the specified value is a map.
182
192
  *
@@ -31,6 +31,12 @@ export declare class CollectionProxy extends PropertyStoreProxy {
31
31
  * is not a branch
32
32
  */
33
33
  getBranchedFrom(): CollectionProxy | undefined;
34
+ /**
35
+ * Certain collections, such as metadata collections, may be hidden from the data panel with the `hideFromDataPanel`
36
+ * argument of `CollectionPatch`. This method identifies whether this collection has been hidden from the data panel
37
+ * via this mechanism.
38
+ */
39
+ isHiddenFromDataPanel(): boolean;
34
40
  /**
35
41
  * @returns information about any changes made locally to the collection that have not been synchronized
36
42
  * with the external data source.
@@ -53,6 +53,16 @@ class CollectionProxy extends propertystoreproxy_1.PropertyStoreProxy {
53
53
  const id = this.properties.get('BranchedFrom');
54
54
  return id ? new CollectionProxy(id, this.client) : undefined;
55
55
  }
56
+ /**
57
+ * Certain collections, such as metadata collections, may be hidden from the data panel with the `hideFromDataPanel`
58
+ * argument of `CollectionPatch`. This method identifies whether this collection has been hidden from the data panel
59
+ * via this mechanism.
60
+ */
61
+ isHiddenFromDataPanel() {
62
+ var _a;
63
+ const isHiddenFromDataPanel = (_a = this.getBranchedFrom()) === null || _a === void 0 ? void 0 : _a.properties.get('IsHiddenFromDataPanel');
64
+ return !!isHiddenFromDataPanel;
65
+ }
56
66
  /**
57
67
  * @returns information about any changes made locally to the collection that have not been synchronized
58
68
  * with the external data source.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.371",
3
+ "version": "0.0.373",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",