Home / File/ types.d.ts — svelte Source File

types.d.ts — svelte Source File

Architecture documentation for types.d.ts, a typescript file in the svelte codebase. 2 imports, 0 dependents.

File typescript ClientRuntime Reactivity 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  b54d747e_876e_6ce7_1b09_d738a162f64b["types.d.ts"]
  6d3d606a_fb7a_54af_1ece_f1eb12f174d1["boundary.js"]
  b54d747e_876e_6ce7_1b09_d738a162f64b --> 6d3d606a_fb7a_54af_1ece_f1eb12f174d1
  487e2614_c527_6020_2131_5870867616ea["#client"]
  b54d747e_876e_6ce7_1b09_d738a162f64b --> 487e2614_c527_6020_2131_5870867616ea
  style b54d747e_876e_6ce7_1b09_d738a162f64b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type {
	AnimationManager,
	ComponentContext,
	DevStackEntry,
	Equals,
	TemplateNode,
	TransitionManager
} from '#client';
import type { Boundary } from '../dom/blocks/boundary';

export interface Signal {
	/** Flags bitmask */
	f: number;
	/** Write version */
	wv: number;
}

export interface Value<V = unknown> extends Signal {
	/** Equality function */
	equals: Equals;
	/** Signals that read from this signal */
	reactions: null | Reaction[];
	/** Read version */
	rv: number;
	/** The latest value for this signal */
	v: V;

	// dev-only
	/** A label (e.g. the `foo` in `let foo = $state(...)`) used for `$inspect.trace()` */
	label?: string;
	/** An error with a stack trace showing when the source was created */
	created?: Error | null;
	/** An map of errors with stack traces showing when the source was updated, keyed by the stack trace */
	updated?: Map<string, { error: Error; count: number }> | null;
	/**
	 * Whether or not the source was set while running an effect — if so, we need to
	 * increment the write version so that it shows up as dirty when the effect re-runs
	 */
	set_during_effect?: boolean;
	/** A function that retrieves the underlying source, used for each block item signals */
	trace?: null | (() => void);
}

export interface Reaction extends Signal {
	/** The associated component context */
	ctx: null | ComponentContext;
	/** The reaction function */
	fn: null | Function;
	/** Signals that this signal reads from */
	deps: null | Value[];
	/** An AbortController that aborts when the signal is destroyed */
	ac: null | AbortController;
}

export interface Derived<V = unknown> extends Value<V>, Reaction {
	/** The derived function */
	fn: () => V;
	/** Effects created inside this signal. Used to destroy those effects when the derived reruns or is cleaned up */
	effects: null | Effect[];
	/** Parent effect or derived */
	parent: Effect | Derived | null;
}

export interface EffectNodes {
	start: TemplateNode;
	end: TemplateNode | null;
	/** $.animation */
	a: AnimationManager | null;
	/** $.transition */
	t: TransitionManager[] | null;
}

export interface Effect extends Reaction {
	/**
	 * Branch effects store their start/end nodes so that they can be
	 * removed when the effect is destroyed, or moved when an `each`
	 * block is reconciled. In the case of a single text/element node,
	 * `start` and `end` will be the same.
	 */
	nodes: null | EffectNodes;
	/** The effect function */
	fn: null | (() => void | (() => void));
	/** The teardown function returned from the effect function */
	teardown: null | (() => void);
	/** Next sibling child effect created inside the parent signal */
	prev: null | Effect;
	/** Next sibling child effect created inside the parent signal */
	next: null | Effect;
	/** First child effect created inside this signal */
	first: null | Effect;
	/** Last child effect created inside this signal */
	last: null | Effect;
	/** Parent effect */
	parent: Effect | null;
	/** The boundary this effect belongs to */
	b: Boundary | null;
	/** Dev only */
	component_function?: any;
	/** Dev only. Only set for certain block effects. Contains a reference to the stack that represents the render tree */
	dev_stack?: DevStackEntry | null;
}

export type Source<V = unknown> = Value<V>;

export type MaybeSource<T = unknown> = T | Source<T>;

export interface Blocker {
	promise: Promise<any>;
	settled: boolean;
}

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does types.d.ts do?
types.d.ts is a source file in the svelte codebase, written in typescript. It belongs to the ClientRuntime domain, Reactivity subdomain.
What functions are defined in types.d.ts?
types.d.ts defines 1 function(s): V.
What does types.d.ts depend on?
types.d.ts imports 2 module(s): #client, boundary.js.
Where is types.d.ts in the architecture?
types.d.ts is located at packages/svelte/src/internal/client/reactivity/types.d.ts (domain: ClientRuntime, subdomain: Reactivity, directory: packages/svelte/src/internal/client/reactivity).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free