@es-joy/jsoe 0.4.3 → 0.4.5
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/CHANGES.md +8 -0
- package/dist/types.d.ts +470 -349
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/fundamentalTypes/objectReferenceType.js +10 -10
- package/src/fundamentalTypes/objectType.js +6 -6
- package/src/types.js +171 -141
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
1
|
export function getPropertyValueFromLegend(legend: HTMLLegendElement): string;
|
|
2
2
|
export default Types;
|
|
3
|
+
/**
|
|
4
|
+
* Utility to retrieve the type out of a type root element.
|
|
5
|
+
*/
|
|
6
|
+
export type GetTypeForRoot = (root: RootElement | null) => string | undefined | null;
|
|
7
|
+
/**
|
|
8
|
+
* Utility to get the value out of a type root element with a given
|
|
9
|
+
* state and path.
|
|
10
|
+
*/
|
|
11
|
+
export type GetValueForRoot = (root: RootElement, stateObj?: StateObject | undefined, currentPath?: string | undefined) => StructuredCloneValue;
|
|
12
|
+
/**
|
|
13
|
+
* Utility to get the form control (e.g., input element) for a root.
|
|
14
|
+
*/
|
|
15
|
+
export type GetFormControlForRoot = (root: RootElement) => null | HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement;
|
|
16
|
+
/**
|
|
17
|
+
* Utility to get the value for a root using its ancestor and state.
|
|
18
|
+
*/
|
|
19
|
+
export type GetValueFromRootAncestor = (selOrEl: string | Element, stateObj: StateObject) => StructuredCloneValue;
|
|
20
|
+
export type GetFormControlFromRootAncestor = (selOrEl: string | Element) => null | HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLButtonElement;
|
|
21
|
+
export type GetTypesForFormatAndState = (format: string, state?: string | undefined) => AvailableType[] | undefined;
|
|
22
|
+
export type GetOptionForType = (type: AvailableType) => [string, {
|
|
23
|
+
value: AvailableType;
|
|
24
|
+
title?: string;
|
|
25
|
+
}];
|
|
26
|
+
export type GetTypeOptionsForFormatAndState = (format: string, parserState?: string | undefined) => [string, {
|
|
27
|
+
value: AvailableType;
|
|
28
|
+
title?: string;
|
|
29
|
+
}][];
|
|
30
|
+
export type GetUIForModeAndType = (cfg: {
|
|
31
|
+
readonly?: boolean;
|
|
32
|
+
resultType?: "both" | "keys" | "values";
|
|
33
|
+
typeNamespace?: string;
|
|
34
|
+
type: AvailableType;
|
|
35
|
+
topRoot?: RootElement;
|
|
36
|
+
bringIntoFocus?: boolean | undefined;
|
|
37
|
+
buildTypeChoices?: import('./typeChoices.js').BuildTypeChoices;
|
|
38
|
+
format: import('./formats.js').AvailableFormat;
|
|
39
|
+
schemaContent?: object;
|
|
40
|
+
schemaState?: GetPossibleSchemasForPathAndType;
|
|
41
|
+
value: StructuredCloneValue;
|
|
42
|
+
hasValue: boolean;
|
|
43
|
+
replaced?: StructuredCloneValue;
|
|
44
|
+
}) => Element;
|
|
45
|
+
export type ValidValuesSet = (cfg: {
|
|
46
|
+
form: HTMLFormElement;
|
|
47
|
+
typeNamespace?: string;
|
|
48
|
+
keySelectClass?: string;
|
|
49
|
+
}) => boolean;
|
|
50
|
+
export type ValidateAllReferences = (cfg: {
|
|
51
|
+
topRoot: RootElement;
|
|
52
|
+
}) => void;
|
|
53
|
+
export type Validate = (cfg: {
|
|
54
|
+
type: AvailableType;
|
|
55
|
+
root: RootElement;
|
|
56
|
+
topRoot?: RootElement;
|
|
57
|
+
}) => boolean;
|
|
58
|
+
export type SetValue = (cfg: {
|
|
59
|
+
type: AvailableType;
|
|
60
|
+
root: RootElement;
|
|
61
|
+
value: StructuredCloneValue;
|
|
62
|
+
}) => void;
|
|
63
|
+
export type GetValueForString = (s: string, cfg: {
|
|
64
|
+
format: import('./formats.js').AvailableFormat;
|
|
65
|
+
state: string;
|
|
66
|
+
endMatchTypeObjs?: TypeObject[] | undefined;
|
|
67
|
+
firstRun?: boolean | undefined;
|
|
68
|
+
rootHolder?: [type: string, parent: {
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
}, parentPath: string | number, path: string][] | undefined;
|
|
71
|
+
parent: {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
};
|
|
74
|
+
parentPath: string | number;
|
|
75
|
+
}) => [
|
|
76
|
+
value: StructuredCloneValue,
|
|
77
|
+
remnant: string,
|
|
78
|
+
beginOnly: boolean,
|
|
79
|
+
assign: boolean
|
|
80
|
+
];
|
|
81
|
+
export type CustomValidateAllReferences = (info: {
|
|
82
|
+
topRoot: HTMLDivElement;
|
|
83
|
+
}) => void;
|
|
3
84
|
export type StructuredCloneValue = import('./formats.js').StructuredCloneValue;
|
|
4
85
|
export type JamilihArray = import('jamilih').JamilihArray;
|
|
5
86
|
export type RootInfo = {
|
|
@@ -164,244 +245,388 @@ export type StateObject = {
|
|
|
164
245
|
* Any other possibilities than `div`?
|
|
165
246
|
*/
|
|
166
247
|
export type RootElement = HTMLDivElement;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
248
|
+
/**
|
|
249
|
+
* Utility to retrieve the type out of a type root element.
|
|
250
|
+
* @callback GetTypeForRoot
|
|
251
|
+
* @param {?RootElement} root
|
|
252
|
+
* @returns {string|undefined|null} Why would it not exist?
|
|
253
|
+
*/
|
|
254
|
+
/**
|
|
255
|
+
* Utility to get the value out of a type root element with a given
|
|
256
|
+
* state and path.
|
|
257
|
+
* @callback GetValueForRoot
|
|
258
|
+
* @param {RootElement} root
|
|
259
|
+
* @param {StateObject} [stateObj]
|
|
260
|
+
* @param {string} [currentPath]
|
|
261
|
+
* @returns {StructuredCloneValue}
|
|
262
|
+
*/
|
|
263
|
+
/**
|
|
264
|
+
* Utility to get the form control (e.g., input element) for a root.
|
|
265
|
+
* @callback GetFormControlForRoot
|
|
266
|
+
* @param {RootElement} root
|
|
267
|
+
* @returns {null|
|
|
268
|
+
* HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement|HTMLButtonElement}
|
|
269
|
+
*/
|
|
270
|
+
/**
|
|
271
|
+
* Utility to get the value for a root using its ancestor and state.
|
|
272
|
+
* @callback GetValueFromRootAncestor
|
|
273
|
+
* @param {string|Element} selOrEl
|
|
274
|
+
* @param {StateObject} stateObj
|
|
275
|
+
* @returns {StructuredCloneValue}
|
|
276
|
+
*/
|
|
277
|
+
/**
|
|
278
|
+
* @callback GetFormControlFromRootAncestor
|
|
279
|
+
* @param {string|Element} selOrEl
|
|
280
|
+
* @returns {null|HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement|
|
|
281
|
+
* HTMLButtonElement}
|
|
282
|
+
*/
|
|
283
|
+
/**
|
|
284
|
+
* @callback GetTypesForFormatAndState
|
|
285
|
+
* @param {string} format
|
|
286
|
+
* @param {string} [state]
|
|
287
|
+
* @returns {AvailableType[]|undefined}
|
|
288
|
+
*/
|
|
289
|
+
/**
|
|
290
|
+
* @callback GetOptionForType
|
|
291
|
+
* @param {AvailableType} type
|
|
292
|
+
* @returns {[string, {value: AvailableType, title?: string}]}
|
|
293
|
+
*/
|
|
294
|
+
/**
|
|
295
|
+
* @callback GetTypeOptionsForFormatAndState
|
|
296
|
+
* @param {string} format
|
|
297
|
+
* @param {string} [parserState]
|
|
298
|
+
* @returns {[string, {value: AvailableType, title?: string}][]}
|
|
299
|
+
*/
|
|
300
|
+
/**
|
|
301
|
+
* @typedef {(cfg: {
|
|
302
|
+
* readonly?: boolean,
|
|
303
|
+
* resultType?: "both"|"keys"|"values",
|
|
304
|
+
* typeNamespace?: string,
|
|
305
|
+
* type: AvailableType,
|
|
306
|
+
* topRoot?: RootElement,
|
|
307
|
+
* bringIntoFocus?: boolean|undefined,
|
|
308
|
+
* buildTypeChoices?: import('./typeChoices.js').BuildTypeChoices,
|
|
309
|
+
* format: import('./formats.js').AvailableFormat,
|
|
310
|
+
* schemaContent?: object
|
|
311
|
+
* schemaState?: GetPossibleSchemasForPathAndType,
|
|
312
|
+
* value: StructuredCloneValue,
|
|
313
|
+
* hasValue: boolean,
|
|
314
|
+
* replaced?: StructuredCloneValue,
|
|
315
|
+
* }) => Element} GetUIForModeAndType
|
|
316
|
+
*/
|
|
317
|
+
/**
|
|
318
|
+
* @typedef {(cfg: {
|
|
319
|
+
* form: HTMLFormElement,
|
|
320
|
+
* typeNamespace?: string,
|
|
321
|
+
* keySelectClass?: string,
|
|
322
|
+
* }) => boolean} ValidValuesSet
|
|
323
|
+
*/
|
|
324
|
+
/**
|
|
325
|
+
* @typedef {(cfg: {
|
|
326
|
+
* topRoot: RootElement
|
|
327
|
+
* }) => void} ValidateAllReferences
|
|
328
|
+
*/
|
|
329
|
+
/**
|
|
330
|
+
* @typedef {(cfg: {
|
|
331
|
+
* type: AvailableType,
|
|
332
|
+
* root: RootElement,
|
|
333
|
+
* topRoot?: RootElement
|
|
334
|
+
* }) => boolean} Validate
|
|
335
|
+
*/
|
|
336
|
+
/**
|
|
337
|
+
* @typedef {(cfg: {
|
|
338
|
+
* type: AvailableType,
|
|
339
|
+
* root: RootElement,
|
|
340
|
+
* value: StructuredCloneValue,
|
|
341
|
+
* }) => void} SetValue
|
|
342
|
+
*/
|
|
343
|
+
/**
|
|
344
|
+
* @typedef {(s: string, cfg: {
|
|
345
|
+
* format: import('./formats.js').AvailableFormat,
|
|
346
|
+
* state: string,
|
|
347
|
+
* endMatchTypeObjs?: TypeObject[]
|
|
348
|
+
* firstRun?: boolean,
|
|
349
|
+
* rootHolder?: [
|
|
350
|
+
* type: string,
|
|
351
|
+
* parent: {[key: string]: any},
|
|
352
|
+
* parentPath: string|number,
|
|
353
|
+
* path: string
|
|
354
|
+
* ][],
|
|
355
|
+
* parent: {[key: string]: any},
|
|
356
|
+
* parentPath: string|number
|
|
357
|
+
* }) => [
|
|
358
|
+
* value: StructuredCloneValue,
|
|
359
|
+
* remnant: string,
|
|
360
|
+
* beginOnly: boolean,
|
|
361
|
+
* assign: boolean
|
|
362
|
+
* ]} GetValueForString
|
|
363
|
+
*/
|
|
364
|
+
/**
|
|
365
|
+
* @typedef {(
|
|
366
|
+
* info: {topRoot: HTMLDivElement}
|
|
367
|
+
* ) => void} CustomValidateAllReferences
|
|
368
|
+
*/
|
|
369
|
+
/**
|
|
370
|
+
* @type {{
|
|
371
|
+
* availableTypes: {
|
|
372
|
+
* [key in AvailableType]: Partial<TypeObject>|string[]|
|
|
373
|
+
* {valid: true}|{sparse: true}
|
|
374
|
+
* },
|
|
375
|
+
* getTypeForRoot: GetTypeForRoot,
|
|
376
|
+
* getValueForRoot: GetValueForRoot,
|
|
377
|
+
* getFormControlForRoot: GetFormControlForRoot,
|
|
378
|
+
* getValueFromRootAncestor: GetValueFromRootAncestor,
|
|
379
|
+
* getFormControlFromRootAncestor: GetFormControlFromRootAncestor,
|
|
380
|
+
* getTypesForFormatAndState: GetTypesForFormatAndState,
|
|
381
|
+
* getOptionForType: GetOptionForType,
|
|
382
|
+
* getTypeOptionsForFormatAndState: GetTypeOptionsForFormatAndState,
|
|
383
|
+
* getUIForModeAndType: GetUIForModeAndType,
|
|
384
|
+
* contexts: {
|
|
385
|
+
* [key: string]: {
|
|
386
|
+
* [key: string]: {type: AvailableType, after: AvailableType}[]
|
|
387
|
+
* }
|
|
388
|
+
* },
|
|
389
|
+
* validValuesSet: ValidValuesSet,
|
|
390
|
+
* validateAllReferences: ValidateAllReferences,
|
|
391
|
+
* validate: Validate,
|
|
392
|
+
* setValue: SetValue,
|
|
393
|
+
* getValueForString: GetValueForString,
|
|
394
|
+
* customValidateAllReferences?: CustomValidateAllReferences
|
|
395
|
+
* }}
|
|
396
|
+
*/
|
|
397
|
+
declare const Types: {
|
|
398
|
+
availableTypes: {
|
|
399
|
+
string: string[] | Partial<TypeObject> | {
|
|
400
|
+
valid: true;
|
|
401
|
+
} | {
|
|
402
|
+
sparse: true;
|
|
403
|
+
};
|
|
404
|
+
number: string[] | Partial<TypeObject> | {
|
|
405
|
+
valid: true;
|
|
406
|
+
} | {
|
|
407
|
+
sparse: true;
|
|
408
|
+
};
|
|
409
|
+
bigint: string[] | Partial<TypeObject> | {
|
|
410
|
+
valid: true;
|
|
411
|
+
} | {
|
|
412
|
+
sparse: true;
|
|
413
|
+
};
|
|
414
|
+
object: string[] | Partial<TypeObject> | {
|
|
415
|
+
valid: true;
|
|
416
|
+
} | {
|
|
417
|
+
sparse: true;
|
|
418
|
+
};
|
|
419
|
+
map: string[] | Partial<TypeObject> | {
|
|
420
|
+
valid: true;
|
|
421
|
+
} | {
|
|
422
|
+
sparse: true;
|
|
423
|
+
};
|
|
424
|
+
set: string[] | Partial<TypeObject> | {
|
|
425
|
+
valid: true;
|
|
426
|
+
} | {
|
|
427
|
+
sparse: true;
|
|
428
|
+
};
|
|
429
|
+
file: string[] | Partial<TypeObject> | {
|
|
430
|
+
valid: true;
|
|
431
|
+
} | {
|
|
432
|
+
sparse: true;
|
|
433
|
+
};
|
|
434
|
+
arraybuffer: string[] | Partial<TypeObject> | {
|
|
435
|
+
valid: true;
|
|
436
|
+
} | {
|
|
437
|
+
sparse: true;
|
|
438
|
+
};
|
|
439
|
+
false: string[] | Partial<TypeObject> | {
|
|
440
|
+
valid: true;
|
|
441
|
+
} | {
|
|
442
|
+
sparse: true;
|
|
443
|
+
};
|
|
444
|
+
date: string[] | Partial<TypeObject> | {
|
|
445
|
+
valid: true;
|
|
446
|
+
} | {
|
|
447
|
+
sparse: true;
|
|
448
|
+
};
|
|
449
|
+
null: string[] | Partial<TypeObject> | {
|
|
450
|
+
valid: true;
|
|
451
|
+
} | {
|
|
452
|
+
sparse: true;
|
|
453
|
+
};
|
|
454
|
+
regexp: string[] | Partial<TypeObject> | {
|
|
455
|
+
valid: true;
|
|
456
|
+
} | {
|
|
457
|
+
sparse: true;
|
|
458
|
+
};
|
|
459
|
+
array: string[] | Partial<TypeObject> | {
|
|
460
|
+
valid: true;
|
|
461
|
+
} | {
|
|
462
|
+
sparse: true;
|
|
463
|
+
};
|
|
464
|
+
true: string[] | Partial<TypeObject> | {
|
|
465
|
+
valid: true;
|
|
466
|
+
} | {
|
|
467
|
+
sparse: true;
|
|
468
|
+
};
|
|
469
|
+
arrayReference: string[] | Partial<TypeObject> | {
|
|
470
|
+
valid: true;
|
|
471
|
+
} | {
|
|
472
|
+
sparse: true;
|
|
473
|
+
};
|
|
474
|
+
objectReference: string[] | Partial<TypeObject> | {
|
|
475
|
+
valid: true;
|
|
476
|
+
} | {
|
|
477
|
+
sparse: true;
|
|
478
|
+
};
|
|
479
|
+
userObject: string[] | Partial<TypeObject> | {
|
|
480
|
+
valid: true;
|
|
481
|
+
} | {
|
|
482
|
+
sparse: true;
|
|
483
|
+
};
|
|
484
|
+
undef: string[] | Partial<TypeObject> | {
|
|
485
|
+
valid: true;
|
|
486
|
+
} | {
|
|
487
|
+
sparse: true;
|
|
488
|
+
};
|
|
489
|
+
SpecialRealNumber: string[] | Partial<TypeObject> | {
|
|
490
|
+
valid: true;
|
|
491
|
+
} | {
|
|
492
|
+
sparse: true;
|
|
493
|
+
};
|
|
494
|
+
SpecialNumber: string[] | Partial<TypeObject> | {
|
|
495
|
+
valid: true;
|
|
496
|
+
} | {
|
|
497
|
+
sparse: true;
|
|
498
|
+
};
|
|
499
|
+
BooleanObject: string[] | Partial<TypeObject> | {
|
|
500
|
+
valid: true;
|
|
501
|
+
} | {
|
|
502
|
+
sparse: true;
|
|
503
|
+
};
|
|
504
|
+
NumberObject: string[] | Partial<TypeObject> | {
|
|
505
|
+
valid: true;
|
|
506
|
+
} | {
|
|
507
|
+
sparse: true;
|
|
508
|
+
};
|
|
509
|
+
StringObject: string[] | Partial<TypeObject> | {
|
|
510
|
+
valid: true;
|
|
511
|
+
} | {
|
|
512
|
+
sparse: true;
|
|
513
|
+
};
|
|
514
|
+
filelist: string[] | Partial<TypeObject> | {
|
|
515
|
+
valid: true;
|
|
516
|
+
} | {
|
|
517
|
+
sparse: true;
|
|
518
|
+
};
|
|
519
|
+
blobHTML: string[] | Partial<TypeObject> | {
|
|
520
|
+
valid: true;
|
|
521
|
+
} | {
|
|
522
|
+
sparse: true;
|
|
523
|
+
};
|
|
524
|
+
arraybufferview: string[] | Partial<TypeObject> | {
|
|
525
|
+
valid: true;
|
|
526
|
+
} | {
|
|
527
|
+
sparse: true;
|
|
528
|
+
};
|
|
529
|
+
dataview: string[] | Partial<TypeObject> | {
|
|
530
|
+
valid: true;
|
|
531
|
+
} | {
|
|
532
|
+
sparse: true;
|
|
533
|
+
};
|
|
534
|
+
imagedata: string[] | Partial<TypeObject> | {
|
|
535
|
+
valid: true;
|
|
536
|
+
} | {
|
|
537
|
+
sparse: true;
|
|
538
|
+
};
|
|
539
|
+
imagebitmap: string[] | Partial<TypeObject> | {
|
|
540
|
+
valid: true;
|
|
541
|
+
} | {
|
|
542
|
+
sparse: true;
|
|
543
|
+
};
|
|
544
|
+
int8array: string[] | Partial<TypeObject> | {
|
|
545
|
+
valid: true;
|
|
546
|
+
} | {
|
|
547
|
+
sparse: true;
|
|
548
|
+
};
|
|
549
|
+
uint8array: string[] | Partial<TypeObject> | {
|
|
550
|
+
valid: true;
|
|
551
|
+
} | {
|
|
552
|
+
sparse: true;
|
|
553
|
+
};
|
|
554
|
+
uint8clampedarray: string[] | Partial<TypeObject> | {
|
|
555
|
+
valid: true;
|
|
556
|
+
} | {
|
|
557
|
+
sparse: true;
|
|
558
|
+
};
|
|
559
|
+
int16array: string[] | Partial<TypeObject> | {
|
|
560
|
+
valid: true;
|
|
561
|
+
} | {
|
|
562
|
+
sparse: true;
|
|
563
|
+
};
|
|
564
|
+
uint16array: string[] | Partial<TypeObject> | {
|
|
565
|
+
valid: true;
|
|
566
|
+
} | {
|
|
567
|
+
sparse: true;
|
|
568
|
+
};
|
|
569
|
+
int32array: string[] | Partial<TypeObject> | {
|
|
570
|
+
valid: true;
|
|
571
|
+
} | {
|
|
572
|
+
sparse: true;
|
|
573
|
+
};
|
|
574
|
+
uint32array: string[] | Partial<TypeObject> | {
|
|
575
|
+
valid: true;
|
|
576
|
+
} | {
|
|
577
|
+
sparse: true;
|
|
578
|
+
};
|
|
579
|
+
float32array: string[] | Partial<TypeObject> | {
|
|
580
|
+
valid: true;
|
|
581
|
+
} | {
|
|
582
|
+
sparse: true;
|
|
583
|
+
};
|
|
584
|
+
float64array: string[] | Partial<TypeObject> | {
|
|
585
|
+
valid: true;
|
|
586
|
+
} | {
|
|
587
|
+
sparse: true;
|
|
588
|
+
};
|
|
589
|
+
IntlCollator: string[] | Partial<TypeObject> | {
|
|
590
|
+
valid: true;
|
|
591
|
+
} | {
|
|
592
|
+
sparse: true;
|
|
593
|
+
};
|
|
594
|
+
IntlDateTimeFormat: string[] | Partial<TypeObject> | {
|
|
595
|
+
valid: true;
|
|
596
|
+
} | {
|
|
597
|
+
sparse: true;
|
|
598
|
+
};
|
|
599
|
+
IntlNumberFormat: string[] | Partial<TypeObject> | {
|
|
600
|
+
valid: true;
|
|
601
|
+
} | {
|
|
602
|
+
sparse: true;
|
|
603
|
+
};
|
|
604
|
+
sparseUndefined: string[] | Partial<TypeObject> | {
|
|
605
|
+
valid: true;
|
|
606
|
+
} | {
|
|
607
|
+
sparse: true;
|
|
608
|
+
};
|
|
609
|
+
ValidDate: string[] | Partial<TypeObject> | {
|
|
610
|
+
valid: true;
|
|
611
|
+
} | {
|
|
612
|
+
sparse: true;
|
|
613
|
+
};
|
|
614
|
+
arrayNonindexKeys: string[] | Partial<TypeObject> | {
|
|
615
|
+
valid: true;
|
|
616
|
+
} | {
|
|
617
|
+
sparse: true;
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
getTypeForRoot: GetTypeForRoot;
|
|
621
|
+
getValueForRoot: GetValueForRoot;
|
|
622
|
+
getFormControlForRoot: GetFormControlForRoot;
|
|
623
|
+
getValueFromRootAncestor: GetValueFromRootAncestor;
|
|
624
|
+
getFormControlFromRootAncestor: GetFormControlFromRootAncestor;
|
|
625
|
+
getTypesForFormatAndState: GetTypesForFormatAndState;
|
|
626
|
+
getOptionForType: GetOptionForType;
|
|
627
|
+
getTypeOptionsForFormatAndState: GetTypeOptionsForFormatAndState;
|
|
628
|
+
getUIForModeAndType: GetUIForModeAndType;
|
|
629
|
+
contexts: {
|
|
405
630
|
[key: string]: {
|
|
406
631
|
[key: string]: {
|
|
407
632
|
type: AvailableType;
|
|
@@ -409,115 +634,11 @@ declare namespace Types {
|
|
|
409
634
|
}[];
|
|
410
635
|
};
|
|
411
636
|
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
*/
|
|
420
|
-
function validValuesSet({ form, typeNamespace, keySelectClass }: {
|
|
421
|
-
form: HTMLFormElement;
|
|
422
|
-
typeNamespace?: string | undefined;
|
|
423
|
-
keySelectClass?: string | undefined;
|
|
424
|
-
}): boolean;
|
|
425
|
-
/**
|
|
426
|
-
* Any other possibilities than `div`?
|
|
427
|
-
* @typedef {HTMLDivElement} RootElement
|
|
428
|
-
*/
|
|
429
|
-
/**
|
|
430
|
-
* @public
|
|
431
|
-
* @param {object} cfg
|
|
432
|
-
* @param {RootElement} cfg.topRoot
|
|
433
|
-
* @returns {void}
|
|
434
|
-
*/
|
|
435
|
-
function validateAllReferences({ topRoot }: {
|
|
436
|
-
topRoot: HTMLDivElement;
|
|
437
|
-
}): void;
|
|
438
|
-
const customValidateAllReferences: ((info: {
|
|
439
|
-
topRoot: HTMLDivElement;
|
|
440
|
-
}) => void) | null;
|
|
441
|
-
/**
|
|
442
|
-
* @public
|
|
443
|
-
* @param {object} cfg
|
|
444
|
-
* @param {AvailableType} cfg.type
|
|
445
|
-
* @param {RootElement} cfg.root
|
|
446
|
-
* @param {RootElement} [cfg.topRoot]
|
|
447
|
-
* @returns {boolean}
|
|
448
|
-
*/
|
|
449
|
-
function validate({ type, root, topRoot }: {
|
|
450
|
-
type: AvailableType;
|
|
451
|
-
root: HTMLDivElement;
|
|
452
|
-
topRoot?: HTMLDivElement | undefined;
|
|
453
|
-
}): boolean;
|
|
454
|
-
/**
|
|
455
|
-
* @param {object} cfg
|
|
456
|
-
* @param {AvailableType} cfg.type
|
|
457
|
-
* @param {RootElement} cfg.root
|
|
458
|
-
* @param {StructuredCloneValue} cfg.value
|
|
459
|
-
* @returns {void}
|
|
460
|
-
*/
|
|
461
|
-
function setValue({ type, root, value }: {
|
|
462
|
-
type: AvailableType;
|
|
463
|
-
root: HTMLDivElement;
|
|
464
|
-
value: any;
|
|
465
|
-
}): void;
|
|
466
|
-
/**
|
|
467
|
-
* @public
|
|
468
|
-
* @param {string} s
|
|
469
|
-
* @param {object} cfg
|
|
470
|
-
* @param {import('./formats.js').AvailableFormat} cfg.format
|
|
471
|
-
* @param {string} cfg.state
|
|
472
|
-
* @param {TypeObject[]} [cfg.endMatchTypeObjs=[]]
|
|
473
|
-
* @param {boolean} [cfg.firstRun=true]
|
|
474
|
-
* @param {[
|
|
475
|
-
* type: string,
|
|
476
|
-
* parent: {[key: string]: any},
|
|
477
|
-
* parentPath: string|number,
|
|
478
|
-
* path: string
|
|
479
|
-
* ][]} [cfg.rootHolder=[]]
|
|
480
|
-
* @param {{[key: string]: any}} cfg.parent
|
|
481
|
-
* @param {string|number} cfg.parentPath
|
|
482
|
-
* @returns {[
|
|
483
|
-
* value: StructuredCloneValue,
|
|
484
|
-
* remnant: string,
|
|
485
|
-
* beginOnly: boolean,
|
|
486
|
-
* assign: boolean
|
|
487
|
-
* ]}
|
|
488
|
-
*/
|
|
489
|
-
function getValueForString(s: string, { format, state, endMatchTypeObjs, firstRun, rootHolder, parent, parentPath }: {
|
|
490
|
-
format: import("./formats.js").AvailableFormat;
|
|
491
|
-
state: string;
|
|
492
|
-
endMatchTypeObjs?: TypeObject[] | undefined;
|
|
493
|
-
firstRun?: boolean | undefined;
|
|
494
|
-
rootHolder?: [type: string, parent: {
|
|
495
|
-
[key: string]: any;
|
|
496
|
-
}, parentPath: string | number, path: string][] | undefined;
|
|
497
|
-
parent: {
|
|
498
|
-
[key: string]: any;
|
|
499
|
-
};
|
|
500
|
-
parentPath: string | number;
|
|
501
|
-
}): [value: any, remnant: string, beginOnly: boolean, assign: boolean];
|
|
502
|
-
}
|
|
503
|
-
import nullType from './fundamentalTypes/nullType.js';
|
|
504
|
-
import trueType from './subTypes/trueType.js';
|
|
505
|
-
import falseType from './subTypes/falseType.js';
|
|
506
|
-
import numberType from './fundamentalTypes/numberType.js';
|
|
507
|
-
import bigintType from './fundamentalTypes/bigintType.js';
|
|
508
|
-
import stringType from './fundamentalTypes/stringType.js';
|
|
509
|
-
import arrayReferenceType from './fundamentalTypes/arrayReferenceType.js';
|
|
510
|
-
import objectReferenceType from './fundamentalTypes/objectReferenceType.js';
|
|
511
|
-
import arrayType from './fundamentalTypes/arrayType.js';
|
|
512
|
-
import objectType from './fundamentalTypes/objectType.js';
|
|
513
|
-
import dateType from './fundamentalTypes/dateType.js';
|
|
514
|
-
import undefinedType from './fundamentalTypes/undefinedType.js';
|
|
515
|
-
import SpecialRealNumberSuperType from './superTypes/SpecialRealNumberSuperType.js';
|
|
516
|
-
import SpecialNumberSuperType from './superTypes/SpecialNumberSuperType.js';
|
|
517
|
-
import regexpType from './fundamentalTypes/regexpType.js';
|
|
518
|
-
import BooleanObjectType from './fundamentalTypes/BooleanObjectType.js';
|
|
519
|
-
import NumberObjectType from './fundamentalTypes/NumberObjectType.js';
|
|
520
|
-
import StringObjectType from './fundamentalTypes/StringObjectType.js';
|
|
521
|
-
import blobHTMLType from './subTypes/blobHTMLType.js';
|
|
522
|
-
import sparseUndefinedType from './fundamentalTypes/sparseUndefinedType.js';
|
|
637
|
+
validValuesSet: ValidValuesSet;
|
|
638
|
+
validateAllReferences: ValidateAllReferences;
|
|
639
|
+
validate: Validate;
|
|
640
|
+
setValue: SetValue;
|
|
641
|
+
getValueForString: GetValueForString;
|
|
642
|
+
customValidateAllReferences?: CustomValidateAllReferences | undefined;
|
|
643
|
+
};
|
|
523
644
|
//# sourceMappingURL=types.d.ts.map
|