mates 0.2.0 → 0.2.2

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.
@@ -1,7 +1,7 @@
1
1
  export * from "./atom";
2
+ export * from "./atom";
2
3
  export * from "./createTimedAtom";
3
4
  export * from "./debouncedAtom";
4
- export * from "./atom";
5
5
  export * from "./mapAtom";
6
6
  export * from "./setAtom";
7
7
  export * from "./storageAtom";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/Mutables/atom/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/Mutables/atom/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"x-x.d.ts","sourceRoot":"","sources":["../../lib/Template/x-x.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,2BAA2B,CAAC;AAahF,qBAAa,SAAU,SAAQ,WAAW;IACxC,OAAO,CAAC,MAAM,CAAsB;IAE7B,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,IAAI,SAAe;IAC1B,OAAO,CAAC,KAA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AAS,WAAW,IAAI;IACrD,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7B;;;;;OAKG;IACH,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AA4CF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAC/C,MAAM,EAAE,CAAC,GACR,iBAAiB,CAAC,CAAC,CAAC,CAmDtB;AAID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAQtE"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as lit_html from 'lit-html';
2
2
  import { TemplateResult, nothing } from 'lit-html';
3
3
  export { TemplateResult, html, noChange, nothing, render, svg } from 'lit-html';
4
- export { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
5
4
  export { asyncAppend } from 'lit-html/directives/async-append.js';
6
5
  export { asyncReplace } from 'lit-html/directives/async-replace.js';
7
6
  export { cache as litCache } from 'lit-html/directives/cache.js';
@@ -15,6 +14,7 @@ export { range } from 'lit-html/directives/range.js';
15
14
  import { KeyFn } from 'lit-html/directives/repeat.js';
16
15
  export { repeat } from 'lit-html/directives/repeat.js';
17
16
  export { styleMap } from 'lit-html/directives/style-map.js';
17
+ export { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
18
18
  export { until } from 'lit-html/directives/until.js';
19
19
  export { when } from 'lit-html/directives/when.js';
20
20
  import * as CSS from 'csstype';
@@ -239,165 +239,6 @@ declare const MA: {
239
239
  };
240
240
  type MatesAnimationClass = (typeof MA)[keyof typeof MA];
241
241
 
242
- declare class ZeroPromise<T = any> {
243
- private state;
244
- private controller;
245
- private resolveFn;
246
- private rejectFn;
247
- private promise;
248
- __isZeroPromise__: boolean;
249
- constructor();
250
- isActive(): boolean;
251
- isResolved(): boolean;
252
- isRejected(): boolean;
253
- isCancelled(): boolean;
254
- get signal(): AbortSignal;
255
- toActive(): this;
256
- resolve(value: T): void;
257
- reject(error: any): void;
258
- cancel(reason?: any): void;
259
- then<R1 = T, R2 = never>(onFulfilled?: (v: T) => R1 | PromiseLike<R1>, onRejected?: (e: any) => R2 | PromiseLike<R2>): Promise<R1 | R2>;
260
- catch<R = never>(onRejected?: (e: any) => R | PromiseLike<R>): Promise<T | R>;
261
- finally(onFinally?: () => void): Promise<T>;
262
- get [Symbol.toStringTag](): string;
263
- }
264
-
265
- /**
266
- * Global component running status tracker.
267
- * Used to enforce safety checks and prevent certain operations during specific
268
- * execution contexts.
269
- */
270
- declare const componentRunningStatus: {
271
- /**
272
- * Set to true while a scope's setup() method is running.
273
- *
274
- * NOTE: setup() is called during scope creation, which can only happen inside
275
- * a component's outer function. The outer function is an unrestricted context,
276
- * so setup() inherits the same permissions — reactive primitives (atoms, events,
277
- * channels, actions, setters, on(), effect(), …) CAN be created freely here,
278
- * exactly as they can be in the outer function itself.
279
- *
280
- * This flag is kept for informational / tooling purposes (e.g. CSS-in-JS
281
- * assertModuleLevel checks) and is NOT used by assertNotInRestrictedContext.
282
- */
283
- setupInProgress: boolean;
284
- /**
285
- * Set to true while the template function (inner render function) is running.
286
- *
287
- * During template execution reactive primitives CANNOT be created because the
288
- * template reruns on every update — creating atoms/events/etc. here would
289
- * produce a new instance on every render, causing memory leaks and broken
290
- * reactivity. Only `scope()` / `useScope()` lookups are permitted.
291
- */
292
- templateInProgress: boolean;
293
- /**
294
- * Set to true while a component's outer function is running.
295
- * Tracked for debugging / devtools purposes only — does NOT restrict anything.
296
- * Reactive primitives CAN be created freely in the outer function.
297
- */
298
- viewOuterInProgress: boolean;
299
- /**
300
- * Set to true while an `eleHook()` or `htmlHook()` mount or lifecycle
301
- * callback is executing. Indicates that a hook is in progress and allows
302
- * certain operations that would otherwise be restricted.
303
- */
304
- isHookRunning: boolean;
305
- };
306
- /**
307
- * Returns true when the current execution context forbids the creation of new
308
- * reactive primitives.
309
- *
310
- * Restricted contexts
311
- * ───────────────────
312
- * • Template function — reruns every render; primitives created here leak
313
- * • effect() / memo() — should only read state, never create new primitives
314
- *
315
- * Unrestricted contexts
316
- * ─────────────────────
317
- * • ES module scope — top of file, safe to create global primitives
318
- * • Component outer fn — runs once on mount; the canonical place for locals
319
- * • Scope setup() — called from the outer fn, inherits its permissions
320
- * • Hook callbacks — eleHook / htmlHook mount and lifecycle methods run
321
- * with isHookRunning = true. Subscriptions and atom
322
- * creation are permitted because the hook author owns
323
- * teardown via the onCleanup return value.
324
- */
325
- declare function isInRestrictedContext(): boolean;
326
- /**
327
- * Throws a descriptive error when called from a restricted execution context.
328
- *
329
- * Allowed
330
- * ───────
331
- * ✅ ES module scope (top-level, outside any component)
332
- * ✅ Component outer function (runs once on mount)
333
- * ✅ Scope setup() (runs inside the outer function — same rules)
334
- * ✅ Hook callbacks (isHookRunning === true)
335
- * eleHook / htmlHook mount and lifecycle methods
336
- * may freely subscribe and create atoms. The hook
337
- * author is responsible for unsubscribing inside
338
- * the onCleanup return — this is NOT automatic.
339
- *
340
- * Forbidden
341
- * ─────────
342
- * ❌ Template / render function (templateInProgress === true)
343
- * ❌ effect() or memo() callback (isEffectRunning() === true)
344
- */
345
- declare function assertNotInRestrictedContext(operationName: string): void;
346
- /**
347
- * Throws unless the current execution context is a component's outer function
348
- * (i.e. `viewOuterInProgress === true`).
349
- *
350
- * Use this for APIs — such as `ws()` — that register cleanup handlers via
351
- * `registerCleanup` and therefore require an active component host. Calling
352
- * them at module level or inside inner functions (event handlers, timers, etc.)
353
- * would silently skip cleanup, leaving timers and sockets running after the
354
- * component unmounts.
355
- *
356
- * Allowed
357
- * ───────
358
- * ✅ Component outer function (viewOuterInProgress === true)
359
- * ✅ Scope setup() (sets viewOuterInProgress = true, same rules)
360
- *
361
- * Forbidden
362
- * ─────────
363
- * ❌ Module / file scope (no active host, no cleanup)
364
- * ❌ Inner functions / event handlers (outer fn has already returned)
365
- * ❌ Template / render function (templateInProgress === true)
366
- * ❌ effect() or memo() callback (isEffectRunning() === true)
367
- */
368
- declare function assertComponentOuterContext(operationName: string): void;
369
-
370
- /**
371
- * Read tracking state for dependency collection.
372
- * Used by atoms, units, getters, and effects to track which stores are read
373
- * during reactive computations.
374
- */
375
- declare function isReadTrackingEnabled(): boolean;
376
- declare function getStoresBeingRead(): Set<any>;
377
- declare function isEffectRunning(): boolean;
378
- declare function addStoreBeingRead(store: any): void;
379
- declare function pushEffect(): void;
380
- declare function popEffect(): void;
381
- interface TrackingSnapshot {
382
- prevEnabled: boolean;
383
- prevStores: Set<any>;
384
- }
385
- declare function saveAndEnableTracking(): TrackingSnapshot;
386
- declare function restoreTracking(prev: TrackingSnapshot): Set<any>;
387
- declare const startTracking: typeof saveAndEnableTracking;
388
- declare const stopTracking: typeof restoreTracking;
389
-
390
- type TimerType = "timeout" | "interval";
391
- type TimerId = ReturnType<typeof setTimeout> | ReturnType<typeof setInterval>;
392
- /**
393
- * Internal helper to create managed timers with automatic cleanup
394
- * @param fn - Function to execute
395
- * @param delay - Delay/interval in milliseconds
396
- * @param type - Timer type (timeout or interval)
397
- * @returns Timer ID
398
- */
399
- declare const createManagedTimer: (fn: () => void, delay: number, type: TimerType) => TimerId;
400
-
401
242
  type ActionFn = (...args: any[]) => any;
402
243
  type ActionSubscriber<T extends ActionFn> = (result?: ReturnType<T>) => void;
403
244
  type ActionBeforeInterceptor<T extends ActionFn> = (next: (...args: any[]) => ReturnType<T>, ...args: Parameters<T>) => ReturnType<T>;
@@ -1035,6 +876,29 @@ declare function throttle<T extends (...args: any[]) => any>(func: T, wait: numb
1035
876
  flush: () => ReturnType<T> | undefined;
1036
877
  };
1037
878
 
879
+ declare class ZeroPromise<T = any> {
880
+ private state;
881
+ private controller;
882
+ private resolveFn;
883
+ private rejectFn;
884
+ private promise;
885
+ __isZeroPromise__: boolean;
886
+ constructor();
887
+ isActive(): boolean;
888
+ isResolved(): boolean;
889
+ isRejected(): boolean;
890
+ isCancelled(): boolean;
891
+ get signal(): AbortSignal;
892
+ toActive(): this;
893
+ resolve(value: T): void;
894
+ reject(error: any): void;
895
+ cancel(reason?: any): void;
896
+ then<R1 = T, R2 = never>(onFulfilled?: (v: T) => R1 | PromiseLike<R1>, onRejected?: (e: any) => R2 | PromiseLike<R2>): Promise<R1 | R2>;
897
+ catch<R = never>(onRejected?: (e: any) => R | PromiseLike<R>): Promise<T | R>;
898
+ finally(onFinally?: () => void): Promise<T>;
899
+ get [Symbol.toStringTag](): string;
900
+ }
901
+
1038
902
  /**
1039
903
  * mates — ssr/ssr-bridge.ts
1040
904
  *
@@ -4374,6 +4238,48 @@ declare const scope: <T extends object>(ScopeClass: new () => T) => TScope<T>;
4374
4238
  */
4375
4239
  declare const getParentScope: <T extends object>(ScopeClass: new () => T) => TScope<T>;
4376
4240
 
4241
+ /**
4242
+ * Creates a global reactive state container from a plain object.
4243
+ *
4244
+ * Unlike `useState`, `store` is designed to be called at module level (outside
4245
+ * any component) and shared across the application. The returned factory
4246
+ * function can be called inside any component to obtain the shared
4247
+ * `[wrapper, update]` pair.
4248
+ *
4249
+ * - `wrapper` is a read-tracked object (built by `wrapStateFunctions`):
4250
+ * - Reading a data property (e.g. `state.count`) subscribes the current
4251
+ * component / `memo` / `effect` to re-run when the store updates.
4252
+ * - Methods defined on the initial object are automatically wrapped to call
4253
+ * `a.update()` — no manual batching needed.
4254
+ * - Getters are version-cached and recomputed only when `a.update()` is called.
4255
+ * - Direct assignment (`state.count = 5`) is also reactive and equivalent to
4256
+ * `update(s => { s.count = 5; })`.
4257
+ * - `update` is the raw `a.update` handle for external mutations that don't go
4258
+ * through a method.
4259
+ *
4260
+ * @param initialState - A plain object (with optional methods and getters) that
4261
+ * represents the initial state of the store.
4262
+ * @returns A factory function `() => [wrapper, update]` to be called inside
4263
+ * components or reactive contexts.
4264
+ *
4265
+ * @example
4266
+ * // module-level — created once
4267
+ * const counterStore = store({
4268
+ * count: 0,
4269
+ * incr() { this.count++; },
4270
+ * get doubled() { return this.count * 2; },
4271
+ * });
4272
+ *
4273
+ * // inside a component or effect
4274
+ * const [state, update] = counterStore();
4275
+ *
4276
+ * state.count; // 0 — tracked read, component re-renders on change
4277
+ * state.incr(); // calls a.update() automatically
4278
+ * state.doubled; // 0 — version-cached getter
4279
+ * update(() => { state.count = 10; }); // direct external mutation
4280
+ */
4281
+ declare const store: <T extends Record<string, any>>(initialState: T) => () => (T | ((fn: (draft: T) => void, silently?: boolean) => void))[];
4282
+
4377
4283
  type TState<T> = [T, (fn: () => void) => void];
4378
4284
  /**
4379
4285
  * Creates local component-level reactive state from a plain object.
@@ -5716,6 +5622,142 @@ declare function resolveAsyncValue(val: any): Promise<any>;
5716
5622
  */
5717
5623
  declare function unwrapModule(module: any): any;
5718
5624
 
5625
+ type TimerType = "timeout" | "interval";
5626
+ type TimerId = ReturnType<typeof setTimeout> | ReturnType<typeof setInterval>;
5627
+ /**
5628
+ * Internal helper to create managed timers with automatic cleanup
5629
+ * @param fn - Function to execute
5630
+ * @param delay - Delay/interval in milliseconds
5631
+ * @param type - Timer type (timeout or interval)
5632
+ * @returns Timer ID
5633
+ */
5634
+ declare const createManagedTimer: (fn: () => void, delay: number, type: TimerType) => TimerId;
5635
+
5636
+ /**
5637
+ * Global component running status tracker.
5638
+ * Used to enforce safety checks and prevent certain operations during specific
5639
+ * execution contexts.
5640
+ */
5641
+ declare const componentRunningStatus: {
5642
+ /**
5643
+ * Set to true while a scope's setup() method is running.
5644
+ *
5645
+ * NOTE: setup() is called during scope creation, which can only happen inside
5646
+ * a component's outer function. The outer function is an unrestricted context,
5647
+ * so setup() inherits the same permissions — reactive primitives (atoms, events,
5648
+ * channels, actions, setters, on(), effect(), …) CAN be created freely here,
5649
+ * exactly as they can be in the outer function itself.
5650
+ *
5651
+ * This flag is kept for informational / tooling purposes (e.g. CSS-in-JS
5652
+ * assertModuleLevel checks) and is NOT used by assertNotInRestrictedContext.
5653
+ */
5654
+ setupInProgress: boolean;
5655
+ /**
5656
+ * Set to true while the template function (inner render function) is running.
5657
+ *
5658
+ * During template execution reactive primitives CANNOT be created because the
5659
+ * template reruns on every update — creating atoms/events/etc. here would
5660
+ * produce a new instance on every render, causing memory leaks and broken
5661
+ * reactivity. Only `scope()` / `useScope()` lookups are permitted.
5662
+ */
5663
+ templateInProgress: boolean;
5664
+ /**
5665
+ * Set to true while a component's outer function is running.
5666
+ * Tracked for debugging / devtools purposes only — does NOT restrict anything.
5667
+ * Reactive primitives CAN be created freely in the outer function.
5668
+ */
5669
+ viewOuterInProgress: boolean;
5670
+ /**
5671
+ * Set to true while an `eleHook()` or `htmlHook()` mount or lifecycle
5672
+ * callback is executing. Indicates that a hook is in progress and allows
5673
+ * certain operations that would otherwise be restricted.
5674
+ */
5675
+ isHookRunning: boolean;
5676
+ };
5677
+ /**
5678
+ * Returns true when the current execution context forbids the creation of new
5679
+ * reactive primitives.
5680
+ *
5681
+ * Restricted contexts
5682
+ * ───────────────────
5683
+ * • Template function — reruns every render; primitives created here leak
5684
+ * • effect() / memo() — should only read state, never create new primitives
5685
+ *
5686
+ * Unrestricted contexts
5687
+ * ─────────────────────
5688
+ * • ES module scope — top of file, safe to create global primitives
5689
+ * • Component outer fn — runs once on mount; the canonical place for locals
5690
+ * • Scope setup() — called from the outer fn, inherits its permissions
5691
+ * • Hook callbacks — eleHook / htmlHook mount and lifecycle methods run
5692
+ * with isHookRunning = true. Subscriptions and atom
5693
+ * creation are permitted because the hook author owns
5694
+ * teardown via the onCleanup return value.
5695
+ */
5696
+ declare function isInRestrictedContext(): boolean;
5697
+ /**
5698
+ * Throws a descriptive error when called from a restricted execution context.
5699
+ *
5700
+ * Allowed
5701
+ * ───────
5702
+ * ✅ ES module scope (top-level, outside any component)
5703
+ * ✅ Component outer function (runs once on mount)
5704
+ * ✅ Scope setup() (runs inside the outer function — same rules)
5705
+ * ✅ Hook callbacks (isHookRunning === true)
5706
+ * eleHook / htmlHook mount and lifecycle methods
5707
+ * may freely subscribe and create atoms. The hook
5708
+ * author is responsible for unsubscribing inside
5709
+ * the onCleanup return — this is NOT automatic.
5710
+ *
5711
+ * Forbidden
5712
+ * ─────────
5713
+ * ❌ Template / render function (templateInProgress === true)
5714
+ * ❌ effect() or memo() callback (isEffectRunning() === true)
5715
+ */
5716
+ declare function assertNotInRestrictedContext(operationName: string): void;
5717
+ /**
5718
+ * Throws unless the current execution context is a component's outer function
5719
+ * (i.e. `viewOuterInProgress === true`).
5720
+ *
5721
+ * Use this for APIs — such as `ws()` — that register cleanup handlers via
5722
+ * `registerCleanup` and therefore require an active component host. Calling
5723
+ * them at module level or inside inner functions (event handlers, timers, etc.)
5724
+ * would silently skip cleanup, leaving timers and sockets running after the
5725
+ * component unmounts.
5726
+ *
5727
+ * Allowed
5728
+ * ───────
5729
+ * ✅ Component outer function (viewOuterInProgress === true)
5730
+ * ✅ Scope setup() (sets viewOuterInProgress = true, same rules)
5731
+ *
5732
+ * Forbidden
5733
+ * ─────────
5734
+ * ❌ Module / file scope (no active host, no cleanup)
5735
+ * ❌ Inner functions / event handlers (outer fn has already returned)
5736
+ * ❌ Template / render function (templateInProgress === true)
5737
+ * ❌ effect() or memo() callback (isEffectRunning() === true)
5738
+ */
5739
+ declare function assertComponentOuterContext(operationName: string): void;
5740
+
5741
+ /**
5742
+ * Read tracking state for dependency collection.
5743
+ * Used by atoms, units, getters, and effects to track which stores are read
5744
+ * during reactive computations.
5745
+ */
5746
+ declare function isReadTrackingEnabled(): boolean;
5747
+ declare function getStoresBeingRead(): Set<any>;
5748
+ declare function isEffectRunning(): boolean;
5749
+ declare function addStoreBeingRead(store: any): void;
5750
+ declare function pushEffect(): void;
5751
+ declare function popEffect(): void;
5752
+ interface TrackingSnapshot {
5753
+ prevEnabled: boolean;
5754
+ prevStores: Set<any>;
5755
+ }
5756
+ declare function saveAndEnableTracking(): TrackingSnapshot;
5757
+ declare function restoreTracking(prev: TrackingSnapshot): Set<any>;
5758
+ declare const startTracking: typeof saveAndEnableTracking;
5759
+ declare const stopTracking: typeof restoreTracking;
5760
+
5719
5761
  /**
5720
5762
  * Deep-clones a value. Uses native structuredClone when available (modern browsers),
5721
5763
  * otherwise falls back to a recursive clone that supports primitives, plain objects,
@@ -6011,5 +6053,5 @@ declare function getMonths(locale?: string): MonthInfo[];
6011
6053
  */
6012
6054
  declare function getCalendar(year: number, month: number): MatesDate[][];
6013
6055
 
6014
- export { $, Component$1 as ComponentElement, Context, Delete, ErrorTypes, Fetch, FetchClient, Get, MA, NotificationManager, Patch, Post, Put, Router, SyncNotificationManager, ZeroPromise, _, _subToView, action, addStoreBeingRead, animatedIf, animatedRouter, animatedX, range as arrayRange, assertComponentOuterContext, assertNotInRestrictedContext, asyncAction, atom, attr, blurInPreset, blurOutPreset, bouncePreset, buildPath, buildRequestUrl, cacheAtom, createCacheManager as cacheFn, chunk, clamp, classes, cleanupScheduler, clearInterceptors, collapseWidthPreset, componentRunningStatus, computeAutoPlacement, configureCSS, createCacheManager, createManagedTimer, createPollingManager, createReactiveRunner, createTimedAtom, date, debounce, debouncedAtom, deepClone, deepFreeze, deleteAction, deepFreeze as df, dialog, effect, effectScheduler, eleHook, event, expandWidthPreset, fadeInPreset, fadeOutPreset, fetchAction, fetchClient, flipInPreset, flipOutPreset, formAtom, get, getAction, getAllProps, getAllTimezones, getCalendar, getCoords, getCurrentHost, getLocale, getMonths, getParentScope, getParentScope as getScope, getStoresBeingRead, getTimezoneOffset, globalCSS, globalScheduler, globalTheme, groupBy, hashAtom, htmlHook, iAtom, injectMatesAnimations, installDevToolsHooks, interceptAfter, interceptBefore, interceptError, isAction, isApiResponseSuccess, isAsyncAction, isAsyncFunction, isAsyncValue, isAtom, isChannel, isConfirmationEvent, isDefinedAsGetter, isDevToolsInstalled, isEffectRunning, isEmail, isEmpty, isEvent, isFunction, isGetter, isInRestrictedContext, isMax, isMin, isPathMatching, isPattern, isReadTrackingEnabled, isRequired, isSSR, isSetter, isUnit, iterateDeeply, keyframes, lazyLoad, location, lockNavigation, logError, lsAtom, mapAtom, masonryGrid, maxLength, memo, memoTemplate, merge, minLength, navigateTo, navigationLocked, omit, on, onAllMount, onBlur, onCleanup, onClickAway, onConnect, onCopy, onCut, onDOMReady, onDisconnect, onError, on$1 as onEvent, onFileDrop, onFocus, onHidden, onIntersect, onInterval, onKeyDown, onKeyUp, onMount, onNavigate, onOffline, onOnline, onPaint, onParent, onPaste, onReferenceChange, onResize, onScroll, onScrolledIntoView, onSelectionChange, onSocket, onStorageChange, onTimeout, onUpdate, onVisibilityChange, onVisible, onWindow, onWindowCapture, onWindowResize, onWindowScroll, paginatedAsyncAction, paginationAtom, patchAction, pathAtom, pick, placementTransform, popEffect, popup, portal, postAction, pulsePreset, pushEffect, putAction, qsAtom, uuid as randomId, ref, registerCleanup, removeAttr, removeClasses, removeOn, removeStyle, renderSwitch, renderTemplate, renderX, resetComponentState, resolveAsyncValue, restoreTracking, rootCSS, route, safeSVG, safetyCheck, saveAndEnableTracking, scaleInPreset, scaleOutPreset, scope, setAtom, setLocale, setRef, setSSRApiLookup, setSSRMode, setSSRRequest, setTimezone, setTimezoneOffset, setter, shakePreset, iAtom as signal, slideInPreset, slideOutPreset, spinPreset, springInPreset, ssAtom, startTracking, stopTracking, style, stylesheet, superAtom, taskAction, template, themeAtom, throttle, throttledAtom, timer, tip, titleAtom, tooltip, trackAndSubscribe, uniqBy, unlockNavigation, safeSVG as unsafeSVG, unwrapModule, useContext, scope as useScope, useState, useStore, uuid, validateAll, validateReactiveFunction, view, virtualGrid, virtualList, virtualMasonry, on as watch, withHost, withStaggerPreset, ws, x, xTabEvent };
6056
+ export { $, Component$1 as ComponentElement, Context, Delete, ErrorTypes, Fetch, FetchClient, Get, MA, NotificationManager, Patch, Post, Put, Router, SyncNotificationManager, ZeroPromise, _, _subToView, action, addStoreBeingRead, animatedIf, animatedRouter, animatedX, range as arrayRange, assertComponentOuterContext, assertNotInRestrictedContext, asyncAction, atom, attr, blurInPreset, blurOutPreset, bouncePreset, buildPath, buildRequestUrl, cacheAtom, createCacheManager as cacheFn, chunk, clamp, classes, cleanupScheduler, clearInterceptors, collapseWidthPreset, componentRunningStatus, computeAutoPlacement, configureCSS, createCacheManager, createManagedTimer, createPollingManager, createReactiveRunner, createTimedAtom, date, debounce, debouncedAtom, deepClone, deepFreeze, deleteAction, deepFreeze as df, dialog, effect, effectScheduler, eleHook, event, expandWidthPreset, fadeInPreset, fadeOutPreset, fetchAction, fetchClient, flipInPreset, flipOutPreset, formAtom, get, getAction, getAllProps, getAllTimezones, getCalendar, getCoords, getCurrentHost, getLocale, getMonths, getParentScope, getParentScope as getScope, getStoresBeingRead, getTimezoneOffset, globalCSS, globalScheduler, globalTheme, groupBy, hashAtom, htmlHook, iAtom, injectMatesAnimations, installDevToolsHooks, interceptAfter, interceptBefore, interceptError, isAction, isApiResponseSuccess, isAsyncAction, isAsyncFunction, isAsyncValue, isAtom, isChannel, isConfirmationEvent, isDefinedAsGetter, isDevToolsInstalled, isEffectRunning, isEmail, isEmpty, isEvent, isFunction, isGetter, isInRestrictedContext, isMax, isMin, isPathMatching, isPattern, isReadTrackingEnabled, isRequired, isSSR, isSetter, isUnit, iterateDeeply, keyframes, lazyLoad, location, lockNavigation, logError, lsAtom, mapAtom, masonryGrid, maxLength, memo, memoTemplate, merge, minLength, navigateTo, navigationLocked, omit, on, onAllMount, onBlur, onCleanup, onClickAway, onConnect, onCopy, onCut, onDOMReady, onDisconnect, onError, on$1 as onEvent, onFileDrop, onFocus, onHidden, onIntersect, onInterval, onKeyDown, onKeyUp, onMount, onNavigate, onOffline, onOnline, onPaint, onParent, onPaste, onReferenceChange, onResize, onScroll, onScrolledIntoView, onSelectionChange, onSocket, onStorageChange, onTimeout, onUpdate, onVisibilityChange, onVisible, onWindow, onWindowCapture, onWindowResize, onWindowScroll, paginatedAsyncAction, paginationAtom, patchAction, pathAtom, pick, placementTransform, popEffect, popup, portal, postAction, pulsePreset, pushEffect, putAction, qsAtom, uuid as randomId, ref, registerCleanup, removeAttr, removeClasses, removeOn, removeStyle, renderSwitch, renderTemplate, renderX, resetComponentState, resolveAsyncValue, restoreTracking, rootCSS, route, safeSVG, safetyCheck, saveAndEnableTracking, scaleInPreset, scaleOutPreset, scope, setAtom, setLocale, setRef, setSSRApiLookup, setSSRMode, setSSRRequest, setTimezone, setTimezoneOffset, setter, shakePreset, iAtom as signal, slideInPreset, slideOutPreset, spinPreset, springInPreset, ssAtom, startTracking, stopTracking, store, style, stylesheet, superAtom, taskAction, template, themeAtom, throttle, throttledAtom, timer, tip, titleAtom, tooltip, trackAndSubscribe, uniqBy, unlockNavigation, safeSVG as unsafeSVG, unwrapModule, useContext, scope as useScope, useState, useStore, uuid, validateAll, validateReactiveFunction, view, virtualGrid, virtualList, virtualMasonry, on as watch, withHost, withStaggerPreset, ws, x, xTabEvent };
6015
6057
  export type { ActionAfterInterceptor, ActionBeforeInterceptor, ActionFn, ActionReturnType, ActionSubscriber, AfterInterceptor, AnimateDirectiveConfig, AnimateKeyframes, AnimateOptions, AnimatedIfConfig, AnimatedRouteConfig, AnimatedRouterOptions, AnimatedXConfig, AnimationHandle, AnimationPreset, AsyncActionAfterInterceptor, AsyncActionBeforeInterceptor, AsyncActionOptions, AsyncActionReturnType, AsyncActionStatus, AtomConfig, AtomType, AttrMap, AttrValue, BeforeInterceptor, C, CSSBlock, CSSKeyframeStops, CSSNestedBlock, CSSRulesInput, CacheAtomType, CacheManager, Cl, ClassEntry, ClassesInput, ClosureComponent, Component, ComponentFn, ComponentType, ConnectCallback, CssVars, DateInput, DateUnit, DateValues, DevToolsHooks, DialogOptions, DisconnectCallback, DollarChain, EleHookLifecycle, EleHookMountFn, ElementTarget, ErrorInterceptor, ErrorType, EventType, FetchActionConfig, FetchBody, FetchRequest, FormAtom, GlobalThemeResult, HostElement, HtmlHookLifecycle, HtmlHookMountFn, HtmlHookRenderFn, IAtomType, InnerFn, IntersectCallback, IntersectOptions, IterateDeeplyCallback, LazyComponent, LazyLoadCallback, LazyLoadOptions, MasonryGridOptions, MasonryItemTemplate, MasonryKeyFn, MatesAnimationClass, MatesCustomEventMap, MatesDate, Measurements, MemoKeys, MemoTemplateFn, MonthInfo, OnEventMap, OnParentMap, OuterFn, PaginatedAsyncActionReturnType, PaginationAtomType, Placement, PollingManager, PopupOptions, PopupPlacement, PortalOptions, Props, PropsType, MatesRef as Ref, RenderFn, ScrolledIntoViewCallback, ScrolledIntoViewOptions, SerializeOptions, Setter, SetterReturnType, SlideDirection, StorageAtomType, StorageValue, StyleMap, StyleValue, Subscribable, SuperAtomOptions, SuperAtomType, SvgConfig, SwitchCase, SwitchEntry, Task, TaskActionType, TaskStatus, TemplateComponent, TemplateFn, ThemeAtomType, ThemeMode, ThemeTokenMap, ThemeValue, ThemesInput, TimerContent, TimezoneEntry, TipContent, TipStyle, TrackingSnapshot, UpdateCallback, ValidateAllResult, ValidatorFn, View, ViewComponent, VirtualGridOptions, VirtualListOptions, VirtualMasonryOptions, WheelDirectionEvent, WindowHookEventName, WindowHookHandler, WsConfig, WsConnection, WsStatus, X, XTabEventType };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,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