@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
@@ -1,4 +1,4 @@
1
- export function convertHBSBlock(block: any, blockNumber: any): {
1
+ export declare function convertHBSBlock(block: string, blockNumber: number): {
2
2
  variable: string;
3
- value: any;
3
+ value: string;
4
4
  };
package/dist/errors.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export class JsErrorTimeout extends Error {
2
- constructor();
1
+ export declare class JsErrorTimeout extends Error {
3
2
  code: string;
4
3
  }
@@ -1,9 +1,10 @@
1
- export = Helper;
2
- declare class Helper {
3
- constructor(name: any, fn: any, useValueFallback?: boolean);
4
- name: any;
5
- fn: any;
6
- useValueFallback: boolean;
7
- register(handlebars: any): void;
8
- unregister(handlebars: any): void;
1
+ export default class Helper {
2
+ private name;
3
+ private fn;
4
+ private useValueFallback;
5
+ constructor(name: string, fn: any, useValueFallback?: boolean);
6
+ register(handlebars: typeof Handlebars): void;
7
+ unregister(handlebars: {
8
+ unregisterHelper: any;
9
+ }): void;
9
10
  }
@@ -1,8 +1,8 @@
1
- export const HelperFunctionBuiltin: string[];
2
- export namespace HelperFunctionNames {
3
- let OBJECT: string;
4
- let ALL: string;
5
- let LITERAL: string;
6
- let JS: string;
7
- }
8
- export const LITERAL_MARKER: "%LITERAL%";
1
+ export declare const HelperFunctionBuiltin: string[];
2
+ export declare const HelperFunctionNames: {
3
+ OBJECT: string;
4
+ ALL: string;
5
+ LITERAL: string;
6
+ JS: string;
7
+ };
8
+ export declare const LITERAL_MARKER = "%LITERAL%";
@@ -1,2 +1,2 @@
1
- export function date(str: any, pattern: any, options: any): string;
2
- export function duration(str: any, pattern: any, format: any): string;
1
+ export declare const date: (str: any, pattern: any, options: any) => string;
2
+ export declare const duration: (str: any, pattern: any, format: any) => string;
@@ -1,15 +1,8 @@
1
- export function registerAll(handlebars: any): void;
2
- export const externalHelperNames: any[] | string[];
3
- export function unregisterAll(handlebars: any): void;
4
- /**
5
- * full list of supported helpers can be found here:
6
- * https://github.com/Budibase/handlebars-helpers
7
- */
8
- declare const EXTERNAL_FUNCTION_COLLECTIONS: string[];
9
- declare namespace ADDED_HELPERS {
10
- export { date };
11
- export { duration };
12
- }
13
- import { date } from "./date";
14
- import { duration } from "./date";
15
- export { EXTERNAL_FUNCTION_COLLECTIONS as externalCollections, ADDED_HELPERS as addedHelpers };
1
+ export declare const externalCollections: string[];
2
+ export declare const addedHelpers: {
3
+ date: (str: any, pattern: any, options: any) => string;
4
+ duration: (str: any, pattern: any, format: any) => string;
5
+ };
6
+ export declare function registerAll(handlebars: typeof Handlebars): void;
7
+ export declare function unregisterAll(handlebars: typeof Handlebars): void;
8
+ export declare let externalHelperNames: any[];
@@ -1,6 +1,5 @@
1
- export function HelperNames(): string[];
2
- export function registerMinimum(handlebars: any): void;
3
- export function registerAll(handlebars: any): void;
4
- export function unregisterAll(handlebars: any): void;
5
- export { getJsHelperList };
6
- import { getJsHelperList } from "./list";
1
+ export { getJsHelperList } from "./list";
2
+ export declare function HelperNames(): string[];
3
+ export declare function registerMinimum(handlebars: typeof Handlebars): void;
4
+ export declare function registerAll(handlebars: typeof Handlebars): void;
5
+ export declare function unregisterAll(handlebars: any): void;
@@ -1,4 +1,7 @@
1
- export function setJSRunner(runner: any): any;
2
- export function removeJSRunner(): void;
3
- export function setOnErrorLog(delegate: any): any;
4
- export function processJS(handlebars: any, context: any): string;
1
+ declare let runJS: ((js: string, context: any) => any) | undefined;
2
+ export declare const setJSRunner: (runner: typeof runJS) => (js: string, context: any) => any;
3
+ export declare const removeJSRunner: () => void;
4
+ declare let onErrorLog: (message: Error) => void;
5
+ export declare const setOnErrorLog: (delegate: typeof onErrorLog) => (message: Error) => void;
6
+ export declare function processJS(handlebars: string, context: any): string;
7
+ export {};
@@ -1,2 +1,2 @@
1
- export function getJsHelperList(): any;
2
- export const helpersToRemoveForJs: string[];
1
+ export declare const helpersToRemoveForJs: string[];
2
+ export declare function getJsHelperList(): Record<string, any>;
package/dist/iife.d.ts CHANGED
@@ -1 +1 @@
1
- export function iifeWrapper(script: any): string;
1
+ export declare const iifeWrapper: (script: string) => string;