@es-joy/jsoe 0.3.0 → 0.4.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.
- package/.eslintignore +3 -0
- package/.eslintrc.cjs +1 -0
- package/.ncurc.cjs +9 -0
- package/CHANGES.md +4 -0
- package/demo/index.html +8 -0
- package/demo/index.js +1 -1
- package/dist/formatAndTypeChoices.d.ts +56 -0
- package/dist/formatAndTypeChoices.d.ts.map +1 -0
- package/dist/formats/indexedDBKey.d.ts +4 -0
- package/dist/formats/indexedDBKey.d.ts.map +1 -0
- package/dist/formats/json.d.ts +4 -0
- package/dist/formats/json.d.ts.map +1 -0
- package/dist/formats/schemaAndArbitrary.d.ts +6 -0
- package/dist/formats/schemaAndArbitrary.d.ts.map +1 -0
- package/dist/formats/schemaOnly.d.ts +6 -0
- package/dist/formats/schemaOnly.d.ts.map +1 -0
- package/dist/formats/structuredCloning.d.ts +20 -0
- package/dist/formats/structuredCloning.d.ts.map +1 -0
- package/dist/formats.d.ts +26 -0
- package/dist/formats.d.ts.map +1 -0
- package/dist/fundamentalTypes/BooleanObjectType.d.ts +8 -0
- package/dist/fundamentalTypes/BooleanObjectType.d.ts.map +1 -0
- package/dist/fundamentalTypes/NumberObjectType.d.ts +6 -0
- package/dist/fundamentalTypes/NumberObjectType.d.ts.map +1 -0
- package/dist/fundamentalTypes/StringObjectType.d.ts +6 -0
- package/dist/fundamentalTypes/StringObjectType.d.ts.map +1 -0
- package/dist/fundamentalTypes/arrayReferenceType.d.ts +8 -0
- package/dist/fundamentalTypes/arrayReferenceType.d.ts.map +1 -0
- package/dist/fundamentalTypes/arrayType.d.ts +60 -0
- package/dist/fundamentalTypes/arrayType.d.ts.map +1 -0
- package/dist/fundamentalTypes/bigintType.d.ts +6 -0
- package/dist/fundamentalTypes/bigintType.d.ts.map +1 -0
- package/dist/fundamentalTypes/dateType.d.ts +26 -0
- package/dist/fundamentalTypes/dateType.d.ts.map +1 -0
- package/dist/fundamentalTypes/nullType.d.ts +6 -0
- package/dist/fundamentalTypes/nullType.d.ts.map +1 -0
- package/dist/fundamentalTypes/numberType.d.ts +6 -0
- package/dist/fundamentalTypes/numberType.d.ts.map +1 -0
- package/dist/fundamentalTypes/objectReferenceType.d.ts +8 -0
- package/dist/fundamentalTypes/objectReferenceType.d.ts.map +1 -0
- package/dist/fundamentalTypes/objectType.d.ts +6 -0
- package/dist/fundamentalTypes/objectType.d.ts.map +1 -0
- package/dist/fundamentalTypes/regexpType.d.ts +8 -0
- package/dist/fundamentalTypes/regexpType.d.ts.map +1 -0
- package/dist/fundamentalTypes/sparseUndefinedType.d.ts +6 -0
- package/dist/fundamentalTypes/sparseUndefinedType.d.ts.map +1 -0
- package/dist/fundamentalTypes/stringType.d.ts +6 -0
- package/dist/fundamentalTypes/stringType.d.ts.map +1 -0
- package/dist/fundamentalTypes/undefinedType.d.ts +6 -0
- package/dist/fundamentalTypes/undefinedType.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/src/deepEqual.d.ts +3 -0
- package/dist/src/deepEqual.d.ts.map +1 -0
- package/dist/src/formatAndTypeChoices.d.ts +47 -0
- package/dist/src/formatAndTypeChoices.d.ts.map +1 -0
- package/dist/src/formats/indexedDBKey.d.ts +9 -0
- package/dist/src/formats/indexedDBKey.d.ts.map +1 -0
- package/dist/src/formats/json.d.ts +9 -0
- package/dist/src/formats/json.d.ts.map +1 -0
- package/dist/src/formats/schemaAndArbitrary.d.ts +6 -0
- package/dist/src/formats/schemaAndArbitrary.d.ts.map +1 -0
- package/dist/src/formats/schemaOnly.d.ts +6 -0
- package/dist/src/formats/schemaOnly.d.ts.map +1 -0
- package/dist/src/formats/structuredCloning.d.ts +15 -0
- package/dist/src/formats/structuredCloning.d.ts.map +1 -0
- package/dist/src/formats.d.ts +18 -0
- package/dist/src/formats.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/BooleanObjectType.d.ts +6 -0
- package/dist/src/fundamentalTypes/BooleanObjectType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/NumberObjectType.d.ts +6 -0
- package/dist/src/fundamentalTypes/NumberObjectType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/StringObjectType.d.ts +6 -0
- package/dist/src/fundamentalTypes/StringObjectType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/arrayReferenceType.d.ts +6 -0
- package/dist/src/fundamentalTypes/arrayReferenceType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/arrayType.d.ts +6 -0
- package/dist/src/fundamentalTypes/arrayType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/bigintType.d.ts +6 -0
- package/dist/src/fundamentalTypes/bigintType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/dateType.d.ts +6 -0
- package/dist/src/fundamentalTypes/dateType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/nullType.d.ts +6 -0
- package/dist/src/fundamentalTypes/nullType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/numberType.d.ts +6 -0
- package/dist/src/fundamentalTypes/numberType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/objectReferenceType.d.ts +6 -0
- package/dist/src/fundamentalTypes/objectReferenceType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/objectType.d.ts +6 -0
- package/dist/src/fundamentalTypes/objectType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/regexpType.d.ts +6 -0
- package/dist/src/fundamentalTypes/regexpType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/sparseUndefinedType.d.ts +6 -0
- package/dist/src/fundamentalTypes/sparseUndefinedType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/stringType.d.ts +6 -0
- package/dist/src/fundamentalTypes/stringType.d.ts.map +1 -0
- package/dist/src/fundamentalTypes/undefinedType.d.ts +6 -0
- package/dist/src/fundamentalTypes/undefinedType.d.ts.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/subTypes/blobHTMLType.d.ts +26 -0
- package/dist/src/subTypes/blobHTMLType.d.ts.map +1 -0
- package/dist/src/subTypes/falseType.d.ts +6 -0
- package/dist/src/subTypes/falseType.d.ts.map +1 -0
- package/dist/src/subTypes/trueType.d.ts +6 -0
- package/dist/src/subTypes/trueType.d.ts.map +1 -0
- package/dist/src/superTypes/SpecialNumberSuperType.d.ts +11 -0
- package/dist/src/superTypes/SpecialNumberSuperType.d.ts.map +1 -0
- package/dist/src/superTypes/SpecialRealNumberSuperType.d.ts +6 -0
- package/dist/src/superTypes/SpecialRealNumberSuperType.d.ts.map +1 -0
- package/dist/src/typeChoices.d.ts +30 -0
- package/dist/src/typeChoices.d.ts.map +1 -0
- package/dist/src/types.d.ts +333 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/utils/dialogs.d.ts +29 -0
- package/dist/src/utils/dialogs.d.ts.map +1 -0
- package/dist/src/utils/jsonPointer.d.ts +42 -0
- package/dist/src/utils/jsonPointer.d.ts.map +1 -0
- package/dist/src/utils/templateUtils.d.ts +59 -0
- package/dist/src/utils/templateUtils.d.ts.map +1 -0
- package/dist/src/utils/types.d.ts +2 -0
- package/dist/src/utils/types.d.ts.map +1 -0
- package/dist/subTypes/blobHTMLType.d.ts +14 -0
- package/dist/subTypes/blobHTMLType.d.ts.map +1 -0
- package/dist/subTypes/falseType.d.ts +8 -0
- package/dist/subTypes/falseType.d.ts.map +1 -0
- package/dist/subTypes/trueType.d.ts +8 -0
- package/dist/subTypes/trueType.d.ts.map +1 -0
- package/dist/superTypes/SpecialNumberSuperType.d.ts +14 -0
- package/dist/superTypes/SpecialNumberSuperType.d.ts.map +1 -0
- package/dist/superTypes/SpecialRealNumberSuperType.d.ts +6 -0
- package/dist/superTypes/SpecialRealNumberSuperType.d.ts.map +1 -0
- package/dist/typeChoices.d.ts +103 -0
- package/dist/typeChoices.d.ts.map +1 -0
- package/dist/types.d.ts +523 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/dialogs.d.ts +109 -0
- package/dist/utils/dialogs.d.ts.map +1 -0
- package/dist/utils/jsonPointer.d.ts +46 -0
- package/dist/utils/jsonPointer.d.ts.map +1 -0
- package/dist/utils/templateUtils.d.ts +59 -0
- package/dist/utils/templateUtils.d.ts.map +1 -0
- package/dist/utils/types.d.ts +2 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/vendor/jamilih/dist/jml-es.d.ts +436 -0
- package/dist/vendor/jamilih/dist/jml-es.d.ts.map +1 -0
- package/dist/vendor/typeson-registry/dist/index.d.ts +400 -0
- package/dist/vendor/typeson-registry/dist/index.d.ts.map +1 -0
- package/dist/vendor-imports.d.ts +3 -0
- package/dist/vendor-imports.d.ts.map +1 -0
- package/package.json +16 -11
- package/postorder-traversal.js +58 -0
- package/src/formatAndTypeChoices.js +95 -50
- package/src/formats/indexedDBKey.js +49 -57
- package/src/formats/json.js +47 -56
- package/src/formats/schemaOnly.js +12 -2
- package/src/formats/structuredCloning.js +162 -105
- package/src/formats.js +38 -10
- package/src/fundamentalTypes/BooleanObjectType.js +6 -4
- package/src/fundamentalTypes/NumberObjectType.js +5 -3
- package/src/fundamentalTypes/StringObjectType.js +1 -1
- package/src/fundamentalTypes/arrayReferenceType.js +29 -14
- package/src/fundamentalTypes/arrayType.js +789 -278
- package/src/fundamentalTypes/bigintType.js +2 -2
- package/src/fundamentalTypes/dateType.js +42 -14
- package/src/fundamentalTypes/nullType.js +1 -1
- package/src/fundamentalTypes/numberType.js +2 -2
- package/src/fundamentalTypes/objectReferenceType.js +7 -5
- package/src/fundamentalTypes/regexpType.js +45 -24
- package/src/fundamentalTypes/sparseUndefinedType.js +7 -1
- package/src/fundamentalTypes/stringType.js +1 -1
- package/src/fundamentalTypes/undefinedType.js +2 -2
- package/src/subTypes/blobHTMLType.js +42 -22
- package/src/subTypes/falseType.js +2 -2
- package/src/subTypes/trueType.js +2 -2
- package/src/superTypes/SpecialNumberSuperType.js +13 -6
- package/src/superTypes/SpecialRealNumberSuperType.js +11 -5
- package/src/typeChoices.js +137 -55
- package/src/types.js +309 -146
- package/src/utils/dialogs.js +98 -29
- package/src/utils/jsonPointer.js +4 -0
- package/src/utils/templateUtils.js +27 -12
- package/src/vendor-imports.js +8 -0
- package/tsconfig.json +18 -0
- package/typings/sceditor.d.ts +20 -0
- package/vendor/jamilih/dist/jml-es.js +1019 -389
- package/vendor/jamilih/dist/jml.d.ts +436 -0
- package/vendor/jamilih/package.json +136 -0
- package/vendor/typeson-registry/dist/index.js +365 -83
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {"indexedDBKey"|"json"|"structuredCloning"} format
|
|
3
|
+
* @param {StructuredCloneValue} record
|
|
4
|
+
* @param {import('./types.js').StateObject} stateObj
|
|
5
|
+
*/
|
|
6
|
+
export function getControlsForFormatAndValue(format: "indexedDBKey" | "json" | "structuredCloning", record: StructuredCloneValue, stateObj: import('./types.js').StateObject): Promise<Element>;
|
|
7
|
+
export default Formats;
|
|
8
|
+
declare namespace Formats {
|
|
9
|
+
namespace availableFormats {
|
|
10
|
+
export { indexedDBKey };
|
|
11
|
+
export { json };
|
|
12
|
+
export { structuredCloning };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
import * as indexedDBKey from './formats/indexedDBKey.js';
|
|
16
|
+
import * as json from './formats/json.js';
|
|
17
|
+
import * as structuredCloning from './formats/structuredCloning.js';
|
|
18
|
+
//# sourceMappingURL=formats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/formats.js"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,qDAJW,cAAc,GAAC,MAAM,GAAC,mBAAmB,0CAEzC,OAAO,YAAY,EAAE,WAAW,oBAQ1C;;;;;;;;;8BAtC6B,2BAA2B;sBACnC,mBAAmB;mCACN,gCAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanObjectType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/BooleanObjectType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,iCAFU,OAAO,aAAa,EAAE,UAAU,CAiDxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberObjectType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/NumberObjectType.js"],"names":[],"mappings":";AAGA;;GAEG;AACH,gCAFU,OAAO,aAAa,EAAE,UAAU,CAkCxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringObjectType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/StringObjectType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,gCAFU,OAAO,aAAa,EAAE,UAAU,CA+BxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayReferenceType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/arrayReferenceType.js"],"names":[],"mappings":";AAMA;;GAEG;AACH,kCAFU,OAAO,aAAa,EAAE,UAAU,CAiMxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/arrayType.js"],"names":[],"mappings":";AASA;;GAEG;AACH,yBAFU,OAAO,aAAa,EAAE,UAAU,CAq3BxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bigintType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/bigintType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,0BAFU,OAAO,aAAa,EAAE,UAAU,CA+CxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/dateType.js"],"names":[],"mappings":";AAIA;;GAEG;AACH,wBAFU,OAAO,aAAa,EAAE,UAAU,CAyHxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/nullType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,wBAFU,OAAO,aAAa,EAAE,UAAU,CA2BxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/numberType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,0BAFU,OAAO,aAAa,EAAE,UAAU,CAkDxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectReferenceType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/objectReferenceType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,mCAFU,OAAO,aAAa,EAAE,UAAU,CA6CxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/objectType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,0BAFU,OAAO,aAAa,EAAE,UAAU,CAwBxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexpType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/regexpType.js"],"names":[],"mappings":";AAIA;;GAEG;AACH,0BAFU,OAAO,aAAa,EAAE,UAAU,CAuFxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparseUndefinedType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/sparseUndefinedType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,mCAFU,OAAO,aAAa,EAAE,UAAU,CAqCxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/stringType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,0BAFU,OAAO,aAAa,EAAE,UAAU,CAyBxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undefinedType.d.ts","sourceRoot":"","sources":["../../../src/fundamentalTypes/undefinedType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,6BAFU,OAAO,aAAa,EAAE,UAAU,CA+BxC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Types } from "./types.js";
|
|
2
|
+
export { buildTypeChoices as typeChoices } from "./typeChoices.js";
|
|
3
|
+
export { default as Formats, getControlsForFormatAndValue } from "./formats.js";
|
|
4
|
+
export { formatAndTypeChoices, getFormatAndSchemaChoices } from "./formatAndTypeChoices.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default blobHTMLType;
|
|
2
|
+
declare namespace blobHTMLType {
|
|
3
|
+
const option: string[];
|
|
4
|
+
const stringRegex: RegExp;
|
|
5
|
+
function valueMatch(v: any): boolean;
|
|
6
|
+
const superType: string;
|
|
7
|
+
function toValue(s: any): {
|
|
8
|
+
value: Blob;
|
|
9
|
+
};
|
|
10
|
+
function getInput({ root }: {
|
|
11
|
+
root: any;
|
|
12
|
+
}): Element | null;
|
|
13
|
+
function getValue(): Blob;
|
|
14
|
+
function loadBlob(value: any): Promise<any>;
|
|
15
|
+
function setValue({ value }: {
|
|
16
|
+
value: any;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
function viewUI({ value }: {
|
|
19
|
+
value: any;
|
|
20
|
+
}): import("../../vendor/jamilih/dist/jml-es.js").JamilihReturn[];
|
|
21
|
+
function editUI({ typeNamespace, value }: {
|
|
22
|
+
typeNamespace: any;
|
|
23
|
+
value: any;
|
|
24
|
+
}): import("../../vendor/jamilih/dist/jml-es.js").JamilihReturn[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=blobHTMLType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobHTMLType.d.ts","sourceRoot":"","sources":["../../../src/subTypes/blobHTMLType.js"],"names":[],"mappings":";;;;IAWc,qCAA6B;;IAEzC;;MA4BC;IAED;;uBAEC;IACD,0BAKC;IACD,4CAgBC;IACD;;sBAIC;IACD;;sEAgCC;IACD;;;sEAiDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"falseType.d.ts","sourceRoot":"","sources":["../../../src/subTypes/falseType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,yBAFU,OAAO,aAAa,EAAE,UAAU,CAoCxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trueType.d.ts","sourceRoot":"","sources":["../../../src/subTypes/trueType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,wBAFU,OAAO,aAAa,EAAE,UAAU,CAoCxC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default SpecialNumberSuperType;
|
|
2
|
+
export type SuperTypeObject = TypeObject;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {TypeObject} SuperTypeObject
|
|
5
|
+
* @property {string[]} childTypes
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @type {SuperTypeObject}
|
|
9
|
+
*/
|
|
10
|
+
declare const SpecialNumberSuperType: TypeObject;
|
|
11
|
+
//# sourceMappingURL=SpecialNumberSuperType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpecialNumberSuperType.d.ts","sourceRoot":"","sources":["../../../src/superTypes/SpecialNumberSuperType.js"],"names":[],"mappings":";;AAEA;;;GAGG;AAEH;;GAEG;AACH,iDAwDE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpecialRealNumberSuperType.d.ts","sourceRoot":"","sources":["../../../src/superTypes/SpecialRealNumberSuperType.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,0DAgDE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An arbitrary Structured Clone, JSON, etc. value.
|
|
3
|
+
* @typedef {any} StructuredCloneValue
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @callback BuildTypeChoices
|
|
7
|
+
* @param {object} cfg
|
|
8
|
+
* @param {string} cfg.format
|
|
9
|
+
* @param {string} cfg.typeNamespace
|
|
10
|
+
* @param {StructuredCloneValue} cfg.value
|
|
11
|
+
* @param {boolean} [cfg.setValue=false]
|
|
12
|
+
* @param {string} cfg.state
|
|
13
|
+
* @param {string} cfg.keySelectClass
|
|
14
|
+
* @param {boolean} cfg.requireObject
|
|
15
|
+
* @param {boolean} cfg.objectHasValue
|
|
16
|
+
* @param {RootElement} cfg.topRoot Always a `div` element?
|
|
17
|
+
* @param {string} cfg.schema Schema name
|
|
18
|
+
* @param {string} cfg.schemaContent Schema contents
|
|
19
|
+
* @returns {[select: Element, typeContainer: Element]}
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @type {BuildTypeChoices}
|
|
23
|
+
*/
|
|
24
|
+
export const buildTypeChoices: BuildTypeChoices;
|
|
25
|
+
/**
|
|
26
|
+
* An arbitrary Structured Clone, JSON, etc. value.
|
|
27
|
+
*/
|
|
28
|
+
export type StructuredCloneValue = any;
|
|
29
|
+
export type BuildTypeChoices = (cfg: object, format: string, typeNamespace: string, value: StructuredCloneValue, setValue?: boolean | undefined, state: string, keySelectClass: string, requireObject: boolean, objectHasValue: boolean, topRoot: RootElement, schema: string, schemaContent: string) => [select: Element, typeContainer: Element];
|
|
30
|
+
//# sourceMappingURL=typeChoices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeChoices.d.ts","sourceRoot":"","sources":["../../src/typeChoices.js"],"names":[],"mappings":"AAOA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,+BAFU,gBAAgB,CA0NxB;;;;mCA/OW,GAAG;qCAKL,MAAM,UACN,MAAM,iBACN,MAAM,SACN,oBAAoB,yCAEpB,MAAM,kBACN,MAAM,iBACN,OAAO,kBACP,OAAO,gCAEP,MAAM,iBACN,MAAM,KACJ,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
export function getPropertyValueFromLegend(legend: HTMLLegendElement): string;
|
|
2
|
+
export default Types;
|
|
3
|
+
export type TypeObject = {
|
|
4
|
+
/**
|
|
5
|
+
* Creates the option
|
|
6
|
+
* HTML. May set an option `title` or `value`
|
|
7
|
+
*/
|
|
8
|
+
option: import('jamilih').JamilihArray;
|
|
9
|
+
/**
|
|
10
|
+
* Private context variable. Whether or not
|
|
11
|
+
* it is an array. Do not use in other types.
|
|
12
|
+
*/
|
|
13
|
+
array?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Used for string parsing.
|
|
16
|
+
*/
|
|
17
|
+
regexEndings?: string[] | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Used for string parsing. If not
|
|
20
|
+
* present, use `stringRegexBegin` and `stringRegexEnd`
|
|
21
|
+
*/
|
|
22
|
+
stringRegex?: RegExp | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Used for string parsing. If not
|
|
25
|
+
* present, use `stringRegex`
|
|
26
|
+
*/
|
|
27
|
+
stringRegexBegin?: RegExp | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Used for string parsing. If not
|
|
30
|
+
* present, use `stringRegex`
|
|
31
|
+
*/
|
|
32
|
+
stringRegexEnd?: RegExp | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Function to
|
|
35
|
+
* check whether this subtype matches
|
|
36
|
+
*/
|
|
37
|
+
valueMatch?: ((ArbitraryValue: any) => boolean) | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The greater fundamental type to which
|
|
40
|
+
* the type belongs
|
|
41
|
+
*/
|
|
42
|
+
superType?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Converts from
|
|
45
|
+
* string to value. May use `stringRegex` to find components.
|
|
46
|
+
*/
|
|
47
|
+
toValue: (s: string) => ArbitraryValue;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the value for the type
|
|
50
|
+
*/
|
|
51
|
+
getValue: (info: {
|
|
52
|
+
root?: HTMLDivElement;
|
|
53
|
+
}) => ArbitraryValue;
|
|
54
|
+
/**
|
|
55
|
+
* Should set
|
|
56
|
+
* the value of the form's `getInput` element
|
|
57
|
+
*/
|
|
58
|
+
setValue?: ((info: {
|
|
59
|
+
root?: HTMLDivElement;
|
|
60
|
+
}) => void) | undefined;
|
|
61
|
+
viewUI: (info: {
|
|
62
|
+
value?: ArbitraryValue;
|
|
63
|
+
typeNamespace?: string;
|
|
64
|
+
type?: string;
|
|
65
|
+
topRoot?: HTMLDivElement;
|
|
66
|
+
resultType?: "keys" | "values" | "both";
|
|
67
|
+
format?: string;
|
|
68
|
+
}) => JamilihArray;
|
|
69
|
+
editUI: (info: {
|
|
70
|
+
value?: ArbitraryValue;
|
|
71
|
+
typeNamespace?: string;
|
|
72
|
+
}) => JamilihArray;
|
|
73
|
+
/**
|
|
74
|
+
* Gets the
|
|
75
|
+
* form control (with `value`)
|
|
76
|
+
*/
|
|
77
|
+
getInput: (info: {
|
|
78
|
+
root: HTMLDivElement;
|
|
79
|
+
}) => HTMLInputElement | HTMLTextareaElement | HTMLSelectElement;
|
|
80
|
+
/**
|
|
81
|
+
* Gets the reference. For array and object
|
|
82
|
+
* references types only
|
|
83
|
+
*/
|
|
84
|
+
resolveReference?: ((path: string, value: ArbitraryValue) => ArbitraryValue) | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Message will be used if validity is false.
|
|
87
|
+
*/
|
|
88
|
+
validate?: ((info: {
|
|
89
|
+
root: HTMLDivElement;
|
|
90
|
+
topRoot?: HTMLDivElement;
|
|
91
|
+
}) => {
|
|
92
|
+
message: string;
|
|
93
|
+
valid: boolean;
|
|
94
|
+
}) | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* For
|
|
97
|
+
* validation of array and object references only.
|
|
98
|
+
*/
|
|
99
|
+
validateAll?: ((info: {
|
|
100
|
+
topRoot: HTMLDivElement;
|
|
101
|
+
}) => void) | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* The type after which it should be placed and its
|
|
104
|
+
* context types
|
|
105
|
+
*/
|
|
106
|
+
stateDependent?: {
|
|
107
|
+
structuredCloning: {
|
|
108
|
+
after: string;
|
|
109
|
+
contexts: string[];
|
|
110
|
+
};
|
|
111
|
+
} | undefined;
|
|
112
|
+
};
|
|
113
|
+
export type GetPossibleSchemasForPathAndType = (keypath: string, parentPath: string, arrayOrObjectPropertyName: string, valueType: string) => StateObject;
|
|
114
|
+
export type StateObject = {
|
|
115
|
+
typeNamespace: string;
|
|
116
|
+
"readonly": boolean;
|
|
117
|
+
format: string;
|
|
118
|
+
error: Error;
|
|
119
|
+
rootUI: Element;
|
|
120
|
+
schemaContent: string;
|
|
121
|
+
getPossibleSchemasForPathAndType: GetPossibleSchemasForPathAndType;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Any other possibilities than `div`?
|
|
125
|
+
*/
|
|
126
|
+
export type RootElement = HTMLDivElement;
|
|
127
|
+
declare namespace Types {
|
|
128
|
+
namespace availableTypes {
|
|
129
|
+
namespace ValidDate {
|
|
130
|
+
const valid: boolean;
|
|
131
|
+
}
|
|
132
|
+
namespace arrayNonindexKeys {
|
|
133
|
+
const sparse: boolean;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Utility to retrieve the type out of a type root element.
|
|
138
|
+
* @public
|
|
139
|
+
* @param {?RootElement} root
|
|
140
|
+
* @returns {string|undefined} Why would it not exist?
|
|
141
|
+
*/
|
|
142
|
+
function getTypeForRoot(root: HTMLDivElement | null): string | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* @typedef {(
|
|
145
|
+
* keypath: string,
|
|
146
|
+
* parentPath: string,
|
|
147
|
+
* arrayOrObjectPropertyName: string,
|
|
148
|
+
* valueType: string
|
|
149
|
+
* ) => StateObject} GetPossibleSchemasForPathAndType
|
|
150
|
+
*/
|
|
151
|
+
/**
|
|
152
|
+
* @typedef {{
|
|
153
|
+
* typeNamespace: string,
|
|
154
|
+
* "readonly": boolean,
|
|
155
|
+
* format: string,
|
|
156
|
+
* error: Error,
|
|
157
|
+
* rootUI: Element,
|
|
158
|
+
* schemaContent: string,
|
|
159
|
+
* getPossibleSchemasForPathAndType: GetPossibleSchemasForPathAndType
|
|
160
|
+
* }} StateObject
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* Utility to get the value out of a type root element with a given
|
|
164
|
+
* state and path.
|
|
165
|
+
* @public
|
|
166
|
+
* @param {RootElement} root
|
|
167
|
+
* @param {StateObject} stateObj
|
|
168
|
+
* @param {string} [currentPath]
|
|
169
|
+
* @returns {StructuredCloneValue}
|
|
170
|
+
*/
|
|
171
|
+
function getValueForRoot(root: HTMLDivElement, stateObj: StateObject, currentPath?: string | undefined): StructuredCloneValue;
|
|
172
|
+
/**
|
|
173
|
+
* Utility to get the form control (e.g., input element) for a root.
|
|
174
|
+
* @public
|
|
175
|
+
* @param {RootElement} root
|
|
176
|
+
* @returns {null|HTMLInputElement}
|
|
177
|
+
*/
|
|
178
|
+
function getFormControlForRoot(root: HTMLDivElement): HTMLInputElement | null;
|
|
179
|
+
/**
|
|
180
|
+
* Utility to get the value for a root using its ancestor and state.
|
|
181
|
+
* @public
|
|
182
|
+
* @param {string|Element} selOrEl
|
|
183
|
+
* @param {StateObject} stateObj
|
|
184
|
+
* @returns {StructuredCloneValue}
|
|
185
|
+
*/
|
|
186
|
+
function getValueFromRootAncestor(selOrEl: string | Element, stateObj: StateObject): StructuredCloneValue;
|
|
187
|
+
/**
|
|
188
|
+
* @public
|
|
189
|
+
* @param {string|Element} selOrEl
|
|
190
|
+
* @returns {null|HTMLInputElement}
|
|
191
|
+
*/
|
|
192
|
+
function getFormControlFromRootAncestor(selOrEl: string | Element): HTMLInputElement | null;
|
|
193
|
+
/**
|
|
194
|
+
* @param {string} format
|
|
195
|
+
* @param {string} state
|
|
196
|
+
* @returns {string[]}
|
|
197
|
+
*/
|
|
198
|
+
function getTypesForFormatAndState(format: string, state: string): string[];
|
|
199
|
+
/**
|
|
200
|
+
* @public
|
|
201
|
+
* @param {string} type
|
|
202
|
+
* @returns {JamilihArray}
|
|
203
|
+
*/
|
|
204
|
+
function getOptionForType(type: string): JamilihArray;
|
|
205
|
+
/**
|
|
206
|
+
* @public
|
|
207
|
+
* @param {string} format
|
|
208
|
+
* @param {string} parserState
|
|
209
|
+
* @returns {JamilihArray[]}
|
|
210
|
+
*/
|
|
211
|
+
function getTypeOptionsForFormatAndState(format: string, parserState: string): JamilihArray[];
|
|
212
|
+
/**
|
|
213
|
+
* @public
|
|
214
|
+
* @param {object} cfg
|
|
215
|
+
* @param {boolean} cfg."readonly"
|
|
216
|
+
* @param {"both"|"keys"|"values"} cfg.resultType
|
|
217
|
+
* @param {string} cfg.typeNamespace
|
|
218
|
+
* @param {string} cfg.type
|
|
219
|
+
* @param {RootElement} cfg.topRoot
|
|
220
|
+
* @param {boolean} cfg.bringIntoFocus
|
|
221
|
+
* @param {BuildTypeChoices} cfg.buildTypeChoices
|
|
222
|
+
* @param {string} cfg.format
|
|
223
|
+
* @param {string} cfg.schemaContent
|
|
224
|
+
* @param {GetPossibleSchemasForPathAndType} cfg.schemaState Not currently
|
|
225
|
+
* in use
|
|
226
|
+
* @param {StructuredCloneValue} cfg.value
|
|
227
|
+
* @param {boolean} cfg.hasValue
|
|
228
|
+
* @returns {Element}
|
|
229
|
+
*/
|
|
230
|
+
function getUIForModeAndType({ readonly, resultType, typeNamespace, type, topRoot, bringIntoFocus, buildTypeChoices, format, schemaContent, schemaState, value, hasValue }: {
|
|
231
|
+
"": boolean;
|
|
232
|
+
resultType: "keys" | "values" | "both";
|
|
233
|
+
typeNamespace: string;
|
|
234
|
+
type: string;
|
|
235
|
+
topRoot: HTMLDivElement;
|
|
236
|
+
bringIntoFocus: boolean;
|
|
237
|
+
buildTypeChoices: BuildTypeChoices;
|
|
238
|
+
format: string;
|
|
239
|
+
schemaContent: string;
|
|
240
|
+
schemaState: GetPossibleSchemasForPathAndType;
|
|
241
|
+
value: StructuredCloneValue;
|
|
242
|
+
hasValue: boolean;
|
|
243
|
+
}): Element;
|
|
244
|
+
const contexts: {};
|
|
245
|
+
/**
|
|
246
|
+
* @public
|
|
247
|
+
* @param {object} cfg
|
|
248
|
+
* @param {HTMLFormElement} cfg.form
|
|
249
|
+
* @param {string} cfg.typeNamespace
|
|
250
|
+
* @param {string} cfg.keySelectClass
|
|
251
|
+
* @returns {boolean}
|
|
252
|
+
*/
|
|
253
|
+
function validValuesSet({ form, typeNamespace, keySelectClass }: {
|
|
254
|
+
form: HTMLFormElement;
|
|
255
|
+
typeNamespace: string;
|
|
256
|
+
keySelectClass: string;
|
|
257
|
+
}): boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Any other possibilities than `div`?
|
|
260
|
+
* @typedef {HTMLDivElement} RootElement
|
|
261
|
+
*/
|
|
262
|
+
/**
|
|
263
|
+
* @public
|
|
264
|
+
* @param {object} cfg
|
|
265
|
+
* @param {RootElement} cfg.topRoot
|
|
266
|
+
* @returns {void}
|
|
267
|
+
*/
|
|
268
|
+
function validateAllReferences({ topRoot }: {
|
|
269
|
+
topRoot: HTMLDivElement;
|
|
270
|
+
}): void;
|
|
271
|
+
/**
|
|
272
|
+
* @public
|
|
273
|
+
* @param {object} cfg
|
|
274
|
+
* @param {string} cfg.type
|
|
275
|
+
* @param {RootElement} cfg.root
|
|
276
|
+
* @param {RootElement} cfg.topRoot
|
|
277
|
+
* @returns {boolean}
|
|
278
|
+
*/
|
|
279
|
+
function validate({ type, root, topRoot }: {
|
|
280
|
+
type: string;
|
|
281
|
+
root: HTMLDivElement;
|
|
282
|
+
topRoot: HTMLDivElement;
|
|
283
|
+
}): boolean;
|
|
284
|
+
/**
|
|
285
|
+
* @param {object} cfg
|
|
286
|
+
* @param {string} cfg.type
|
|
287
|
+
* @param {RootElement} cfg.root
|
|
288
|
+
* @param {StructuredCloneValue} cfg.value
|
|
289
|
+
* @returns {void}
|
|
290
|
+
*/
|
|
291
|
+
function setValue({ type, root, value }: {
|
|
292
|
+
type: string;
|
|
293
|
+
root: HTMLDivElement;
|
|
294
|
+
value: StructuredCloneValue;
|
|
295
|
+
}): void;
|
|
296
|
+
/**
|
|
297
|
+
* @public
|
|
298
|
+
* @param {string} s
|
|
299
|
+
* @param {object} cfg
|
|
300
|
+
* @param {string} cfg.format
|
|
301
|
+
* @param {string} cfg.state
|
|
302
|
+
* @param {TypeObject[]} [cfg.endMatchTypeObjs=[]]
|
|
303
|
+
* @param {boolean} [cfg.firstRun=true]
|
|
304
|
+
* @param {
|
|
305
|
+
* [
|
|
306
|
+
* type: string,
|
|
307
|
+
* parent: array|object,
|
|
308
|
+
* parentPath: string,
|
|
309
|
+
* path: string
|
|
310
|
+
* ]
|
|
311
|
+
* } [cfg.rootHolder=[]]
|
|
312
|
+
* @param {ArbitraryArray|ArbitraryObject} cfg.parent
|
|
313
|
+
* @param {string} cfg.parentPath
|
|
314
|
+
* @returns {{
|
|
315
|
+
* value: ArbitraryValue,
|
|
316
|
+
* remnant: string,
|
|
317
|
+
* beginOnly: boolean,
|
|
318
|
+
* assign: boolean
|
|
319
|
+
* }}
|
|
320
|
+
*/
|
|
321
|
+
function getValueForString(s: string, { format, state, endMatchTypeObjs, firstRun, rootHolder, parent, parentPath }: {
|
|
322
|
+
format: string;
|
|
323
|
+
state: string;
|
|
324
|
+
endMatchTypeObjs?: TypeObject[] | undefined;
|
|
325
|
+
firstRun?: boolean | undefined;
|
|
326
|
+
}): {
|
|
327
|
+
value: ArbitraryValue;
|
|
328
|
+
remnant: string;
|
|
329
|
+
beginOnly: boolean;
|
|
330
|
+
assign: boolean;
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=types.d.ts.map
|