diff --git a/packages/svelte/src/animate/public.d.ts b/packages/svelte/src/animate/public.d.ts index 8a6cf5ebf6..ded489464b 100644 --- a/packages/svelte/src/animate/public.d.ts +++ b/packages/svelte/src/animate/public.d.ts @@ -1,4 +1,4 @@ -// todo: same as Transition, should it be shared? +/** Configuration returned by animation functions. */ export interface AnimationConfig { delay?: number; duration?: number; @@ -7,6 +7,7 @@ export interface AnimationConfig { tick?: (t: number, u: number) => void; } +/** Options for the `flip` animation. */ export interface FlipParams { delay?: number; duration?: number | ((len: number) => number); diff --git a/packages/svelte/src/compiler/phases/scope.js b/packages/svelte/src/compiler/phases/scope.js index e3560753b4..5192d86b49 100644 --- a/packages/svelte/src/compiler/phases/scope.js +++ b/packages/svelte/src/compiler/phases/scope.js @@ -85,6 +85,7 @@ const global_constants = { 'Math.SQRT1_2': Math.SQRT1_2 }; +/** Represents a variable binding in a component scope. */ export class Binding { /** @type {Scope} */ scope; @@ -602,6 +603,7 @@ class Evaluation { } } +/** Represents a lexical scope in the component, tracking bindings and references. */ export class Scope { /** @type {ScopeRoot} */ root; @@ -859,6 +861,7 @@ const logical = { '??': (left, right) => left ?? right }; +/** The root scope of a component, managing all top-level bindings. */ export class ScopeRoot { /** @type {Set} */ conflicts = new Set(); diff --git a/packages/svelte/src/compiler/phases/types.d.ts b/packages/svelte/src/compiler/phases/types.d.ts index a1a85ce145..e7e331bbbf 100644 --- a/packages/svelte/src/compiler/phases/types.d.ts +++ b/packages/svelte/src/compiler/phases/types.d.ts @@ -17,6 +17,7 @@ import type { import type { Scope, ScopeRoot } from './scope.js'; import type { ExpressionMetadata } from './nodes.js'; +/** Parsed JavaScript module/script with scope information. */ export interface Js { ast: Program; scope: Scope; @@ -24,17 +25,20 @@ export interface Js { has_await: boolean; } +/** Parsed template with scope information. */ export interface Template { ast: AST.Fragment; scope: Scope; scopes: Map; } +/** A reactive `$:` statement with its dependencies and assignments. */ export interface ReactiveStatement { assignments: Set; dependencies: Binding[]; } +/** Metadata for a declaration that contains an await expression. */ export interface AwaitedDeclaration { id: Identifier; has_await: boolean; @@ -68,6 +72,7 @@ export interface Analysis { pickled_awaits: Set; } +/** Analysis results specific to a Svelte component. */ export interface ComponentAnalysis extends Analysis { root: ScopeRoot; instance: Js; diff --git a/packages/svelte/src/compiler/types/css.d.ts b/packages/svelte/src/compiler/types/css.d.ts index 13eb880d83..e7d5b6b858 100644 --- a/packages/svelte/src/compiler/types/css.d.ts +++ b/packages/svelte/src/compiler/types/css.d.ts @@ -1,19 +1,23 @@ import type { AST } from '#compiler'; export namespace _CSS { + /** Base interface for all CSS AST nodes. */ export interface BaseNode { start: number; end: number; } + /** Base interface for CSS stylesheets. */ export interface StyleSheetBase extends BaseNode { children: Array; } + /** A standalone CSS file stylesheet. */ export interface StyleSheetFile extends StyleSheetBase { type: 'StyleSheetFile'; } + /** A `