@budibase/string-templates 2.22.1 → 2.22.3

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.
Files changed (45) hide show
  1. package/dist/bundle.cjs +1 -0
  2. package/dist/bundle.mjs +1 -1
  3. package/dist/conversion/index.d.ts +2 -2
  4. package/dist/errors.d.ts +1 -2
  5. package/dist/helpers/Helper.d.ts +9 -8
  6. package/dist/helpers/constants.d.ts +8 -8
  7. package/dist/helpers/date.d.ts +2 -2
  8. package/dist/helpers/external.d.ts +8 -15
  9. package/dist/helpers/index.d.ts +5 -6
  10. package/dist/helpers/javascript.d.ts +7 -4
  11. package/dist/helpers/list.d.ts +2 -2
  12. package/dist/iife.d.ts +1 -1
  13. package/dist/index.d.ts +1078 -20
  14. package/dist/processors/index.d.ts +3 -2
  15. package/dist/processors/postprocessor.d.ts +7 -7
  16. package/dist/processors/preprocessor.d.ts +10 -10
  17. package/dist/tsconfig.tsbuildinfo +1 -0
  18. package/dist/types.d.ts +8 -0
  19. package/dist/utilities.d.ts +11 -11
  20. package/package.json +13 -13
  21. package/src/conversion/{index.js → index.ts} +13 -11
  22. package/src/errors.ts +3 -0
  23. package/src/helpers/Helper.ts +34 -0
  24. package/src/helpers/{constants.js → constants.ts} +3 -3
  25. package/src/helpers/{date.js → date.ts} +26 -16
  26. package/src/helpers/{external.js → external.ts} +13 -11
  27. package/src/helpers/index.ts +103 -0
  28. package/src/helpers/{javascript.js → javascript.ts} +20 -18
  29. package/src/helpers/{list.js → list.ts} +11 -11
  30. package/src/iife.ts +3 -0
  31. package/src/{index.js → index.ts} +100 -85
  32. package/src/processors/{index.js → index.ts} +7 -6
  33. package/src/processors/postprocessor.ts +56 -0
  34. package/src/processors/preprocessor.ts +82 -0
  35. package/src/types.ts +8 -0
  36. package/src/{utilities.js → utilities.ts} +22 -17
  37. package/dist/index.d.mts +0 -23
  38. package/src/errors.js +0 -11
  39. package/src/helpers/Helper.js +0 -29
  40. package/src/helpers/index.js +0 -100
  41. package/src/iife.js +0 -3
  42. package/src/index.mjs +0 -26
  43. package/src/processors/postprocessor.js +0 -49
  44. package/src/processors/preprocessor.js +0 -78
  45. /package/{manifest.json → src/manifest.json} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,20 +1,1078 @@
