zero-query 1.0.9 → 1.1.1

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/types/misc.d.ts CHANGED
@@ -56,7 +56,7 @@ export function safeEval(expr: string, scope: object[]): any;
56
56
  // HTML files. All expressions evaluate in the component's state context
57
57
  // (bare names resolve to `this.state.*`; `props` and `refs` also available).
58
58
  //
59
- // ─── Structural Directives ──────────────────────────────────────────────
59
+ // --- Structural Directives ----------------------------------------------
60
60
  //
61
61
  // z-if="expression" Conditional rendering - element removed when falsy.
62
62
  // z-else-if="expression" Else-if branch (must be immediate sibling of z-if).
@@ -75,7 +75,7 @@ export function safeEval(expr: string, scope: object[]): any;
75
75
  //
76
76
  // z-show="expression" Toggle `display: none` (element stays in DOM).
77
77
  //
78
- // ─── Attribute Directives ───────────────────────────────────────────────
78
+ // --- Attribute Directives -----------------------------------------------
79
79
  //
80
80
  // z-bind:attr="expression" Dynamic attribute binding.
81
81
  // :attr="expression" Shorthand for z-bind:attr.
@@ -94,7 +94,7 @@ export function safeEval(expr: string, scope: object[]): any;
94
94
  // z-html="expression" Set innerHTML from expression (use trusted content only).
95
95
  // z-text="expression" Set textContent from expression (safe, no HTML).
96
96
  //
97
- // ─── Form & Reference Directives ────────────────────────────────────────
97
+ // --- Form & Reference Directives ----------------------------------------
98
98
  //
99
99
  // z-model="stateKey" Two-way binding for form elements.
100
100
  // Supports: input, textarea, select, select[multiple], contenteditable.
@@ -106,7 +106,7 @@ export function safeEval(expr: string, scope: object[]): any;
106
106
  //
107
107
  // z-ref="name" Element reference → this.refs.name.
108
108
  //
109
- // ─── Event Directives ───────────────────────────────────────────────────
109
+ // --- Event Directives ---------------------------------------------------
110
110
  //
111
111
  // @event="method" Event binding with delegation (shorthand).
112
112
  // z-on:event="method" Event binding with delegation (full syntax).
@@ -123,7 +123,7 @@ export function safeEval(expr: string, scope: object[]): any;
123
123
  // .debounce.{ms} Debounce: delay until {ms}ms idle (default 250).
124
124
  // .throttle.{ms} Throttle: invoke at most once per {ms}ms (default 250).
125
125
  //
126
- // ─── Special Directives ─────────────────────────────────────────────────
126
+ // --- Special Directives -------------------------------------------------
127
127
  //
128
128
  // z-cloak Hidden until rendered (auto-removed after mount).
129
129
  // Global CSS: [z-cloak] { display: none !important }.
@@ -132,7 +132,7 @@ export function safeEval(expr: string, scope: object[]): any;
132
132
  // z-pre Skip all directive processing for this element
133
133
  // and its descendants.
134
134
  //
135
- // ─── Slot System ────────────────────────────────────────────────────────
135
+ // --- Slot System --------------------------------------------------------
136
136
  //
137
137
  // <slot> Default slot - replaced with child content
138
138
  // passed by the parent component.
@@ -146,7 +146,7 @@ export function safeEval(expr: string, scope: object[]): any;
146
146
  // <p>Body text</p> (→ default slot)
147
147
  // </my-component>
148
148
  //
149
- // ─── Processing Order ───────────────────────────────────────────────────
149
+ // --- Processing Order ---------------------------------------------------
150
150
  //
151
151
  // 1. z-for (pre-innerHTML expansion)
152
152
  // 2. z-if chain (DOM removal)
@@ -87,7 +87,7 @@ export function effect(fn: () => void): () => void;
87
87
  * b.value = 2;
88
88
  * }); // effects run once with both values updated
89
89
  */
90
- export function batch(fn: () => void): void;
90
+ export function batch<R = void>(fn: () => R): R;
91
91
 
92
92
  /**
93
93
  * Execute a function without tracking signal reads as dependencies.
package/types/store.d.ts CHANGED
@@ -98,8 +98,9 @@ export interface StoreInstance<
98
98
  /**
99
99
  * Batch multiple state changes - subscribers fire once at the end
100
100
  * with only the latest value per key.
101
+ * @returns The callback's return value.
101
102
  */
102
- batch(fn: (state: S) => void): void;
103
+ batch<R = void>(fn: (state: S) => R): R;
103
104
 
104
105
  /**
105
106
  * Save a state snapshot for undo. Call before making changes you want to be undoable.