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. 4 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72["types.d.ts"]
  ee93d8a6_6fde_b1c1_e15b_3a4da5326305["scope.js"]
  8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72 --> ee93d8a6_6fde_b1c1_e15b_3a4da5326305
  bc60b394_bb59_4918_bced_e2346543a798["../types.js"]
  8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72 --> bc60b394_bb59_4918_bced_e2346543a798
  bbca3d2a_42c8_b215_d3b5_5077ccaf0797["nodes.js"]
  8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72 --> bbca3d2a_42c8_b215_d3b5_5077ccaf0797
  c696582a_9f3f_d301_2824_cb3de66aa770["#compiler"]
  8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72 --> c696582a_9f3f_d301_2824_cb3de66aa770
  style 8a5fbbc9_917f_c98f_cbca_9d2fe6ba5d72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { Scope } from '../scope.js';
import type { ComponentAnalysis, ReactiveStatement } from '../types.js';
import type { AST, StateField, ValidatedCompileOptions } from '#compiler';
import type { ExpressionMetadata } from '../nodes.js';

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;
}

export type Context<State extends AnalysisState = AnalysisState> = import('zimmerframe').Context<
	AST.SvelteNode,
	State
>;

export type Visitors<State extends AnalysisState = AnalysisState> = import('zimmerframe').Visitors<
	AST.SvelteNode,
	State
>;

Domain

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 Compiler domain.
What does types.d.ts depend on?
types.d.ts imports 4 module(s): #compiler, ../types.js, nodes.js, scope.js.
Where is types.d.ts in the architecture?
types.d.ts is located at packages/svelte/src/compiler/phases/2-analyze/types.d.ts (domain: Compiler, directory: packages/svelte/src/compiler/phases/2-analyze).

Analyze Your Own Codebase

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

Try Supermodel Free