eleva 0.1.0-alpha → 1.0.0-alpha

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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * ⚡ Signal: Fine-grained reactivity.
3
+ *
4
+ * A reactive data holder that notifies registered watchers when its value changes,
5
+ * allowing for fine-grained DOM patching rather than full re-renders.
6
+ */
7
+ export class Signal {
8
+ /**
9
+ * Creates a new Signal instance.
10
+ *
11
+ * @param {*} value - The initial value of the signal.
12
+ */
13
+ constructor(value: any);
14
+ _value: any;
15
+ _watchers: Set<any>;
16
+ /**
17
+ * Sets a new value for the signal and notifies all registered watchers if the value has changed.
18
+ *
19
+ * @param {*} newVal - The new value to set.
20
+ */
21
+ set value(newVal: any);
22
+ /**
23
+ * Gets the current value of the signal.
24
+ *
25
+ * @returns {*} The current value.
26
+ */
27
+ get value(): any;
28
+ /**
29
+ * Registers a watcher function that will be called whenever the signal's value changes.
30
+ *
31
+ * @param {Function} fn - The callback function to invoke on value change.
32
+ * @returns {Function} A function to unsubscribe the watcher.
33
+ */
34
+ watch(fn: Function): Function;
35
+ }
36
+ //# sourceMappingURL=Signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../src/modules/Signal.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IACE;;;;OAIG;IACH,mBAFW,GAAC,EAKX;IAFC,YAAmB;IACnB,oBAA0B;IAY5B;;;;OAIG;IACH,kBAFW,GAAC,EAOX;IAnBD;;;;OAIG;IACH,aAFa,GAAC,CAIb;IAcD;;;;;OAKG;IACH,8BAGC;CACF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 🔒 TemplateEngine: Secure interpolation & dynamic attribute parsing.
3
+ *
4
+ * This class provides methods to parse template strings by replacing
5
+ * interpolation expressions with dynamic data values and to evaluate expressions
6
+ * within a given data context.
7
+ */
8
+ export class TemplateEngine {
9
+ /**
10
+ * Parses a template string and replaces interpolation expressions with corresponding values.
11
+ *
12
+ * @param {string} template - The template string containing expressions in the format {{ expression }}.
13
+ * @param {object} data - The data object to use for evaluating expressions.
14
+ * @returns {string} The resulting string with evaluated values.
15
+ */
16
+ static parse(template: string, data: object): string;
17
+ /**
18
+ * Evaluates an expression using the provided data context.
19
+ *
20
+ * @param {string} expr - The JavaScript expression to evaluate.
21
+ * @param {object} data - The data context for evaluating the expression.
22
+ * @returns {*} The result of the evaluated expression, or an empty string if undefined or on error.
23
+ */
24
+ static evaluate(expr: string, data: object): any;
25
+ }
26
+ //# sourceMappingURL=TemplateEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateEngine.d.ts","sourceRoot":"","sources":["../../src/modules/TemplateEngine.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH;IACE;;;;;;OAMG;IACH,uBAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;OAMG;IACH,sBAJW,MAAM,QACN,MAAM,GACJ,GAAC,CAgBb;CACF"}