@promptbook/core 0.31.0-1 → 0.31.0-10

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 (41) hide show
  1. package/esm/index.es.js +73 -5
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/_packages/types.index.d.ts +2 -1
  4. package/esm/typings/_packages/utils.index.d.ts +6 -2
  5. package/esm/typings/types/execution-report/ExecutionReportStringOptions.d.ts +13 -0
  6. package/esm/typings/types/execution-report/config.d.ts +8 -0
  7. package/esm/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
  8. package/esm/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
  9. package/esm/typings/types/execution-report/executionReportJsonToString.d.ts +5 -1
  10. package/esm/typings/utils/FromtoItems.d.ts +19 -0
  11. package/esm/typings/utils/extractParameters.d.ts +2 -0
  12. package/esm/typings/utils/extractVariables.d.ts +10 -0
  13. package/esm/typings/utils/extractVariables.test.d.ts +1 -0
  14. package/esm/typings/utils/formatNumber.d.ts +6 -0
  15. package/esm/typings/utils/formatNumber.test.d.ts +1 -0
  16. package/esm/typings/utils/markdown/createMarkdownChart.d.ts +37 -0
  17. package/esm/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
  18. package/esm/typings/utils/markdown/createMarkdownTable.d.ts +7 -0
  19. package/esm/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
  20. package/esm/typings/utils/replaceParameters.d.ts +2 -0
  21. package/package.json +1 -1
  22. package/umd/index.umd.js +73 -5
  23. package/umd/index.umd.js.map +1 -1
  24. package/umd/typings/_packages/types.index.d.ts +2 -1
  25. package/umd/typings/_packages/utils.index.d.ts +6 -2
  26. package/umd/typings/types/execution-report/ExecutionReportStringOptions.d.ts +13 -0
  27. package/umd/typings/types/execution-report/config.d.ts +8 -0
  28. package/umd/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
  29. package/umd/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
  30. package/umd/typings/types/execution-report/executionReportJsonToString.d.ts +5 -1
  31. package/umd/typings/utils/FromtoItems.d.ts +19 -0
  32. package/umd/typings/utils/extractParameters.d.ts +2 -0
  33. package/umd/typings/utils/extractVariables.d.ts +10 -0
  34. package/umd/typings/utils/extractVariables.test.d.ts +1 -0
  35. package/umd/typings/utils/formatNumber.d.ts +6 -0
  36. package/umd/typings/utils/formatNumber.test.d.ts +1 -0
  37. package/umd/typings/utils/markdown/createMarkdownChart.d.ts +37 -0
  38. package/umd/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
  39. package/umd/typings/utils/markdown/createMarkdownTable.d.ts +7 -0
  40. package/umd/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
  41. package/umd/typings/utils/replaceParameters.d.ts +2 -0
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Represents items which are compared to each other
3
+ */
4
+ export type FromtoItems = Array<{
5
+ /**
6
+ * The title of the item
7
+ */
8
+ title: string;
9
+ /**
10
+ * The start of the item
11
+ *
12
+ * This can mean anything, like seconds, milliseconds, dollars, etc.
13
+ */
14
+ from: number;
15
+ /**
16
+ * The end of the item
17
+ */
18
+ to: number;
19
+ }>;
@@ -4,5 +4,7 @@ import { string_name, string_template } from '../types/typeAliases';
4
4
  *
5
5
  * @param template the template with parameters in {curly} braces
6
6
  * @returns the list of parameter names
7
+ *
8
+ * @private within the library
7
9
  */
8
10
  export declare function extractParameters(template: string_template): Array<string_name>;
@@ -0,0 +1,10 @@
1
+ import { string_javascript, string_javascript_name } from '../types/typeAliases';
2
+ /**
3
+ * Parses the given script and returns the list of all used variables that are not defined in the script
4
+ *
5
+ * @param script from which to extract the variables
6
+ * @returns the list of variable names
7
+ *
8
+ * @private within the library
9
+ */
10
+ export declare function extractVariables(script: string_javascript): Array<string_javascript_name>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Format either small or big number
3
+ *
4
+ * @private within the library
5
+ */
6
+ export declare function formatNumber(value: number): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { string_markdown } from '../../types/typeAliases';
2
+ import { FromtoItems } from '../FromtoItems';
3
+ /**
4
+ * Options for creating a markdown chart
5
+ */
6
+ /**
7
+ * Options for creating a markdown chart.
8
+ */
9
+ type CreateMarkdownChartOptions = {
10
+ /**
11
+ * The header for the first column - the name of the item
12
+ */
13
+ nameHeader: string;
14
+ /**
15
+ * The header for the second column - the value of the item
16
+ */
17
+ valueHeader: string;
18
+ /**
19
+ * The items to be charted
20
+ */
21
+ items: FromtoItems;
22
+ /**
23
+ * The width of the chart in squares
24
+ */
25
+ width: number;
26
+ /**
27
+ * The name of the unit shown in the chart
28
+ */
29
+ unitName: string;
30
+ };
31
+ /**
32
+ * Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
33
+ *
34
+ * @private within the library
35
+ */
36
+ export declare function createMarkdownChart(options: CreateMarkdownChartOptions): string_markdown;
37
+ export {};
@@ -0,0 +1,7 @@
1
+ import { string_markdown, string_markdown_text } from '../../types/typeAliases';
2
+ /**
3
+ * Create a markdown table from a 2D array of strings
4
+ *
5
+ * @private within the library
6
+ */
7
+ export declare function createMarkdownTable(table: Array<Array<string_markdown_text>>): string_markdown;
@@ -6,5 +6,7 @@ import { Parameters } from '../types/Parameters';
6
6
  * @param template the template with parameters in {curly} braces
7
7
  * @param parameters the object with parameters
8
8
  * @returns the template with replaced parameters
9
+ *
10
+ * @private within the library
9
11
  */
10
12
  export declare function replaceParameters(template: string_template, parameters: Parameters): string;