diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js index f8ba810a3d..72ca955d72 100644 --- a/packages/svelte/src/internal/client/dom/blocks/each.js +++ b/packages/svelte/src/internal/client/dom/blocks/each.js @@ -15,7 +15,7 @@ import { } from '../../hydration.js'; import { empty, map_get, map_set } from '../../operations.js'; import { insert, remove } from '../../reconciler.js'; -import { current_block, destroy_signal, set_signal_value } from '../../runtime.js'; +import { destroy_signal, set_signal_value } from '../../runtime.js'; import { destroy_effect, pause_effect, @@ -53,7 +53,7 @@ export function create_each_item_block(item, index, key) { // item v: item, // parent - p: /** @type {import('../../types.js').EachBlock} */ (current_block), + p: null, // transition r: null, // transitions diff --git a/packages/svelte/src/internal/client/types.d.ts b/packages/svelte/src/internal/client/types.d.ts index 3e886475e3..484554ae09 100644 --- a/packages/svelte/src/internal/client/types.d.ts +++ b/packages/svelte/src/internal/client/types.d.ts @@ -171,89 +171,6 @@ export type Transition = { d: HTMLElement; }; -export type IfBlock = { - /** value */ - v: boolean; - /** dom */ - d: null | TemplateNode | Array; - /** effect */ - e: null | EffectSignal; - /** parent */ - p: Block; - /** transition */ - r: null | ((transition: Transition) => void); - /** consequent transitions */ - c: null | Set; - /** alternate transitions */ - a: null | Set; - /** effect */ - ce: null | EffectSignal; - /** effect */ - ae: null | EffectSignal; - /** type */ - t: typeof IF_BLOCK; -}; - -export type HeadBlock = { - /** dom */ - d: null | TemplateNode | Array; - /** effect */ - e: null | ComputationSignal; - /** parent */ - p: Block; - /** transition */ - r: null | ((transition: Transition) => void); - /** type */ - t: typeof HEAD_BLOCK; -}; - -export type DynamicElementBlock = { - /** dom */ - d: null | TemplateNode | Array; - /** effect */ - e: null | ComputationSignal; - /** parent */ - p: Block; - /** transition */ - r: null | ((transition: Transition) => void); - /** type */ - t: typeof DYNAMIC_ELEMENT_BLOCK; -}; - -export type DynamicComponentBlock = { - /** dom */ - d: null | TemplateNode | Array; - /** effect */ - e: null | ComputationSignal; - /** parent */ - p: Block; - /** transition */ - r: null | ((transition: Transition) => void); - /** type */ - t: typeof DYNAMIC_COMPONENT_BLOCK; -}; - -export type EachBlock = { - /** anchor */ - a: Element | Comment; - /** flags */ - f: number; - /** dom */ - d: null | TemplateNode | Array; - /** items */ - v: EachItemBlock[]; - /** effewct */ - e: null | ComputationSignal; - /** parent */ - p: Block; - /** transition */ - r: null | ((transition: Transition) => void); - /** transitions */ - s: Array; - /** type */ - t: typeof EACH_BLOCK; -}; - export type EachItemBlock = { /** transition */ a: null | ((block: EachItemBlock, transitions: Set) => void); @@ -268,7 +185,7 @@ export type EachItemBlock = { /** key */ k: unknown; /** parent */ - p: EachBlock; + p: null; /** transition */ r: null | ((transition: Transition) => void); /** transitions */ @@ -277,27 +194,7 @@ export type EachItemBlock = { t: typeof EACH_ITEM_BLOCK; }; -export type SnippetBlock = { - /** dom */ - d: null | TemplateNode | Array; - /** parent */ - p: Block; - /** effect */ - e: null | ComputationSignal; - /** transition */ - r: null; - /** type */ - t: typeof SNIPPET_BLOCK; -}; - -export type Block = - | IfBlock - | DynamicElementBlock - | DynamicComponentBlock - | HeadBlock - | EachBlock - | EachItemBlock - | SnippetBlock; +export type Block = EachItemBlock; export type TransitionFn

= ( element: Element,