Home / Type/ AnalysisState Type — svelte Architecture

AnalysisState Type — svelte Architecture

Architecture documentation for the AnalysisState type/interface in types.d.ts from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  66783a9c_abba_2d5e_a6f0_4cd94370809b["AnalysisState"]
  8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72["types.d.ts"]
  66783a9c_abba_2d5e_a6f0_4cd94370809b -->|defined in| 8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72
  style 66783a9c_abba_2d5e_a6f0_4cd94370809b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/2-analyze/types.d.ts lines 6–36

export interface AnalysisState {
	scope: Scope;
	scopes: Map<AST.SvelteNode, Scope>;
	analysis: ComponentAnalysis;
	options: ValidatedCompileOptions;
	ast_type: 'instance' | 'template' | 'module';
	fragment: AST.Fragment | null;
	/**
	 * Tag name of the parent element. `null` if the parent is `svelte:element`, `#snippet`, a component or the root.
	 * Parent doesn't necessarily mean direct path predecessor because there could be `#each`, `#if` etc in-between.
	 */
	parent_element: string | null;
	has_props_rune: boolean;
	/** Which slots the current parent component has */
	component_slots: Set<string>;
	/** Information about the current expression/directive/block value */
	expression: ExpressionMetadata | null;

	/** Used to analyze class state */
	state_fields: Map<string, StateField>;

	function_depth: number;

	// legacy stuff
	reactive_statement: null | ReactiveStatement;

	/**
	 * Set when we're inside a `$derived(...)` expression (but not `$derived.by(...)`) or `@const`
	 */
	derived_function_depth: number;
}

Frequently Asked Questions

What is the AnalysisState type?
AnalysisState is a type/interface in the svelte codebase, defined in packages/svelte/src/compiler/phases/2-analyze/types.d.ts.
Where is AnalysisState defined?
AnalysisState is defined in packages/svelte/src/compiler/phases/2-analyze/types.d.ts at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free