blockless
Rich Harris 10 months ago
parent e106bbc5a8
commit bcd8bf3649

@ -12,7 +12,7 @@ export interface Source<V = unknown> {
f: number; f: number;
/** The latest value for this signal */ /** The latest value for this signal */
v: V; v: V;
// write version // Write version
w: number; w: number;
} }
@ -21,9 +21,9 @@ export interface SourceDebug<V = unknown> extends Source<V> {
} }
export interface Derived<V = unknown> extends Source<V> { export interface Derived<V = unknown> extends Source<V> {
/** dependencies: Signals that this signal reads from */ /** Signals that this signal reads from */
deps: null | Value[]; deps: null | Value[];
/** init: The function that we invoke for effects and computeds */ /** The derived function */
fn: () => V; fn: () => V;
} }
@ -32,31 +32,33 @@ export interface DerivedDebug<V = unknown> extends Derived<V> {
} }
export interface Effect { export interface Effect {
/** context: The associated component if this signal is an effect/computed */ /** The component to which this effect belongs, if any */
ctx: null | ComponentContext; ctx: null | ComponentContext;
/** dependencies: Signals that this signal reads from */ /** Signals that this signal reads from */
deps: null | Value[]; deps: null | Value[];
/** destroy: Thing(s) that need destroying */ /** Thing(s) that need destroying */
y: null | (() => void); y: null | (() => void);
/** The types that the signal represent, as a bitwise value */ /** Flags bitmask */
f: number; f: number;
/** init: The function that we invoke for effects and computeds */ /** The effect function */
fn: null | (() => void | (() => void)); fn: null | (() => void | (() => void));
/** deriveds belonging to this effect */ /** Deriveds belonging to this effect */
r: null | Derived[]; r: null | Derived[];
/** teardown */ /** Teardown function */
v: null | (() => void); v: null | (() => void);
/** level: the depth from the root signal, used for ordering render/pre-effects topologically **/ /** The depth from the root signal, used for ordering render/pre-effects topologically **/
l: number; l: number;
/** in transitions */ /** In transitions */
in: null | Transition[]; in: null | Transition[];
/** out transitions */ /** Out transitions */
out: null | Transition[]; out: null | Transition[];
/** DOM nodes belonging to this effect */ /** DOM nodes belonging to this effect */
dom: null | TemplateNode | Array<TemplateNode>; dom: null | TemplateNode | Array<TemplateNode>;
/** Whether the effect ran or not */ /** Whether the effect ran or not */
ran: boolean; ran: boolean;
/** The parent effect */
parent: null | Effect; parent: null | Effect;
/** Child effects */
children: null | Effect[]; children: null | Effect[];
} }

Loading…
Cancel
Save