1
- export function processObject(object: object | any[], context: object, opts?: object | undefined): Promise<object | any[]>;
2
- export function processString(string: string, context: object, opts?: object | undefined): Promise<string>;
3
- export function processObjectSync(object: object | any[], context: object, opts?: object | undefined): object | any[];
4
- export function processStringSync(string: string, context: object, opts?: object | undefined): string;
5
- export function disableEscaping(string: any): any;
6
- export function makePropSafe(property: string): string;
7
- export function isValid(string: any, opts?: any): boolean;
8
- export function getManifest(): any;
9
- export function isJSBinding(handlebars: any): boolean;
10
- export function encodeJSBinding(javascript: any): string;
11
- export function decodeJSBinding(handlebars: any): string | null;
12
- export function doesContainStrings(template: string, strings: string[]): boolean;
13
- export function findHBSBlocks(string: string): string[];
14
- export function doesContainString(template: string, string: string): boolean;
15
- export function convertToJS(hbs: any): string;
16
- import { FIND_ANY_HBS_REGEX } from "./utilities";
17
- import { helpersToRemoveForJs } from "./helpers/list";
18
- export function defaultJSSetup(): void;
19
- import { iifeWrapper } from "./iife";
20
- export { setJSRunner, setOnErrorLog, FIND_ANY_HBS_REGEX, JsErrorTimeout, helpersToRemoveForJs, iifeWrapper };
1
+ import { ProcessOptions } from "./types";
2
+ export { setJSRunner, setOnErrorLog } from "./helpers/javascript";
3
+ export { iifeWrapper } from "./iife";
4
+ /**
5
+ * Given an input object this will recurse through all props to try and update any handlebars statements within.
6
+ * @param {object|array} object The input structure which is to be recursed, it is important to note that
7
+ * if the structure contains any cycles then this will fail.
8
+ * @param {object} context The context that handlebars should fill data from.
9
+ * @param {object|undefined} [opts] optional - specify some options for processing.
10
+ * @returns {Promise<object|array>} The structure input, as fully updated as possible.
11
+ */
12
+ export declare function processObject<T extends Record<string, any>>(object: T, context: object, opts?: {
13
+ noHelpers?: boolean;
14
+ escapeNewlines?: boolean;
15
+ onlyFound?: boolean;
16
+ }): Promise<T>;
17
+ /**
18
+ * This will process a single handlebars containing string. If the string passed in has no valid handlebars statements
19
+ * then nothing will occur.
20
+ * @param {string} string The template string which is the filled from the context object.
21
+ * @param {object} context An object of information which will be used to enrich the string.
22
+ * @param {object|undefined} [opts] optional - specify some options for processing.
23
+ * @returns {Promise<string>} The enriched string, all templates should have been replaced if they can be.
24
+ */
25
+ export declare function processString(string: string, context: object, opts?: ProcessOptions): Promise<string>;
26
+ /**
27
+ * Given an input object this will recurse through all props to try and update any handlebars statements within. This is
28
+ * a pure sync call and therefore does not have the full functionality of the async call.
29
+ * @param {object|array} object The input structure which is to be recursed, it is important to note that
30
+ * if the structure contains any cycles then this will fail.
31
+ * @param {object} context The context that handlebars should fill data from.
32
+ * @param {object|undefined} [opts] optional - specify some options for processing.
33
+ * @returns {object|array} The structure input, as fully updated as possible.
34
+ */
35
+ export declare function processObjectSync(object: {
36
+ [x: string]: any;
37
+ }, context: any, opts: any): object | Array<any>;
38
+ /**
39
+ * This will process a single handlebars containing string. If the string passed in has no valid handlebars statements
40
+ * then nothing will occur. This is a pure sync call and therefore does not have the full functionality of the async call.
41
+ * @param {string} string The template string which is the filled from the context object.
42
+ * @param {object} context An object of information which will be used to enrich the string.
43
+ * @param {object|undefined} [opts] optional - specify some options for processing.
44
+ * @returns {string} The enriched string, all templates should have been replaced if they can be.
45
+ */
46
+ export declare function processStringSync(string: string, context?: object, opts?: ProcessOptions): string;
47
+ /**
48
+ * By default with expressions like {{ name }} handlebars will escape various
49
+ * characters, which can be problematic. To fix this we use the syntax {{{ name }}},
50
+ * this function will find any double braces and switch to triple.
51
+ * @param string the string to have double HBS statements converted to triple.
52
+ */
53
+ export declare function disableEscaping(string: string): string;
54
+ /**
55
+ * Simple utility function which makes sure that a templating property has been wrapped in literal specifiers correctly.
56
+ * @param {string} property The property which is to be wrapped.
57
+ * @returns {string} The wrapped property ready to be added to a templating string.
58
+ */
59
+ export declare function makePropSafe(property: any): string;
60
+ /**
61
+ * Checks whether or not a template string contains totally valid syntax (simply tries running it)
62
+ * @param string The string to test for valid syntax - this may contain no templates and will be considered valid.
63
+ * @param [opts] optional - specify some options for processing.
64
+ * @returns {boolean} Whether or not the input string is valid.
65
+ */
66
+ export declare function isValid(string: any, opts?: any): boolean;
67
+ /**
68
+ * We have generated a static manifest file from the helpers that this string templating package makes use of.
69
+ * This manifest provides information about each of the helpers and how it can be used.
70
+ * @returns The manifest JSON which has been generated from the helpers.
71
+ */
72
+ export declare function getManifest(): {
73
+ math: {
74
+ abs: {
75
+ args: string[];
76
+ numArgs: number;
77
+ example: string;
78
+ description: string;
79
+ requiresBlock: boolean;
80
+ };
81
+ add: {
82
+ args: string[];
83
+ numArgs: number;
84
+ example: string;
85
+ description: string;
86
+ requiresBlock: boolean;
87
+ };
88
+ avg: {
89
+ args: string[];
90
+ numArgs: number;
91
+ example: string;
92
+ description: string;
93
+ requiresBlock: boolean;
94
+ };
95
+ ceil: {
96
+ args: string[];
97
+ numArgs: number;
98
+ example: string;
99
+ description: string;
100
+ requiresBlock: boolean;
101
+ };
102
+ divide: {
103
+ args: string[];
104
+ numArgs: number;
105
+ example: string;
106
+ description: string;
107
+ requiresBlock: boolean;
108
+ };
109
+ floor: {
110
+ args: string[];
111
+ numArgs: number;
112
+ example: string;
113
+ description: string;
114
+ requiresBlock: boolean;
115
+ };
116
+ minus: {
117
+ args: string[];
118
+ numArgs: number;
119
+ example: string;
120
+ description: string;
121
+ requiresBlock: boolean;
122
+ };
123
+ modulo: {
124
+ args: string[];
125
+ numArgs: number;
126
+ example: string;
127
+ description: string;
128
+ requiresBlock: boolean;
129
+ };
130
+ multiply: {
131
+ args: string[];
132
+ numArgs: number;
133
+ example: string;
134
+ description: string;
135
+ requiresBlock: boolean;
136
+ };
137
+ plus: {
138
+ args: string[];
139
+ numArgs: number;
140
+ example: string;
141
+ description: string;
142
+ requiresBlock: boolean;
143
+ };
144
+ random: {
145
+ args: string[];
146
+ numArgs: number;
147
+ example: string;
148
+ description: string;
149
+ requiresBlock: boolean;
150
+ };
151
+ remainder: {
152
+ args: string[];
153
+ numArgs: number;
154
+ example: string;
155
+ description: string;
156
+ requiresBlock: boolean;
157
+ };
158
+ round: {
159
+ args: string[];
160
+ numArgs: number;
161
+ example: string;
162
+ description: string;
163
+ requiresBlock: boolean;
164
+ };
165
+ subtract: {
166
+ args: string[];
167
+ numArgs: number;
168
+ example: string;
169
+ description: string;
170
+ requiresBlock: boolean;
171
+ };
172
+ /**
173
+ * This will process a single handlebars containing string. If the string passed in has no valid handlebars statements
174
+ * then nothing will occur.
175
+ * @param {string} string The template string which is the filled from the context object.
176
+ * @param {object} context An object of information which will be used to enrich the string.
177
+ * @param {object|undefined} [opts] optional - specify some options for processing.
178
+ * @returns {Promise<string>} The enriched string, all templates should have been replaced if they can be.
179
+ */
180
+ sum: {
181
+ args: string[];
182
+ numArgs: number;
183
+ example: string;
184
+ description: string;
185
+ requiresBlock: boolean;
186
+ };
187
+ };
188
+ array: {
189
+ after: {
190
+ args: string[];
191
+ numArgs: number;
192
+ example: string;
193
+ description: string;
194
+ requiresBlock: boolean;
195
+ };
196
+ arrayify: {
197
+ args: string[];
198
+ numArgs: number;
199
+ example: string;
200
+ description: string;
201
+ requiresBlock: boolean;
202
+ };
203
+ before: {
204
+ args: string[];
205
+ numArgs: number;
206
+ example: string;
207
+ description: string;
208
+ requiresBlock: boolean;
209
+ };
210
+ eachIndex: {
211
+ args: string[];
212
+ numArgs: number;
213
+ example: string;
214
+ description: string;
215
+ requiresBlock: boolean;
216
+ };
217
+ filter: {
218
+ args: string[];
219
+ numArgs: number;
220
+ example: string;
221
+ description: string;
222
+ requiresBlock: boolean;
223
+ };
224
+ first: {
225
+ args: string[];
226
+ numArgs: number;
227
+ example: string;
228
+ description: string;
229
+ requiresBlock: boolean;
230
+ };
231
+ forEach: {
232
+ args: string[];
233
+ numArgs: number;
234
+ example: string;
235
+ description: string;
236
+ requiresBlock: boolean;
237
+ };
238
+ inArray: {
239
+ args: string[];
240
+ numArgs: number;
241
+ example: string;
242
+ description: string;
243
+ requiresBlock: boolean;
244
+ };
245
+ isArray: {
246
+ args: string[];
247
+ numArgs: number;
248
+ example: string;
249
+ description: string;
250
+ requiresBlock: boolean;
251
+ };
252
+ itemAt: {
253
+ args: string[];
254
+ numArgs: number;
255
+ example: string;
256
+ description: string;
257
+ requiresBlock: boolean;
258
+ };
259
+ join: {
260
+ args: string[];
261
+ numArgs: number;
262
+ example: string;
263
+ description: string;
264
+ requiresBlock: boolean;
265
+ };
266
+ equalsLength: {
267
+ args: string[];
268
+ numArgs: number;
269
+ example: string;
270
+ description: string;
271
+ requiresBlock: boolean;
272
+ };
273
+ last: {
274
+ args: string[];
275
+ numArgs: number;
276
+ example: string;
277
+ description: string;
278
+ requiresBlock: boolean;
279
+ };
280
+ length: {
281
+ args: string[];
282
+ numArgs: number;
283
+ example: string;
284
+ description: string;
285
+ requiresBlock: boolean;
286
+ };
287
+ lengthEqual: {
288
+ args: string[];
289
+ numArgs: number;
290
+ example: string;
291
+ description: string;
292
+ requiresBlock: boolean;
293
+ };
294
+ map: {
295
+ args: string[];
296
+ numArgs: number;
297
+ example: string;
298
+ description: string;
299
+ requiresBlock: boolean;
300
+ };
301
+ pluck: {
302
+ args: string[];
303
+ numArgs: number;
304
+ example: string;
305
+ description: string;
306
+ requiresBlock: boolean;
307
+ };
308
+ reverse: {
309
+ args: string[];
310
+ numArgs: number;
311
+ example: string;
312
+ description: string;
313
+ requiresBlock: boolean;
314
+ };
315
+ some: {
316
+ args: string[];
317
+ numArgs: number;
318
+ example: string;
319
+ description: string;
320
+ requiresBlock: boolean;
321
+ };
322
+ sort: {
323
+ args: string[];
324
+ numArgs: number;
325
+ example: string;
326
+ description: string;
327
+ requiresBlock: boolean;
328
+ };
329
+ sortBy: {
330
+ args: string[];
331
+ numArgs: number;
332
+ example: string;
333
+ description: string;
334
+ requiresBlock: boolean;
335
+ };
336
+ withAfter: {
337
+ args: string[];
338
+ numArgs: number;
339
+ example: string;
340
+ description: string;
341
+ requiresBlock: boolean;
342
+ };
343
+ withBefore: {
344
+ args: string[];
345
+ numArgs: number;
346
+ example: string;
347
+ description: string;
348
+ requiresBlock: boolean;
349
+ };
350
+ withFirst: {
351
+ args: string[];
352
+ numArgs: number;
353
+ example: string;
354
+ description: string;
355
+ requiresBlock: boolean;
356
+ };
357
+ withGroup: {
358
+ args: string[];
359
+ numArgs: number;
360
+ example: string;
361
+ description: string;
362
+ requiresBlock: boolean;
363
+ };
364
+ withLast: {
365
+ args: string[];
366
+ numArgs: number;
367
+ example: string;
368
+ description: string;
369
+ requiresBlock: boolean;
370
+ };
371
+ withSort: {
372
+ args: string[];
373
+ numArgs: number;
374
+ example: string;
375
+ description: string;
376
+ requiresBlock: boolean;
377
+ };
378
+ unique: {
379
+ args: string[];
380
+ numArgs: number;
381
+ example: string;
382
+ description: string;
383
+ requiresBlock: boolean;
384
+ };
385
+ };
386
+ number: {
387
+ bytes: {
388
+ args: string[];
389
+ numArgs: number;
390
+ example: string;
391
+ description: string;
392
+ requiresBlock: boolean;
393
+ };
394
+ addCommas: {
395
+ args: string[];
396
+ numArgs: number;
397
+ example: string;
398
+ description: string;
399
+ requiresBlock: boolean;
400
+ };
401
+ phoneNumber: {
402
+ args: string[];
403
+ numArgs: number;
404
+ example: string;
405
+ description: string;
406
+ requiresBlock: boolean;
407
+ };
408
+ toAbbr: {
409
+ args: string[];
410
+ numArgs: number;
411
+ example: string;
412
+ description: string;
413
+ requiresBlock: boolean;
414
+ };
415
+ toExponential: {
416
+ args: string[];
417
+ numArgs: number;
418
+ example: string;
419
+ description: string;
420
+ requiresBlock: boolean;
421
+ };
422
+ toFixed: {
423
+ args: string[];
424
+ numArgs: number;
425
+ example: string;
426
+ description: string;
427
+ requiresBlock: boolean;
428
+ };
429
+ toFloat: {
430
+ args: string[];
431
+ numArgs: number;
432
+ description: string;
433
+ requiresBlock: boolean;
434
+ };
435
+ toInt: {
436
+ args: string[];
437
+ numArgs: number;
438
+ description: string;
439
+ requiresBlock: boolean;
440
+ };
441
+ toPrecision: {
442
+ args: string[];
443
+ numArgs: number;
444
+ example: string;
445
+ description: string;
446
+ requiresBlock: boolean;
447
+ };
448
+ };
449
+ url: {
450
+ encodeURI: {
451
+ args: string[];
452
+ numArgs: number;
453
+ example: string;
454
+ description: string;
455
+ requiresBlock: boolean;
456
+ };
457
+ escape: {
458
+ args: string[];
459
+ numArgs: number;
460
+ example: string;
461
+ description: string;
462
+ requiresBlock: boolean;
463
+ };
464
+ decodeURI: {
465
+ args: string[];
466
+ numArgs: number;
467
+ example: string;
468
+ description: string;
469
+ requiresBlock: boolean;
470
+ };
471
+ urlResolve: {
472
+ args: string[];
473
+ numArgs: number;
474
+ example: string;
475
+ description: string;
476
+ requiresBlock: boolean;
477
+ };
478
+ urlParse: {
479
+ args: string[];
480
+ numArgs: number;
481
+ example: string;
482
+ description: string;
483
+ requiresBlock: boolean;
484
+ };
485
+ stripQuerystring: {
486
+ args: string[];
487
+ numArgs: number;
488
+ example: string;
489
+ description: string;
490
+ requiresBlock: boolean;
491
+ };
492
+ stripProtocol: {
493
+ args: string[];
494
+ numArgs: number;
495
+ example: string;
496
+ description: string;
497
+ requiresBlock: boolean;
498
+ };
499
+ };
500
+ string: {
501
+ append: {
502
+ args: string[];
503
+ numArgs: number;
504
+ example: string;
505
+ description: string;
506
+ requiresBlock: boolean;
507
+ };
508
+ camelcase: {
509
+ args: string[];
510
+ numArgs: number;
511
+ example: string;
512
+ description: string;
513
+ requiresBlock: boolean;
514
+ };
515
+ capitalize: {
516
+ args: string[];
517
+ numArgs: number;
518
+ example: string;
519
+ description: string;
520
+ requiresBlock: boolean;
521
+ };
522
+ capitalizeAll: {
523
+ args: string[];
524
+ numArgs: number;
525
+ example: string;
526
+ description: string;
527
+ requiresBlock: boolean;
528
+ };
529
+ center: {
530
+ args: string[];
531
+ numArgs: number;
532
+ example: string;
533
+ description: string;
534
+ requiresBlock: boolean;
535
+ };
536
+ chop: {
537
+ args: string[];
538
+ numArgs: number;
539
+ example: string;
540
+ description: string;
541
+ requiresBlock: boolean;
542
+ };
543
+ dashcase: {
544
+ args: string[];
545
+ numArgs: number;
546
+ example: string;
547
+ description: string;
548
+ requiresBlock: boolean;
549
+ };
550
+ dotcase: {
551
+ args: string[];
552
+ numArgs: number;
553
+ example: string;
554
+ description: string;
555
+ requiresBlock: boolean;
556
+ };
557
+ downcase: {
558
+ args: string[];
559
+ numArgs: number;
560
+ example: string;
561
+ description: string;
562
+ requiresBlock: boolean;
563
+ };
564
+ ellipsis: {
565
+ args: string[];
566
+ numArgs: number;
567
+ example: string;
568
+ description: string;
569
+ requiresBlock: boolean;
570
+ };
571
+ hyphenate: {
572
+ args: string[];
573
+ numArgs: number;
574
+ example: string;
575
+ description: string;
576
+ requiresBlock: boolean;
577
+ };
578
+ isString: {
579
+ args: string[];
580
+ numArgs: number;
581
+ example: string;
582
+ description: string;
583
+ requiresBlock: boolean;
584
+ };
585
+ lowercase: {
586
+ args: string[];
587
+ numArgs: number;
588
+ example: string;
589
+ description: string;
590
+ requiresBlock: boolean;
591
+ };
592
+ occurrences: {
593
+ args: string[];
594
+ numArgs: number;
595
+ example: string;
596
+ description: string;
597
+ requiresBlock: boolean;
598
+ };
599
+ pascalcase: {
600
+ args: string[];
601
+ numArgs: number;
602
+ example: string;
603
+ description: string;
604
+ requiresBlock: boolean;
605
+ };
606
+ pathcase: {
607
+ args: string[];
608
+ numArgs: number;
609
+ example: string;
610
+ description: string;
611
+ requiresBlock: boolean;
612
+ };
613
+ plusify: {
614
+ args: string[];
615
+ numArgs: number;
616
+ example: string;
617
+ description: string;
618
+ requiresBlock: boolean;
619
+ };
620
+ prepend: {
621
+ args: string[];
622
+ numArgs: number;
623
+ example: string;
624
+ description: string;
625
+ requiresBlock: boolean;
626
+ };
627
+ remove: {
628
+ args: string[];
629
+ numArgs: number;
630
+ example: string;
631
+ description: string;
632
+ requiresBlock: boolean;
633
+ };
634
+ removeFirst: {
635
+ args: string[];
636
+ numArgs: number;
637
+ example: string;
638
+ description: string;
639
+ requiresBlock: boolean;
640
+ };
641
+ replace: {
642
+ args: string[];
643
+ numArgs: number;
644
+ example: string;
645
+ description: string;
646
+ requiresBlock: boolean;
647
+ };
648
+ replaceFirst: {
649
+ args: string[];
650
+ numArgs: number;
651
+ example: string;
652
+ description: string;
653
+ requiresBlock: boolean;
654
+ };
655
+ sentence: {
656
+ args: string[];
657
+ numArgs: number;
658
+ example: string;
659
+ description: string;
660
+ requiresBlock: boolean;
661
+ };
662
+ snakecase: {
663
+ args: string[];
664
+ numArgs: number;
665
+ example: string;
666
+ description: string;
667
+ requiresBlock: boolean;
668
+ };
669
+ split: {
670
+ args: string[];
671
+ numArgs: number;
672
+ example: string;
673
+ description: string;
674
+ requiresBlock: boolean;
675
+ };
676
+ startsWith: {
677
+ args: string[];
678
+ numArgs: number;
679
+ example: string;
680
+ description: string;
681
+ requiresBlock: boolean;
682
+ };
683
+ titleize: {
684
+ args: string[];
685
+ numArgs: number;
686
+ example: string;
687
+ description: string;
688
+ requiresBlock: boolean;
689
+ };
690
+ trim: {
691
+ args: string[];
692
+ numArgs: number;
693
+ example: string;
694
+ description: string;
695
+ requiresBlock: boolean;
696
+ };
697
+ trimLeft: {
698
+ args: string[];
699
+ numArgs: number;
700
+ example: string;
701
+ description: string;
702
+ requiresBlock: boolean;
703
+ };
704
+ trimRight: {
705
+ args: string[];
706
+ numArgs: number;
707
+ example: string;
708
+ description: string;
709
+ requiresBlock: boolean;
710
+ };
711
+ truncate: {
712
+ args: string[];
713
+ numArgs: number;
714
+ example: string;
715
+ description: string;
716
+ requiresBlock: boolean;
717
+ };
718
+ truncateWords: {
719
+ args: string[];
720
+ numArgs: number;
721
+ example: string;
722
+ description: string;
723
+ requiresBlock: boolean;
724
+ };
725
+ upcase: {
726
+ args: string[];
727
+ numArgs: number;
728
+ example: string;
729
+ description: string;
730
+ requiresBlock: boolean;
731
+ };
732
+ uppercase: {
733
+ args: string[];
734
+ numArgs: number;
735
+ example: string;
736
+ description: string;
737
+ requiresBlock: boolean;
738
+ };
739
+ };
740
+ comparison: {
741
+ and: {
742
+ args: string[];
743
+ numArgs: number;
744
+ example: string;
745
+ description: string;
746
+ requiresBlock: boolean;
747
+ };
748
+ compare: {
749
+ args: string[];
750
+ numArgs: number;
751
+ example: string;
752
+ description: string;
753
+ requiresBlock: boolean;
754
+ };
755
+ contains: {
756
+ args: string[];
757
+ numArgs: number;
758
+ example: string;
759
+ description: string;
760
+ requiresBlock: boolean;
761
+ };
762
+ default: {
763
+ args: string[];
764
+ numArgs: number;
765
+ example: string;
766
+ description: string;
767
+ requiresBlock: boolean;
768
+ };
769
+ eq: {
770
+ args: string[];
771
+ numArgs: number;
772
+ example: string;
773
+ description: string;
774
+ requiresBlock: boolean;
775
+ };
776
+ gt: {
777
+ args: string[];
778
+ numArgs: number;
779
+ example: string;
780
+ description: string;
781
+ requiresBlock: boolean;
782
+ };
783
+ gte: {
784
+ args: string[];
785
+ numArgs: number;
786
+ example: string;
787
+ description: string;
788
+ requiresBlock: boolean;
789
+ };
790
+ has: {
791
+ args: string[];
792
+ numArgs: number;
793
+ example: string;
794
+ description: string;
795
+ requiresBlock: boolean;
796
+ };
797
+ isFalsey: {
798
+ args: string[];
799
+ numArgs: number;
800
+ example: string;
801
+ description: string;
802
+ requiresBlock: boolean;
803
+ };
804
+ isTruthy: {
805
+ args: string[];
806
+ numArgs: number;
807
+ example: string;
808
+ description: string;
809
+ requiresBlock: boolean;
810
+ };
811
+ ifEven: {
812
+ args: string[];
813
+ numArgs: number;
814
+ example: string;
815
+ description: string;
816
+ requiresBlock: boolean;
817
+ };
818
+ ifNth: {
819
+ args: string[];
820
+ numArgs: number;
821
+ example: string;
822
+ description: string;
823
+ requiresBlock: boolean;
824
+ };
825
+ ifOdd: {
826
+ args: string[];
827
+ numArgs: number;
828
+ example: string;
829
+ description: string;
830
+ requiresBlock: boolean;
831
+ };
832
+ is: {
833
+ args: string[];
834
+ numArgs: number;
835
+ example: string;
836
+ description: string;
837
+ requiresBlock: boolean;
838
+ };
839
+ isnt: {
840
+ args: string[];
841
+ numArgs: number;
842
+ example: string;
843
+ description: string;
844
+ requiresBlock: boolean;
845
+ };
846
+ lt: {
847
+ args: string[];
848
+ numArgs: number;
849
+ example: string;
850
+ description: string;
851
+ requiresBlock: boolean;
852
+ };
853
+ lte: {
854
+ args: string[];
855
+ numArgs: number;
856
+ example: string;
857
+ description: string;
858
+ requiresBlock: boolean;
859
+ };
860
+ neither: {
861
+ args: string[];
862
+ numArgs: number;
863
+ example: string;
864
+ description: string;
865
+ requiresBlock: boolean;
866
+ };
867
+ not: {
868
+ args: string[];
869
+ numArgs: number;
870
+ example: string;
871
+ description: string;
872
+ requiresBlock: boolean;
873
+ };
874
+ or: {
875
+ args: string[];
876
+ numArgs: number;
877
+ example: string;
878
+ description: string;
879
+ requiresBlock: boolean;
880
+ };
881
+ unlessEq: {
882
+ args: string[];
883
+ numArgs: number;
884
+ example: string;
885
+ description: string;
886
+ requiresBlock: boolean;
887
+ };
888
+ unlessGt: {
889
+ args: string[];
890
+ numArgs: number;
891
+ example: string;
892
+ description: string;
893
+ requiresBlock: boolean;
894
+ };
895
+ unlessLt: {
896
+ args: string[];
897
+ numArgs: number;
898
+ example: string;
899
+ description: string;
900
+ requiresBlock: boolean;
901
+ };
902
+ unlessGteq: {
903
+ args: string[];
904
+ numArgs: number;
905
+ example: string;
906
+ description: string;
907
+ requiresBlock: boolean;
908
+ };
909
+ unlessLteq: {
910
+ args: string[];
911
+ numArgs: number;
912
+ example: string;
913
+ description: string;
914
+ requiresBlock: boolean;
915
+ };
916
+ };
917
+ object: {
918
+ extend: {
919
+ args: string[];
920
+ numArgs: number;
921
+ description: string;
922
+ requiresBlock: boolean;
923
+ };
924
+ forIn: {
925
+ args: string[];
926
+ numArgs: number;
927
+ description: string;
928
+ requiresBlock: boolean;
929
+ };
930
+ forOwn: {
931
+ args: string[];
932
+ numArgs: number;
933
+ description: string;
934
+ requiresBlock: boolean;
935
+ };
936
+ toPath: {
937
+ args: string[];
938
+ numArgs: number;
939
+ description: string;
940
+ requiresBlock: boolean;
941
+ };
942
+ get: {
943
+ args: string[];
944
+ numArgs: number;
945
+ description: string;
946
+ requiresBlock: boolean;
947
+ };
948
+ getObject: {
949
+ args: string[];
950
+ numArgs: number;
951
+ description: string;
952
+ requiresBlock: boolean;
953
+ };
954
+ hasOwn: {
955
+ args: string[];
956
+ numArgs: number;
957
+ description: string;
958
+ requiresBlock: boolean;
959
+ };
960
+ isObject: {
961
+ args: string[];
962
+ numArgs: number;
963
+ description: string;
964
+ requiresBlock: boolean;
965
+ };
966
+ JSONparse: {
967
+ args: string[];
968
+ numArgs: number;
969
+ description: string;
970
+ requiresBlock: boolean;
971
+ };
972
+ JSONstringify: {
973
+ args: string[];
974
+ numArgs: number;
975
+ description: string;
976
+ requiresBlock: boolean;
977
+ };
978
+ merge: {
979
+ args: string[];
980
+ numArgs: number;
981
+ description: string;
982
+ requiresBlock: boolean;
983
+ };
984
+ parseJSON: {
985
+ args: string[];
986
+ numArgs: number;
987
+ description: string;
988
+ requiresBlock: boolean;
989
+ };
990
+ pick: {
991
+ args: string[];
992
+ numArgs: number;
993
+ description: string;
994
+ requiresBlock: boolean;
995
+ };
996
+ stringify: {
997
+ args: string[];
998
+ numArgs: number;
999
+ description: string;
1000
+ requiresBlock: boolean;
1001
+ };
1002
+ };
1003
+ uuid: {
1004
+ uuid: {
1005
+ args: any[];
1006
+ numArgs: number;
1007
+ example: string;
1008
+ description: string;
1009
+ requiresBlock: boolean;
1010
+ };
1011
+ };
1012
+ date: {
1013
+ date: {
1014
+ args: string[];
1015
+ numArgs: number;
1016
+ example: string;
1017
+ description: string;
1018
+ };
1019
+ duration: {
1020
+ args: string[];
1021
+ numArgs: number;
1022
+ example: string;
1023
+ description: string;
1024
+ };
1025
+ };
1026
+ };
1027
+ /**
1028
+ * Checks if a HBS expression is a valid JS HBS expression
1029
+ * @param handlebars the HBS expression to check
1030
+ * @returns {boolean} whether the expression is JS or not
1031
+ */
1032
+ export declare function isJSBinding(handlebars: any): boolean;
1033
+ /**
1034
+ * Encodes a raw JS string as a JS HBS expression
1035
+ * @param javascript the JS code to encode
1036
+ * @returns {string} the JS HBS expression
1037
+ */
1038
+ export declare function encodeJSBinding(javascript: string): string;
1039
+ /**
1040
+ * Decodes a JS HBS expression to the raw JS code
1041
+ * @param handlebars the JS HBS expression
1042
+ * @returns {string|null} the raw JS code
1043
+ */
1044
+ export declare function decodeJSBinding(handlebars: string): string | null;
1045
+ /**
1046
+ * Same as the doesContainString function, but will check for all the strings
1047
+ * before confirming it contains.
1048
+ * @param {string} template The template string to search.
1049
+ * @param {string[]} strings The strings to look for.
1050
+ * @returns {boolean} Will return true if all strings found in HBS statement.
1051
+ */
1052
+ export declare function doesContainStrings(template: string, strings: any[]): boolean;
1053
+ /**
1054
+ * Given a string, this will return any {{ binding }} or {{{ binding }}} type
1055
+ * statements.
1056
+ * @param {string} string The string to search within.
1057
+ * @return {string[]} The found HBS blocks.
1058
+ */
1059
+ export declare function findHBSBlocks(string: string): string[];
1060
+ /**
1061
+ * This function looks in the supplied template for handlebars instances, if they contain
1062
+ * JS the JS will be decoded and then the supplied string will be looked for. For example
1063
+ * if the template "Hello, your name is {{ related }}" this function would return that true
1064
+ * for the string "related" but not for "name" as it is not within the handlebars statement.
1065
+ * @param {string} template A template string to search for handlebars instances.
1066
+ * @param {string} string The word or sentence to search for.
1067
+ * @returns {boolean} The this return true if the string is found, false if not.
1068
+ */
1069
+ export declare function doesContainString(template: any, string: any): boolean;
1070
+ export declare function convertToJS(hbs: string): string;
1071
+ declare const _FIND_ANY_HBS_REGEX: RegExp;
1072
+ export { _FIND_ANY_HBS_REGEX as FIND_ANY_HBS_REGEX };
1073
+ export { JsErrorTimeout } from "./errors";
1074
+ declare const _helpersToRemoveForJs: string[];
1075
+ export { _helpersToRemoveForJs as helpersToRemoveForJs };
1076
+ declare function defaultJSSetup(): void;
1077
+ declare const _defaultJSSetup: typeof defaultJSSetup;
1078
+ export { _defaultJSSetup as defaultJSSetup };