@json-eval-rs/vanilla 0.0.45
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/dist/index.d.ts +27 -0
- package/dist/index.js +36 -0
- package/package.json +41 -0
- package/pkg/json_eval_rs.d.ts +617 -0
- package/pkg/json_eval_rs.js +2382 -0
- package/pkg/json_eval_rs_bg.wasm +0 -0
- package/pkg/json_eval_rs_bg.wasm.d.ts +84 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Get library version (alias)
|
|
5
|
+
*/
|
|
6
|
+
export function version(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the library (sets up panic hook)
|
|
9
|
+
*/
|
|
10
|
+
export function init(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Get the library version
|
|
13
|
+
*/
|
|
14
|
+
export function getVersion(): string;
|
|
15
|
+
/**
|
|
16
|
+
* WebAssembly wrapper for JSONEval
|
|
17
|
+
*/
|
|
18
|
+
export class JSONEvalWasm {
|
|
19
|
+
free(): void;
|
|
20
|
+
[Symbol.dispose](): void;
|
|
21
|
+
/**
|
|
22
|
+
* Evaluate and return as JsValue for direct JavaScript object access
|
|
23
|
+
*
|
|
24
|
+
* @param data - JSON data string
|
|
25
|
+
* @param context - Optional context data JSON string
|
|
26
|
+
* @returns Evaluated schema as JavaScript object
|
|
27
|
+
*/
|
|
28
|
+
evaluateJS(data: string, context?: string | null, paths?: string[] | null): any;
|
|
29
|
+
/**
|
|
30
|
+
* Compile JSON logic and return a global ID
|
|
31
|
+
* @param logic_str - JSON logic expression as a string
|
|
32
|
+
* @returns Compiled logic ID as number (u64)
|
|
33
|
+
*/
|
|
34
|
+
compileLogic(logic_str: string): number;
|
|
35
|
+
/**
|
|
36
|
+
* Evaluate dependents when a field changes (returns array of changes as JSON string)
|
|
37
|
+
*
|
|
38
|
+
* @param changedPath - Path of the field that changed
|
|
39
|
+
* @param data - Optional updated JSON data string
|
|
40
|
+
* @param context - Optional context data JSON string
|
|
41
|
+
* @returns Array of dependent change objects as JSON string
|
|
42
|
+
*/
|
|
43
|
+
evaluateDependents(changed_path: string, data?: string | null, context?: string | null): string;
|
|
44
|
+
/**
|
|
45
|
+
* Compile and run JSON logic from a JSON logic string
|
|
46
|
+
* @param logic_str - JSON logic expression as a string
|
|
47
|
+
* @param data - Optional JSON data string
|
|
48
|
+
* @param context - Optional JSON context string
|
|
49
|
+
* @returns Result as JavaScript object
|
|
50
|
+
*/
|
|
51
|
+
compileAndRunLogic(logic_str: string, data?: string | null, context?: string | null): any;
|
|
52
|
+
/**
|
|
53
|
+
* Evaluate dependents and return as JavaScript object
|
|
54
|
+
*
|
|
55
|
+
* @param changedPathsJson - JSON array of field paths that changed
|
|
56
|
+
* @param data - Optional updated JSON data string
|
|
57
|
+
* @param context - Optional context data JSON string
|
|
58
|
+
* @param reEvaluate - If true, performs full evaluation after processing dependents
|
|
59
|
+
* @returns Array of dependent change objects as JavaScript object
|
|
60
|
+
*/
|
|
61
|
+
evaluateDependentsJS(changed_paths_json: string, data: string | null | undefined, context: string | null | undefined, re_evaluate: boolean): any;
|
|
62
|
+
/**
|
|
63
|
+
* Evaluate schema with provided data (does not return schema - use getEvaluatedSchema() for that)
|
|
64
|
+
*
|
|
65
|
+
* @param data - JSON data string
|
|
66
|
+
* @param context - Optional context data JSON string
|
|
67
|
+
* @throws Error if evaluation fails
|
|
68
|
+
*/
|
|
69
|
+
evaluate(data: string, context?: string | null, paths?: string[] | null): void;
|
|
70
|
+
/**
|
|
71
|
+
* Run pre-compiled logic by ID
|
|
72
|
+
* @param logic_id - Compiled logic ID from compileLogic
|
|
73
|
+
* @param data - Optional JSON data string
|
|
74
|
+
* @param context - Optional JSON context string
|
|
75
|
+
* @returns Result as JavaScript object
|
|
76
|
+
*/
|
|
77
|
+
runLogic(logic_id: number, data?: string | null, context?: string | null): any;
|
|
78
|
+
/**
|
|
79
|
+
* Validate data and return as plain JavaScript object (Worker-safe)
|
|
80
|
+
*
|
|
81
|
+
* @param data - JSON data string
|
|
82
|
+
* @param context - Optional context data JSON string
|
|
83
|
+
* @returns Plain JavaScript object with validation result
|
|
84
|
+
*/
|
|
85
|
+
validateJS(data: string, context?: string | null): any;
|
|
86
|
+
/**
|
|
87
|
+
* Validate data against schema rules with optional path filtering
|
|
88
|
+
*
|
|
89
|
+
* @param data - JSON data string
|
|
90
|
+
* @param context - Optional context data JSON string
|
|
91
|
+
* @param paths - Optional array of paths to validate (null for all)
|
|
92
|
+
* @returns ValidationResult
|
|
93
|
+
*/
|
|
94
|
+
validatePaths(data: string, context?: string | null, paths?: string[] | null): ValidationResult;
|
|
95
|
+
/**
|
|
96
|
+
* Validate with path filtering and return as plain JavaScript object (Worker-safe)
|
|
97
|
+
*
|
|
98
|
+
* @param data - JSON data string
|
|
99
|
+
* @param context - Optional context data JSON string
|
|
100
|
+
* @param paths - Optional array of paths to validate (null for all)
|
|
101
|
+
* @returns Plain JavaScript object with validation result
|
|
102
|
+
*/
|
|
103
|
+
validatePathsJS(data: string, context?: string | null, paths?: string[] | null): any;
|
|
104
|
+
/**
|
|
105
|
+
* Validate data against schema rules
|
|
106
|
+
*
|
|
107
|
+
* @param data - JSON data string
|
|
108
|
+
* @param context - Optional context data JSON string
|
|
109
|
+
* @returns ValidationResult
|
|
110
|
+
*/
|
|
111
|
+
validate(data: string, context?: string | null): ValidationResult;
|
|
112
|
+
/**
|
|
113
|
+
* Create a new JSONEval instance from a cached ParsedSchema
|
|
114
|
+
*
|
|
115
|
+
* @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
|
|
116
|
+
* @param context - Optional context data JSON string
|
|
117
|
+
* @param data - Optional initial data JSON string
|
|
118
|
+
*/
|
|
119
|
+
static newFromCache(cache_key: string, context?: string | null, data?: string | null): JSONEvalWasm;
|
|
120
|
+
/**
|
|
121
|
+
* Create a new JSONEval instance from MessagePack-encoded schema
|
|
122
|
+
*
|
|
123
|
+
* @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
|
|
124
|
+
* @param context - Optional context data JSON string
|
|
125
|
+
* @param data - Optional initial data JSON string
|
|
126
|
+
*/
|
|
127
|
+
static newFromMsgpack(schema_msgpack: Uint8Array, context?: string | null, data?: string | null): JSONEvalWasm;
|
|
128
|
+
/**
|
|
129
|
+
* Set timezone offset for datetime operations (TODAY, NOW)
|
|
130
|
+
*
|
|
131
|
+
* @param offsetMinutes - Timezone offset in minutes from UTC (e.g., 420 for UTC+7, -300 for UTC-5)
|
|
132
|
+
* Pass null or undefined to reset to UTC
|
|
133
|
+
*/
|
|
134
|
+
setTimezoneOffset(offset_minutes?: number | null): void;
|
|
135
|
+
/**
|
|
136
|
+
* Create a new JSONEval instance
|
|
137
|
+
*
|
|
138
|
+
* @param schema - JSON schema string
|
|
139
|
+
* @param context - Optional context data JSON string
|
|
140
|
+
* @param data - Optional initial data JSON string
|
|
141
|
+
*/
|
|
142
|
+
constructor(schema: string, context?: string | null, data?: string | null);
|
|
143
|
+
/**
|
|
144
|
+
* Get cache statistics
|
|
145
|
+
*
|
|
146
|
+
* @returns Cache statistics as JavaScript object with hits, misses, and entries
|
|
147
|
+
*/
|
|
148
|
+
cacheStats(): any;
|
|
149
|
+
/**
|
|
150
|
+
* Clear the evaluation cache
|
|
151
|
+
*/
|
|
152
|
+
clearCache(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Enable evaluation caching
|
|
155
|
+
* Useful for reusing JSONEval instances with different data
|
|
156
|
+
*/
|
|
157
|
+
enableCache(): void;
|
|
158
|
+
/**
|
|
159
|
+
* Disable evaluation caching
|
|
160
|
+
* Useful for web API usage where each request creates a new JSONEval instance
|
|
161
|
+
* Improves performance by skipping cache operations that have no benefit for single-use instances
|
|
162
|
+
*/
|
|
163
|
+
disableCache(): void;
|
|
164
|
+
/**
|
|
165
|
+
* Check if evaluation caching is enabled
|
|
166
|
+
*
|
|
167
|
+
* @returns true if caching is enabled, false otherwise
|
|
168
|
+
*/
|
|
169
|
+
isCacheEnabled(): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Get the number of cached entries
|
|
172
|
+
*
|
|
173
|
+
* @returns Number of cached entries
|
|
174
|
+
*/
|
|
175
|
+
cacheLen(): number;
|
|
176
|
+
/**
|
|
177
|
+
* Resolve layout with optional evaluation
|
|
178
|
+
*
|
|
179
|
+
* @param evaluate - If true, runs evaluation before resolving layout
|
|
180
|
+
* @throws Error if resolve fails
|
|
181
|
+
*/
|
|
182
|
+
resolveLayout(evaluate: boolean): void;
|
|
183
|
+
/**
|
|
184
|
+
* Reload schema with new data
|
|
185
|
+
*
|
|
186
|
+
* @param schema - New JSON schema string
|
|
187
|
+
* @param context - Optional context data JSON string
|
|
188
|
+
* @param data - Optional initial data JSON string
|
|
189
|
+
*/
|
|
190
|
+
reloadSchema(schema: string, context?: string | null, data?: string | null): void;
|
|
191
|
+
/**
|
|
192
|
+
* Get all schema values (evaluations ending with .value)
|
|
193
|
+
* Mutates internal data by overriding with values from value evaluations
|
|
194
|
+
*
|
|
195
|
+
* @returns Modified data as JavaScript object
|
|
196
|
+
*/
|
|
197
|
+
getSchemaValue(): any;
|
|
198
|
+
/**
|
|
199
|
+
* Get a value from the schema using dotted path notation
|
|
200
|
+
*
|
|
201
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
202
|
+
* @returns Value as JSON string or null if not found
|
|
203
|
+
*/
|
|
204
|
+
getSchemaByPath(path: string): string | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* Get values from schema using multiple dotted paths
|
|
207
|
+
* @param pathsJson - JSON array of dotted paths
|
|
208
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
209
|
+
* @returns Data in specified format as JSON string
|
|
210
|
+
*/
|
|
211
|
+
getSchemaByPaths(paths_json: string, format: number): string;
|
|
212
|
+
/**
|
|
213
|
+
* Get the evaluated schema with optional layout resolution
|
|
214
|
+
*
|
|
215
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
216
|
+
* @returns Evaluated schema as JSON string
|
|
217
|
+
*/
|
|
218
|
+
getEvaluatedSchema(skip_layout: boolean): string;
|
|
219
|
+
/**
|
|
220
|
+
* Get a value from the schema using dotted path notation as JavaScript object
|
|
221
|
+
*
|
|
222
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
223
|
+
* @returns Value as JavaScript object or null if not found
|
|
224
|
+
*/
|
|
225
|
+
getSchemaByPathJS(path: string): any;
|
|
226
|
+
/**
|
|
227
|
+
* Reload schema from MessagePack-encoded bytes
|
|
228
|
+
*
|
|
229
|
+
* @param schemaMsgpack - MessagePack-encoded schema bytes (Uint8Array)
|
|
230
|
+
* @param context - Optional context data JSON string
|
|
231
|
+
* @param data - Optional initial data JSON string
|
|
232
|
+
*/
|
|
233
|
+
reloadSchemaMsgpack(schema_msgpack: Uint8Array, context?: string | null, data?: string | null): void;
|
|
234
|
+
/**
|
|
235
|
+
* Get values from schema using multiple dotted paths (JS object)
|
|
236
|
+
* @param pathsJson - JSON array of dotted paths
|
|
237
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
238
|
+
* @returns Data in specified format as JavaScript object
|
|
239
|
+
*/
|
|
240
|
+
getSchemaByPathsJS(paths_json: string, format: number): any;
|
|
241
|
+
/**
|
|
242
|
+
* Get the evaluated schema as JavaScript object
|
|
243
|
+
*
|
|
244
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
245
|
+
* @returns Evaluated schema as JavaScript object
|
|
246
|
+
*/
|
|
247
|
+
getEvaluatedSchemaJS(skip_layout: boolean): any;
|
|
248
|
+
/**
|
|
249
|
+
* Reload schema from ParsedSchemaCache using a cache key
|
|
250
|
+
*
|
|
251
|
+
* @param cacheKey - Cache key to lookup in the global ParsedSchemaCache
|
|
252
|
+
* @param context - Optional context data JSON string
|
|
253
|
+
* @param data - Optional initial data JSON string
|
|
254
|
+
*/
|
|
255
|
+
reloadSchemaFromCache(cache_key: string, context?: string | null, data?: string | null): void;
|
|
256
|
+
/**
|
|
257
|
+
* Get a value from the evaluated schema using dotted path notation
|
|
258
|
+
*
|
|
259
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
260
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
261
|
+
* @returns Value as JSON string or null if not found
|
|
262
|
+
*/
|
|
263
|
+
getEvaluatedSchemaByPath(path: string, skip_layout: boolean): string | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* Get the evaluated schema in MessagePack format
|
|
266
|
+
*
|
|
267
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
268
|
+
* @returns Evaluated schema as MessagePack bytes (Uint8Array)
|
|
269
|
+
*
|
|
270
|
+
* # Zero-Copy Optimization
|
|
271
|
+
*
|
|
272
|
+
* This method returns MessagePack binary data with minimal copying:
|
|
273
|
+
* 1. Serializes schema to Vec<u8> in Rust (unavoidable)
|
|
274
|
+
* 2. wasm-bindgen transfers Vec<u8> to JS as Uint8Array (optimized)
|
|
275
|
+
* 3. Result is a Uint8Array view (minimal overhead)
|
|
276
|
+
*
|
|
277
|
+
* MessagePack format is 20-50% smaller than JSON, ideal for web/WASM.
|
|
278
|
+
*/
|
|
279
|
+
getEvaluatedSchemaMsgpack(skip_layout: boolean): Uint8Array;
|
|
280
|
+
/**
|
|
281
|
+
* Get values from evaluated schema using multiple dotted paths
|
|
282
|
+
* @param pathsJson - JSON array of dotted paths
|
|
283
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
284
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
285
|
+
* @returns Data in specified format as JSON string
|
|
286
|
+
*/
|
|
287
|
+
getEvaluatedSchemaByPaths(paths_json: string, skip_layout: boolean, format: number): string;
|
|
288
|
+
/**
|
|
289
|
+
* Get a value from the evaluated schema using dotted path notation as JavaScript object
|
|
290
|
+
*
|
|
291
|
+
* @param path - Dotted path to the value (e.g., "properties.field.value")
|
|
292
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
293
|
+
* @returns Value as JavaScript object or null if not found
|
|
294
|
+
*/
|
|
295
|
+
getEvaluatedSchemaByPathJS(path: string, skip_layout: boolean): any;
|
|
296
|
+
/**
|
|
297
|
+
* Get values from evaluated schema using multiple dotted paths (JS object)
|
|
298
|
+
* @param pathsJson - JSON array of dotted paths
|
|
299
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
300
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
301
|
+
* @returns Data in specified format as JavaScript object
|
|
302
|
+
*/
|
|
303
|
+
getEvaluatedSchemaByPathsJS(paths_json: string, skip_layout: boolean, format: number): any;
|
|
304
|
+
/**
|
|
305
|
+
* Get the evaluated schema without $params field
|
|
306
|
+
*
|
|
307
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
308
|
+
* @returns Evaluated schema as JSON string
|
|
309
|
+
*/
|
|
310
|
+
getEvaluatedSchemaWithoutParams(skip_layout: boolean): string;
|
|
311
|
+
/**
|
|
312
|
+
* Get the evaluated schema without $params as JavaScript object
|
|
313
|
+
*
|
|
314
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
315
|
+
* @returns Evaluated schema as JavaScript object
|
|
316
|
+
*/
|
|
317
|
+
getEvaluatedSchemaWithoutParamsJS(skip_layout: boolean): any;
|
|
318
|
+
/**
|
|
319
|
+
* Check if a subform exists at the given path
|
|
320
|
+
*
|
|
321
|
+
* @param subformPath - Path to check
|
|
322
|
+
* @returns True if subform exists, false otherwise
|
|
323
|
+
*/
|
|
324
|
+
hasSubform(subform_path: string): boolean;
|
|
325
|
+
/**
|
|
326
|
+
* Evaluate a subform with data
|
|
327
|
+
*
|
|
328
|
+
* @param subformPath - Path to the subform (e.g., "#/riders")
|
|
329
|
+
* @param data - JSON data string for the subform
|
|
330
|
+
* @param context - Optional context data JSON string
|
|
331
|
+
* @param paths - Optional array of paths to evaluate (JSON string array)
|
|
332
|
+
* @throws Error if evaluation fails
|
|
333
|
+
*/
|
|
334
|
+
evaluateSubform(subform_path: string, data: string, context?: string | null, paths?: string[] | null): void;
|
|
335
|
+
/**
|
|
336
|
+
* Validate subform data against its schema rules
|
|
337
|
+
*
|
|
338
|
+
* @param subformPath - Path to the subform
|
|
339
|
+
* @param data - JSON data string for the subform
|
|
340
|
+
* @param context - Optional context data JSON string
|
|
341
|
+
* @returns ValidationResult
|
|
342
|
+
*/
|
|
343
|
+
validateSubform(subform_path: string, data: string, context?: string | null): ValidationResult;
|
|
344
|
+
/**
|
|
345
|
+
* Get list of available subform paths
|
|
346
|
+
*
|
|
347
|
+
* @returns Array of subform paths
|
|
348
|
+
*/
|
|
349
|
+
getSubformPaths(): string[];
|
|
350
|
+
/**
|
|
351
|
+
* Resolve layout for subform
|
|
352
|
+
*
|
|
353
|
+
* @param subformPath - Path to the subform
|
|
354
|
+
* @param evaluate - If true, runs evaluation before resolving layout
|
|
355
|
+
* @throws Error if resolve fails
|
|
356
|
+
*/
|
|
357
|
+
resolveLayoutSubform(subform_path: string, evaluate: boolean): void;
|
|
358
|
+
/**
|
|
359
|
+
* Get schema value from subform (all .value fields)
|
|
360
|
+
*
|
|
361
|
+
* @param subformPath - Path to the subform
|
|
362
|
+
* @returns Modified data as JavaScript object
|
|
363
|
+
*/
|
|
364
|
+
getSchemaValueSubform(subform_path: string): any;
|
|
365
|
+
/**
|
|
366
|
+
* Get schema by specific path from subform (returns JSON string)
|
|
367
|
+
* @param subformPath - Path to the subform
|
|
368
|
+
* @param schemaPath - Path within the subform
|
|
369
|
+
* @returns Value as JSON string or null if not found
|
|
370
|
+
*/
|
|
371
|
+
getSchemaByPathSubform(subform_path: string, schema_path: string): string | undefined;
|
|
372
|
+
/**
|
|
373
|
+
* Evaluate dependents in subform when a field changes
|
|
374
|
+
*
|
|
375
|
+
* @param subformPath - Path to the subform
|
|
376
|
+
* @param changedPath - Path of the field that changed
|
|
377
|
+
* @param data - Optional updated JSON data string
|
|
378
|
+
* @param context - Optional context data JSON string
|
|
379
|
+
* @returns Array of dependent change objects as JSON string
|
|
380
|
+
*/
|
|
381
|
+
evaluateDependentsSubform(subform_path: string, changed_path: string, data?: string | null, context?: string | null): string;
|
|
382
|
+
/**
|
|
383
|
+
* Get schema by multiple paths from subform
|
|
384
|
+
* @param subformPath - Path to the subform
|
|
385
|
+
* @param pathsJson - JSON array of dotted paths
|
|
386
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
387
|
+
* @returns Data in specified format as JSON string
|
|
388
|
+
*/
|
|
389
|
+
getSchemaByPathsSubform(subform_path: string, paths_json: string, format: number): string;
|
|
390
|
+
/**
|
|
391
|
+
* Get evaluated schema from subform
|
|
392
|
+
*
|
|
393
|
+
* @param subformPath - Path to the subform
|
|
394
|
+
* @param resolveLayout - Whether to resolve layout
|
|
395
|
+
* @returns Evaluated schema as JSON string
|
|
396
|
+
*/
|
|
397
|
+
getEvaluatedSchemaSubform(subform_path: string, resolve_layout: boolean): string;
|
|
398
|
+
/**
|
|
399
|
+
* Get schema by specific path from subform (returns JS object)
|
|
400
|
+
* @param subformPath - Path to the subform
|
|
401
|
+
* @param schemaPath - Path within the subform
|
|
402
|
+
* @returns Value as JavaScript object or null if not found
|
|
403
|
+
*/
|
|
404
|
+
getSchemaByPathSubformJS(subform_path: string, schema_path: string): any;
|
|
405
|
+
/**
|
|
406
|
+
* Evaluate dependents in subform and return as JavaScript object
|
|
407
|
+
*
|
|
408
|
+
* @param subformPath - Path to the subform
|
|
409
|
+
* @param changedPath - Path of the field that changed
|
|
410
|
+
* @param data - Optional updated JSON data string
|
|
411
|
+
* @param context - Optional context data JSON string
|
|
412
|
+
* @returns Array of dependent change objects as JavaScript object
|
|
413
|
+
*/
|
|
414
|
+
evaluateDependentsSubformJS(subform_path: string, changed_path: string, data?: string | null, context?: string | null): any;
|
|
415
|
+
/**
|
|
416
|
+
* Get schema by multiple paths from subform (JS object)
|
|
417
|
+
* @param subformPath - Path to the subform
|
|
418
|
+
* @param pathsJson - JSON array of dotted paths
|
|
419
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
420
|
+
* @returns Data in specified format as JavaScript object
|
|
421
|
+
*/
|
|
422
|
+
getSchemaByPathsSubformJS(subform_path: string, paths_json: string, format: number): any;
|
|
423
|
+
/**
|
|
424
|
+
* Get evaluated schema from subform as JavaScript object
|
|
425
|
+
*
|
|
426
|
+
* @param subformPath - Path to the subform
|
|
427
|
+
* @param resolveLayout - Whether to resolve layout
|
|
428
|
+
* @returns Evaluated schema as JavaScript object
|
|
429
|
+
*/
|
|
430
|
+
getEvaluatedSchemaSubformJS(subform_path: string, resolve_layout: boolean): any;
|
|
431
|
+
/**
|
|
432
|
+
* Get evaluated schema by specific path from subform
|
|
433
|
+
*
|
|
434
|
+
* @param subformPath - Path to the subform
|
|
435
|
+
* @param schemaPath - Dotted path to the value within the subform
|
|
436
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
437
|
+
* @returns Value as JSON string or null if not found
|
|
438
|
+
*/
|
|
439
|
+
getEvaluatedSchemaByPathSubform(subform_path: string, schema_path: string, skip_layout: boolean): string | undefined;
|
|
440
|
+
/**
|
|
441
|
+
* Get values from the evaluated schema of a subform using multiple dotted path notations (returns JSON string)
|
|
442
|
+
* @param subformPath - Path to the subform
|
|
443
|
+
* @param pathsJson - JSON array of dotted paths
|
|
444
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
445
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
446
|
+
* @returns Data in specified format as JSON string
|
|
447
|
+
*/
|
|
448
|
+
getEvaluatedSchemaByPathsSubform(subform_path: string, paths_json: string, skip_layout: boolean, format: number): string;
|
|
449
|
+
/**
|
|
450
|
+
* Get evaluated schema by specific path from subform as JavaScript object
|
|
451
|
+
*
|
|
452
|
+
* @param subformPath - Path to the subform
|
|
453
|
+
* @param schemaPath - Dotted path to the value within the subform
|
|
454
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
455
|
+
* @returns Value as JavaScript object or null if not found
|
|
456
|
+
*/
|
|
457
|
+
getEvaluatedSchemaByPathSubformJS(subform_path: string, schema_path: string, skip_layout: boolean): any;
|
|
458
|
+
/**
|
|
459
|
+
* Get values from the evaluated schema of a subform using multiple dotted path notations (returns JS object)
|
|
460
|
+
* @param subformPath - Path to the subform
|
|
461
|
+
* @param pathsJson - JSON array of dotted paths
|
|
462
|
+
* @param skipLayout - Whether to skip layout resolution
|
|
463
|
+
* @param format - Return format (0=Nested, 1=Flat, 2=Array)
|
|
464
|
+
* @returns Data in specified format as JavaScript object
|
|
465
|
+
*/
|
|
466
|
+
getEvaluatedSchemaByPathsSubformJS(subform_path: string, paths_json: string, skip_layout: boolean, format: number): any;
|
|
467
|
+
/**
|
|
468
|
+
* Get evaluated schema without $params from subform
|
|
469
|
+
*
|
|
470
|
+
* @param subformPath - Path to the subform
|
|
471
|
+
* @param resolveLayout - Whether to resolve layout
|
|
472
|
+
* @returns Evaluated schema as JSON string
|
|
473
|
+
*/
|
|
474
|
+
getEvaluatedSchemaWithoutParamsSubform(subform_path: string, resolve_layout: boolean): string;
|
|
475
|
+
/**
|
|
476
|
+
* Get evaluated schema without $params from subform as JavaScript object
|
|
477
|
+
*
|
|
478
|
+
* @param subformPath - Path to the subform
|
|
479
|
+
* @param resolveLayout - Whether to resolve layout
|
|
480
|
+
* @returns Evaluated schema as JavaScript object
|
|
481
|
+
*/
|
|
482
|
+
getEvaluatedSchemaWithoutParamsSubformJS(subform_path: string, resolve_layout: boolean): any;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Validation error for JavaScript
|
|
486
|
+
*/
|
|
487
|
+
export class ValidationError {
|
|
488
|
+
private constructor();
|
|
489
|
+
free(): void;
|
|
490
|
+
[Symbol.dispose](): void;
|
|
491
|
+
readonly field_value: string | undefined;
|
|
492
|
+
readonly code: string | undefined;
|
|
493
|
+
readonly data: any;
|
|
494
|
+
readonly path: string;
|
|
495
|
+
readonly message: string;
|
|
496
|
+
readonly pattern: string | undefined;
|
|
497
|
+
readonly rule_type: string;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Validation result for JavaScript
|
|
501
|
+
*/
|
|
502
|
+
export class ValidationResult {
|
|
503
|
+
private constructor();
|
|
504
|
+
free(): void;
|
|
505
|
+
[Symbol.dispose](): void;
|
|
506
|
+
toJSON(): any;
|
|
507
|
+
readonly errors: ValidationError[];
|
|
508
|
+
readonly has_error: boolean;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
512
|
+
|
|
513
|
+
export interface InitOutput {
|
|
514
|
+
readonly memory: WebAssembly.Memory;
|
|
515
|
+
readonly __wbg_jsonevalwasm_free: (a: number, b: number) => void;
|
|
516
|
+
readonly __wbg_validationerror_free: (a: number, b: number) => void;
|
|
517
|
+
readonly __wbg_validationresult_free: (a: number, b: number) => void;
|
|
518
|
+
readonly getVersion: (a: number) => void;
|
|
519
|
+
readonly jsonevalwasm_cacheLen: (a: number) => number;
|
|
520
|
+
readonly jsonevalwasm_cacheStats: (a: number, b: number) => void;
|
|
521
|
+
readonly jsonevalwasm_clearCache: (a: number) => void;
|
|
522
|
+
readonly jsonevalwasm_compileAndRunLogic: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
523
|
+
readonly jsonevalwasm_compileLogic: (a: number, b: number, c: number, d: number) => void;
|
|
524
|
+
readonly jsonevalwasm_disableCache: (a: number) => void;
|
|
525
|
+
readonly jsonevalwasm_enableCache: (a: number) => void;
|
|
526
|
+
readonly jsonevalwasm_evaluate: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
527
|
+
readonly jsonevalwasm_evaluateDependents: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
528
|
+
readonly jsonevalwasm_evaluateDependentsJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
529
|
+
readonly jsonevalwasm_evaluateDependentsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
530
|
+
readonly jsonevalwasm_evaluateDependentsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
531
|
+
readonly jsonevalwasm_evaluateJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
532
|
+
readonly jsonevalwasm_evaluateSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
533
|
+
readonly jsonevalwasm_getEvaluatedSchema: (a: number, b: number, c: number) => void;
|
|
534
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPath: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
535
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPathJS: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
536
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPathSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
537
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPathSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
538
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPaths: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
539
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPathsJS: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
540
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPathsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
541
|
+
readonly jsonevalwasm_getEvaluatedSchemaByPathsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
542
|
+
readonly jsonevalwasm_getEvaluatedSchemaJS: (a: number, b: number, c: number) => void;
|
|
543
|
+
readonly jsonevalwasm_getEvaluatedSchemaMsgpack: (a: number, b: number, c: number) => void;
|
|
544
|
+
readonly jsonevalwasm_getEvaluatedSchemaSubform: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
545
|
+
readonly jsonevalwasm_getEvaluatedSchemaSubformJS: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
546
|
+
readonly jsonevalwasm_getEvaluatedSchemaWithoutParams: (a: number, b: number, c: number) => void;
|
|
547
|
+
readonly jsonevalwasm_getEvaluatedSchemaWithoutParamsJS: (a: number, b: number, c: number) => void;
|
|
548
|
+
readonly jsonevalwasm_getEvaluatedSchemaWithoutParamsSubform: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
549
|
+
readonly jsonevalwasm_getEvaluatedSchemaWithoutParamsSubformJS: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
550
|
+
readonly jsonevalwasm_getSchemaByPath: (a: number, b: number, c: number, d: number) => void;
|
|
551
|
+
readonly jsonevalwasm_getSchemaByPathJS: (a: number, b: number, c: number, d: number) => void;
|
|
552
|
+
readonly jsonevalwasm_getSchemaByPathSubform: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
553
|
+
readonly jsonevalwasm_getSchemaByPathSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
554
|
+
readonly jsonevalwasm_getSchemaByPaths: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
555
|
+
readonly jsonevalwasm_getSchemaByPathsJS: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
556
|
+
readonly jsonevalwasm_getSchemaByPathsSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
557
|
+
readonly jsonevalwasm_getSchemaByPathsSubformJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
558
|
+
readonly jsonevalwasm_getSchemaValue: (a: number, b: number) => void;
|
|
559
|
+
readonly jsonevalwasm_getSchemaValueSubform: (a: number, b: number, c: number, d: number) => void;
|
|
560
|
+
readonly jsonevalwasm_getSubformPaths: (a: number, b: number) => void;
|
|
561
|
+
readonly jsonevalwasm_hasSubform: (a: number, b: number, c: number) => number;
|
|
562
|
+
readonly jsonevalwasm_isCacheEnabled: (a: number) => number;
|
|
563
|
+
readonly jsonevalwasm_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
564
|
+
readonly jsonevalwasm_newFromCache: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
565
|
+
readonly jsonevalwasm_newFromMsgpack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
566
|
+
readonly jsonevalwasm_reloadSchema: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
567
|
+
readonly jsonevalwasm_reloadSchemaFromCache: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
568
|
+
readonly jsonevalwasm_reloadSchemaMsgpack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
569
|
+
readonly jsonevalwasm_resolveLayout: (a: number, b: number, c: number) => void;
|
|
570
|
+
readonly jsonevalwasm_resolveLayoutSubform: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
571
|
+
readonly jsonevalwasm_runLogic: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
572
|
+
readonly jsonevalwasm_setTimezoneOffset: (a: number, b: number) => void;
|
|
573
|
+
readonly jsonevalwasm_validate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
574
|
+
readonly jsonevalwasm_validateJS: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
575
|
+
readonly jsonevalwasm_validatePaths: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
576
|
+
readonly jsonevalwasm_validatePathsJS: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
577
|
+
readonly jsonevalwasm_validateSubform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
578
|
+
readonly validationerror_code: (a: number, b: number) => void;
|
|
579
|
+
readonly validationerror_data: (a: number) => number;
|
|
580
|
+
readonly validationerror_field_value: (a: number, b: number) => void;
|
|
581
|
+
readonly validationerror_message: (a: number, b: number) => void;
|
|
582
|
+
readonly validationerror_path: (a: number, b: number) => void;
|
|
583
|
+
readonly validationerror_pattern: (a: number, b: number) => void;
|
|
584
|
+
readonly validationerror_rule_type: (a: number, b: number) => void;
|
|
585
|
+
readonly validationresult_errors: (a: number, b: number) => void;
|
|
586
|
+
readonly validationresult_has_error: (a: number) => number;
|
|
587
|
+
readonly validationresult_toJSON: (a: number, b: number) => void;
|
|
588
|
+
readonly init: () => void;
|
|
589
|
+
readonly version: (a: number) => void;
|
|
590
|
+
readonly __wbindgen_export_0: (a: number, b: number) => number;
|
|
591
|
+
readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
592
|
+
readonly __wbindgen_export_2: (a: number, b: number, c: number) => void;
|
|
593
|
+
readonly __wbindgen_export_3: (a: number) => void;
|
|
594
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
595
|
+
readonly __wbindgen_start: () => void;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
599
|
+
/**
|
|
600
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
601
|
+
* a precompiled `WebAssembly.Module`.
|
|
602
|
+
*
|
|
603
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
604
|
+
*
|
|
605
|
+
* @returns {InitOutput}
|
|
606
|
+
*/
|
|
607
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
611
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
612
|
+
*
|
|
613
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
614
|
+
*
|
|
615
|
+
* @returns {Promise<InitOutput>}
|
|
616
|
+
*/
|
|
617
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|