lucid-package 0.0.78 → 0.0.79
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 +1 -1
- package/src/editorextension.js +1 -0
- package/src/packagemanifest.d.ts +2 -0
- package/src/packagemanifest.js +10 -0
package/package.json
CHANGED
package/src/editorextension.js
CHANGED
package/src/packagemanifest.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JsonSerializable } from 'lucid-extension-sdk';
|
|
1
2
|
import { SupportedProduct } from './supportedproduct';
|
|
2
3
|
export declare enum SettingType {
|
|
3
4
|
STRING = "string"
|
|
@@ -45,6 +46,7 @@ export type PackageManifest = {
|
|
|
45
46
|
'label': string;
|
|
46
47
|
'description': string;
|
|
47
48
|
'type': SettingType;
|
|
49
|
+
'default'?: JsonSerializable;
|
|
48
50
|
}[];
|
|
49
51
|
'public'?: Record<string, string>;
|
|
50
52
|
};
|
package/src/packagemanifest.js
CHANGED
|
@@ -40,6 +40,16 @@ function validateManifestOrThrow(manifest) {
|
|
|
40
40
|
if (!(0, lucid_extension_sdk_1.enumValidator)(SettingType)(setting['type'])) {
|
|
41
41
|
throw new Error('manifest.json: setting "type" must be "string"');
|
|
42
42
|
}
|
|
43
|
+
if ((0, lucid_extension_sdk_1.isDef)(setting['default'])) {
|
|
44
|
+
if (setting['type'] === SettingType.STRING) {
|
|
45
|
+
if (!(0, lucid_extension_sdk_1.isString)(setting['default'])) {
|
|
46
|
+
throw new Error('manifest.json: setting "default" must be of the type specified for the setting');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
throw new Error('manifest.json: unsupported setting type');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
43
53
|
}
|
|
44
54
|
}
|
|
45
55
|
if (manifest['extensions']) {
|