@solidjs/signals 0.13.9 → 0.13.11

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.
@@ -3,10 +3,32 @@ import type { Signal } from "./core/index.js";
3
3
  export interface BoundaryComputed<T> extends Computed<T> {
4
4
  _propagationMask: number;
5
5
  }
6
+ type RevealSlot = CollectionQueue | RevealController;
7
+ type BoolAccessor = () => boolean;
8
+ export declare class RevealController {
9
+ _togetherAccessor: BoolAccessor;
10
+ _collapsedAccessor: BoolAccessor;
11
+ _slots: RevealSlot[];
12
+ _parentController?: RevealController;
13
+ _disabled: Signal<boolean>;
14
+ _collapsed: Signal<boolean>;
15
+ _ready: boolean;
16
+ _evaluating: boolean;
17
+ constructor(together: BoolAccessor, collapsed: BoolAccessor);
18
+ _forEachOwnedSlot(fn: (slot: RevealSlot) => boolean | void): boolean;
19
+ isReady(): boolean;
20
+ register(slot: RevealSlot): void;
21
+ unregister(slot: RevealSlot): void;
22
+ evaluate(disabledOverride?: boolean, collapsedOverride?: boolean): void;
23
+ }
6
24
  export declare class CollectionQueue extends Queue {
7
25
  _collectionType: number;
8
26
  _sources: Set<Computed<any>>;
27
+ _tree?: BoundaryComputed<any>;
28
+ _pending: boolean;
9
29
  _disabled: Signal<boolean>;
30
+ _collapsed: Signal<boolean>;
31
+ _revealController?: RevealController;
10
32
  _initialized: boolean;
11
33
  _onFn: (() => any) | undefined;
12
34
  _prevOn: any;
@@ -19,7 +41,12 @@ export declare function createLoadingBoundary(fn: () => any, fallback: () => any
19
41
  on?: () => any;
20
42
  }): import("./signals.js").Accessor<unknown>;
21
43
  export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: unknown, reset: () => void) => U): import("./signals.js").Accessor<unknown>;
44
+ export declare function createRevealOrder<T>(fn: () => T, options?: {
45
+ together?: BoolAccessor;
46
+ collapsed?: BoolAccessor;
47
+ }): T;
22
48
  export declare function flatten(children: any, options?: {
23
49
  skipNonRendered?: boolean;
24
50
  doNotUnwrap?: boolean;
25
51
  }): any;
52
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { Computed, Owner, Signal } from "./types.js";
2
+ export interface DevHooks {
3
+ onOwner?: (owner: Owner) => void;
4
+ onGraph?: (value: any, owner: Owner | null) => void;
5
+ onUpdate?: () => void;
6
+ onStoreNodeUpdate?: (state: any, property: PropertyKey, value: any, prev: any) => void;
7
+ }
8
+ export interface Dev {
9
+ hooks: DevHooks;
10
+ getChildren: typeof getChildren;
11
+ getSignals: typeof getSignals;
12
+ getParent: typeof getParent;
13
+ getSources: typeof getSources;
14
+ getObservers: typeof getObservers;
15
+ }
16
+ export declare const DEV: Dev;
17
+ export declare function registerGraph(value: any, owner: Owner | null): void;
18
+ export declare function clearSignals(node: Owner): void;
19
+ export declare function getChildren(owner: Owner): Owner[];
20
+ export declare function getSignals(owner: Owner): any[];
21
+ export declare function getParent(owner: Owner): Owner | null;
22
+ export declare function getSources(computation: Computed<any>): (Signal<any> | Computed<any>)[];
23
+ export declare function getObservers(node: Signal<any> | Computed<any>): Computed<any>[];
@@ -8,4 +8,5 @@ export type { Computed, Disposable, FirewallSignal, Link, Owner, Root, Signal, N
8
8
  export { effect, trackedEffect, type Effect, type TrackedEffect } from "./effect.js";
9
9
  export { action } from "./action.js";
10
10
  export { flush, Queue, GlobalQueue, trackOptimisticStore, enforceLoadingBoundary, type IQueue, type QueueCallback } from "./scheduler.js";
11
+ export { DEV, type Dev, type DevHooks } from "./dev.js";
11
12
  export * from "./constants.js";
@@ -1,7 +1,7 @@
1
- export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest, isRefreshing, refresh, SUPPORTS_PROXY, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots, enforceLoadingBoundary, enableExternalSource } from "./core/index.js";
2
- export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig } from "./core/index.js";
1
+ export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest, isRefreshing, refresh, SUPPORTS_PROXY, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots, enforceLoadingBoundary, enableExternalSource, DEV } from "./core/index.js";
2
+ export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig, Dev, DevHooks } from "./core/index.js";
3
3
  export { createSignal, createMemo, createEffect, createRenderEffect, createTrackedEffect, createReaction, createOptimistic, resolve, onSettled, onCleanup } from "./signals.js";
4
4
  export type { Accessor, Setter, Signal, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, SignalOptions, MemoOptions, NoInfer } from "./signals.js";
5
5
  export { mapArray, repeat, type Maybe } from "./map.js";
6
6
  export * from "./store/index.js";
7
- export { createLoadingBoundary, createErrorBoundary, flatten } from "./boundaries.js";
7
+ export { createLoadingBoundary, createErrorBoundary, createRevealOrder, flatten } from "./boundaries.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/signals",
3
- "version": "0.13.9",
3
+ "version": "0.13.11",
4
4
  "description": "SolidJS' standalone reactivity implementation",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",